Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. if (LauncherModul.LastVersion == int.Parse(File.ReadAllText(Application.StartupPath + @"config.zpt")))
  2. {
  3. this.KeyPreview = true;
  4. this.WebBrowser.Visible = true;
  5. int Button = int.Parse(this.Web.DownloadString(Modul.WEB + "launcher/status/button.txt"));
  6. base.Visible = true;
  7. this.Label_Version.Visible = false;
  8. this.UpdatePatch.Visible = true;
  9. this.Start.Visible = false;
  10. this.Check.Visible = true;
  11. LauncherModul.LastVersion = int.Parse(this.Web.DownloadString(Modul.WEB + "launcher/versions/last_client_version.txt"));
  12. this.Label_Version.Text = "Versão de patch: " + File.ReadAllText(Application.StartupPath + @"config.zpt") + "/" + LauncherModul.LastVersion.ToString();
  13. this.Start.Enabled = false;
  14. if (this.Computer.FileSystem.DirectoryExists(Application.StartupPath + @"_LauncherPatchFiles"))
  15. {
  16. this.Computer.FileSystem.DeleteDirectory(Application.StartupPath + @"_LauncherPatchFiles", DeleteDirectoryOption.DeleteAllContents);
  17. }
  18. this.Label.Text = "Você já pode jogar.";
  19. if (Button == 1)
  20. {
  21. this.Start.Enabled = true;
  22. this.Check.Enabled = true;
  23. }
  24. else if (Button == 2)
  25. {
  26. this.Start.BackgroundImage = Resources.Start_Disable;
  27. this.Check.BackgroundImage = Resources.Check_Disable;
  28. this.Start.Enabled = false;
  29. this.Check.Enabled = false;
  30. }
  31. else if (Button == 3)
  32. {
  33. this.Check.BackgroundImage = Resources.Check_Disable;
  34. this.Check.Enabled = false;
  35. this.Start.Enabled = true;
  36. }
  37. else if (Button == 4)
  38. {
  39. this.Check.BackgroundImage = Resources.Check_Disable;
  40. this.Check.Enabled = false;
  41. this.Start.Enabled = true;
  42. }
  43. this.XmlLoad();
  44. this.Timer.Stop();
  45. }
  46. else
  47. {
  48. Value = true;
  49. int Version = int.Parse(File.ReadAllText(Application.StartupPath + @"config.zpt")) + 1;
  50. this.Computer.FileSystem.CreateDirectory(Application.StartupPath + @"_DownloadPatchFiles");
  51. try
  52. {
  53. this.GameUpdate.DownloadFileAsync(new Uri(Modul.UPDATEPATCH + "update/client/UpdatePatch_Client_" + Version + ".zip"), string.Concat(new object[] { Application.StartupPath, @"_DownloadPatchFilesUpdatePatch_Client_", Version, ".zip" }));
  54. }
  55. catch
  56. {
  57. this.Label.Text = "Falha na hora de atualizar.";
  58. MessageBox.Show("Por favor, desative o antivírus ou desative o Windows Defender.", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
  59. this.Logger("[ERROR] CODE UPDATE");
  60. }
  61. this.Bar2SetProgress(0L, 100L);
  62. this.Logger("[UPDATER_STATE_START] >>" + Version);
  63. this.Timer.Stop();
  64. }
  65. }
  66. catch
  67. {
  68. MessageBox.Show("Por favor, desative o antivírus ou desative o Windows Defender.", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement