Exemplo n.º 1
0
        private void ApplyResetOrVerify(ApplyUpdateWindow.UpdateWindowType type)
        {
            var targetDir      = GameInstallation.GetRootPath();
            var applicationDir = System.IO.Path.Combine(GameInstallation.GetRootPath(), "patch");
            var patchUrls      = VersionCheck.GamePatchUrls;
            var patchVersion   = VersionCheck.GetLatestGameVersionName();

            var  progress = new Progress <DirectoryPatcherProgressReport>();
            var  cancellationTokenSource = new System.Threading.CancellationTokenSource();
            Task task = new RXPatcher().ApplyPatchFromWeb(patchUrls, targetDir, applicationDir, progress, cancellationTokenSource.Token);

            var window = new ApplyUpdateWindow(task, progress, patchVersion, cancellationTokenSource, type);

            window.Owner = this;
            window.ShowDialog();

            VersionCheck.UpdateGameVersion();
        }