예제 #1
0
        public async Task Initialize()
        {
            updateClient = GetUpdateClient();

            try
            {
                var latestVersion = await updateClient.GetVersion("main");

                var latestUpdVersion = await updateClient.GetVersion("updater");

                var updVersion = CommonCoreLib.CommonFile.Version.GetVersion(ConstantValues.UpdaterFilePath);

                IsUpdate    = latestVersion != CurrentVersion;
                IsUpdUpdate = updVersion != latestUpdVersion;

                var details = await updateClient.DownloadFile(updateClient.DetailVersionInfoDownloadUrlPath);

                using var stream = new MemoryStream(details);
                var reader = new CommonXmlReader(stream);
                var nodes  = reader.GetNodes("/updates/update");

                Updates = Analyze(nodes);

                LatestVersion = latestVersion;
            }
            catch (NotEqualsHashException e)
            {
                Console.WriteLine(e.StackTrace);
                throw;
            }
        }