예제 #1
0
        public void DownloadUpdate(UpdateInformation updateInfo)
        {
            var getUpdater = GetUpdaterVersion()
                < updateInfo.Manifest.UpdaterVersion;

            UpdateDownloader.Download (updateInfo, getUpdater);
        }
예제 #2
0
        public void Download(UpdateInformation updateInfo, bool downloadUpdater)
        {
            var patchDest = Path.Combine (updateCacheDir,
                Path.GetFileName (updateInfo.PatchZipUri.LocalPath));

            if (downloadUpdater) {
                DownloadFile (updateInfo.UpdaterUri, updaterPath,
                    (s, e) => DownloadFile (updateInfo.PatchZipUri, patchDest));
                return;
            }
            DownloadFile (updateInfo.PatchZipUri, patchDest);
        }
예제 #3
0
        //<returns>False if exception, otherwise true</returns>
        private bool TryGetUpdateManifest(out UpdateInformation updateInfo, out Exception ex)
        {
            string result;
            if (!UpdateHelper.TryDownloadString (remoteManifestUri, out result, out ex)) {
                updateInfo = null;
                return false;
            }

            UpdateManifest manifest;
            try {
                manifest = UpdateManifest.ParseManifest (result);
            } catch (Exception exception) {
                ex = exception;
                updateInfo = null;
                return false;
            }

            // Get the patch notes
            string patchNotes;
            var patchNotesUri = remoteManifestUri.Append (manifest.ProductVersion + ".patchnotes");
            if (!UpdateHelper.TryDownloadString (patchNotesUri, out patchNotes, out ex))
                patchNotes = "No patch notes available.";

            var patchZipUri = remoteManifestUri.Append (manifest.ProductVersion + ".zip");
            var updateUri = remoteManifestUri.Append ("updater." + manifest.UpdaterVersion + ".exe");
            updateInfo = new UpdateInformation (manifest, patchZipUri, updateUri, patchNotes);
            return true;
        }
예제 #4
0
 private void onUpdateFound(UpdateInformation updateInfo)
 {
     var handler = UpdateFound;
     if (handler != null) {
         handler (this, new UpdateCheckerEventArgs (updateInfo));
     }
 }
예제 #5
0
 private void updateFound(UpdateInformation updateInfo)
 {
     waitingUpdate = updateInfo;
     setFormState (PatchFormState.WaitingInstall);
     showPatchNotes();
 }