예제 #1
0
        void removeAppFromDIBVERFile()
        {
            Dictionary <string, int> versionsData = DIBVERHandler.GetVersionsData(Paths.DIBVER_FILE_PATH);

            if (versionsData.ContainsKey(appName))
            {
                versionsData.Remove(appName);
            }

            DIBVERHandler.SaveVersionsData(Paths.DIBVER_FILE_PATH, versionsData);
        }
예제 #2
0
        public async Task UpdateToVersion(int targetVersion, bool force = false)
        {
            createResourcesIfDoesntExist();

            string uri = $"http://caps.fail:5000/api/dibDownload/{appName}/{targetVersion}";

            versionsData = DIBVERHandler.GetVersionsData(Paths.DIBVER_FILE_PATH);
            if (!force && versionsData.ContainsKey(appName))
            {
                uri += $"/{versionsData[appName]}";
            }

            await update(uri, force);
        }
예제 #3
0
        public async Task <bool> IsUpdateAvailable()
        {
            string uri        = $"http://caps.fail:5000/api/dibInfo/GetVersionInfo/{appName}";
            string versionStr = await httpClient.GetStringAsync(uri);

            int versionNumber = int.Parse(versionStr);

            Dictionary <string, int> versionsData = DIBVERHandler.GetVersionsData(Paths.DIBVER_FILE_PATH);

            if (versionsData.ContainsKey(appName))
            {
                return(!(versionNumber == versionsData[appName]));
            }

            return(false);
        }
예제 #4
0
        void updateAppVersion()
        {
            int currentVersion = getVersion();

            versionsData = DIBVERHandler.GetVersionsData(Paths.DIBVER_FILE_PATH);
            if (versionsData.ContainsKey(appName))
            {
                versionsData[appName] = currentVersion;
            }
            else
            {
                versionsData.Add(appName, currentVersion);
            }

            DIBVERHandler.SaveVersionsData(Paths.DIBVER_FILE_PATH, versionsData);
        }
예제 #5
0
        public async Task <bool> IsInstalled()
        {
            Dictionary <string, int> versionsData = DIBVERHandler.GetVersionsData(Paths.DIBVER_FILE_PATH);

            return(versionsData.ContainsKey(appName));
        }