Exemplo n.º 1
0
 private void DoOneUpdate()
 {
     if (this.updates.Count > 0)
     {
         this.updateState = "updating";
         this.changeStatusText("Downloading " + this.updates[0].versionNumber + "...");
         UpdateDownloader.Download(this.updates[0], this.onDownloadProgressChange, this.onDownloadComplete);
     }
     else
     {
         this.updateState = "updated";
         this.changeStatusText("Finish !");
         this.mainButton.Text           = "Start RetroZone !";
         this.retroZoneVersion          = RetroZoneVersion.GetFromExe();
         this.currentVersionNumber.Text = this.retroZoneVersion.value;
     }
 }
Exemplo n.º 2
0
        public async void PrimitiveCheck()
        {
            // EXE version
            this.changeStatusText("Checking versions...");
            this.retroZoneVersion          = RetroZoneVersion.GetFromExe();
            this.currentVersionNumber.Text = this.retroZoneVersion.value;


            // Updates available
            this.updates = await Update.GetFromApi(retroZoneVersion);

            if (this.updates == null)
            {
                Thread.Sleep(2000);
                Environment.Exit(0);
            }
            if (this.retroZoneVersion.value == "NEW")
            {
                this.newVersionNumber.Text = this.updates[0].versionNumber;
            }
            else
            {
                this.newVersionNumber.Text = (updates.Count > 1) ? this.updates[0].versionNumber : this.updates[1].versionNumber;
            }

            if (this.newVersionNumber.Text != this.currentVersionNumber.Text)
            {
                this.mainButton.Text    = (retroZoneVersion.value == "NEW") ? "Install" : "Update";
                this.mainButton.Enabled = true;
                this.mainButton.Click  += mainButtonClick;
                this.updateState        = "ready";
                this.changeStatusText("Ready !");
            }
            else
            {
                this.mainButton.Text = "Start RetroZone !";
                this.changeStatusText("No updates available...");
                this.updateState = "updated";
            }
        }