Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (LauncherModul.LastVersion == int.Parse(File.ReadAllText(Application.StartupPath + @"config.zpt")))
- {
- this.KeyPreview = true;
- this.WebBrowser.Visible = true;
- int Button = int.Parse(this.Web.DownloadString(Modul.WEB + "launcher/status/button.txt"));
- base.Visible = true;
- this.Label_Version.Visible = false;
- this.UpdatePatch.Visible = true;
- this.Start.Visible = false;
- this.Check.Visible = true;
- LauncherModul.LastVersion = int.Parse(this.Web.DownloadString(Modul.WEB + "launcher/versions/last_client_version.txt"));
- this.Label_Version.Text = "Versão de patch: " + File.ReadAllText(Application.StartupPath + @"config.zpt") + "/" + LauncherModul.LastVersion.ToString();
- this.Start.Enabled = false;
- if (this.Computer.FileSystem.DirectoryExists(Application.StartupPath + @"_LauncherPatchFiles"))
- {
- this.Computer.FileSystem.DeleteDirectory(Application.StartupPath + @"_LauncherPatchFiles", DeleteDirectoryOption.DeleteAllContents);
- }
- this.Label.Text = "Você já pode jogar.";
- if (Button == 1)
- {
- this.Start.Enabled = true;
- this.Check.Enabled = true;
- }
- else if (Button == 2)
- {
- this.Start.BackgroundImage = Resources.Start_Disable;
- this.Check.BackgroundImage = Resources.Check_Disable;
- this.Start.Enabled = false;
- this.Check.Enabled = false;
- }
- else if (Button == 3)
- {
- this.Check.BackgroundImage = Resources.Check_Disable;
- this.Check.Enabled = false;
- this.Start.Enabled = true;
- }
- else if (Button == 4)
- {
- this.Check.BackgroundImage = Resources.Check_Disable;
- this.Check.Enabled = false;
- this.Start.Enabled = true;
- }
- this.XmlLoad();
- this.Timer.Stop();
- }
- else
- {
- Value = true;
- int Version = int.Parse(File.ReadAllText(Application.StartupPath + @"config.zpt")) + 1;
- this.Computer.FileSystem.CreateDirectory(Application.StartupPath + @"_DownloadPatchFiles");
- try
- {
- this.GameUpdate.DownloadFileAsync(new Uri(Modul.UPDATEPATCH + "update/client/UpdatePatch_Client_" + Version + ".zip"), string.Concat(new object[] { Application.StartupPath, @"_DownloadPatchFilesUpdatePatch_Client_", Version, ".zip" }));
- }
- catch
- {
- this.Label.Text = "Falha na hora de atualizar.";
- MessageBox.Show("Por favor, desative o antivírus ou desative o Windows Defender.", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
- this.Logger("[ERROR] CODE UPDATE");
- }
- this.Bar2SetProgress(0L, 100L);
- this.Logger("[UPDATER_STATE_START] >>" + Version);
- this.Timer.Stop();
- }
- }
- catch
- {
- MessageBox.Show("Por favor, desative o antivírus ou desative o Windows Defender.", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement