예제 #1
0
        public void CheckForUpdates(bool verbose)
        {
            this.verbose = verbose;

            HttpFileDownloader downloader = new HttpFileDownloader();

            downloader.Uri          = new Uri(download_url + doap_filename);
            downloader.TempPathRoot = Path.GetTempPath();
            downloader.Finished    += OnDoapDownloaderFinished;
            downloader.Start();

            temp_doap_path = downloader.LocalPath;
        }
예제 #2
0
        public void DisplayUpdateAvailableDialog()
        {
            bool update;

            using (var message_dialog = new MessageDialog(ServiceManager.Get <GtkElementsService> ().PrimaryWindow, 0,
                                                          MessageType.Question, ButtonsType.YesNo, String.Format(
                                                              Catalog.GetString("A new version of Banshee ({0}) is available.{1}Do you want to update?"), unstable_version, Environment.NewLine))) {
                message_dialog.WindowPosition = WindowPosition.CenterOnParent;
                message_dialog.Title          = Catalog.GetString("Banshee update available");
                update = (message_dialog.Run() == (int)ResponseType.Yes);
                message_dialog.Destroy();
            }

            if (update)
            {
                string downloadUrl = String.Format("{0}/Banshee-{1}.msi", installer_url, unstable_version);

                var downloader = new HttpFileDownloader()
                {
                    Uri           = new Uri(downloadUrl),
                    TempPathRoot  = Path.GetTempPath(),
                    FileExtension = "msi"
                };
                downloader.Progress += OnInstallerDownloaderProgress;
                downloader.Finished += OnInstallerDownloaderFinished;
                downloader.Start();

                temp_installer_path = downloader.LocalPath;

                job = new DownloadManagerJob(this)
                {
                    // Translators: {0} is the filename, eg Banshee-1.9.5.msi
                    Title     = String.Format(Catalog.GetString("Downloading {0}"), String.Format("Banshee-{0}.msi", unstable_version)),
                    CanCancel = false
                };

                ServiceManager.Get <JobScheduler> ().Add(job);
            }
        }