private static void Install(ref int returnval) { if (!Program.ValidateUnityGamePath(ref ExePath)) { // Output Error return; } Program.GetCurrentInstallVersion(Path.GetDirectoryName(ExePath)); if (!string.IsNullOrEmpty(ZipPath)) { InstallFromZip(ref returnval); return; } Releases.RequestLists(); if (Releases.All.Count <= 0) { // Output Error return; } // Pull Latest Version string selected_version = "v0.0.0.0"; if (Program.CurrentInstalledVersion == null) { OperationHandler.CurrentOperation = OperationHandler.Operations.INSTALL; } else { Version selected_ver = new Version(selected_version); int compare_ver = selected_ver.CompareTo(Program.CurrentInstalledVersion); if (compare_ver < 0) { OperationHandler.CurrentOperation = OperationHandler.Operations.DOWNGRADE; } else if (compare_ver > 0) { OperationHandler.CurrentOperation = OperationHandler.Operations.UPDATE; } else { OperationHandler.CurrentOperation = OperationHandler.Operations.REINSTALL; } } OperationHandler.Automated_Install(Path.GetDirectoryName(ExePath), selected_version, Requested32Bit, (selected_version.StartsWith("v0.2") || selected_version.StartsWith("v0.1"))); }
private void Automated_Install_Click(object sender, EventArgs e) { if ((Program.CurrentInstalledVersion == null) || string.IsNullOrEmpty(Automated_Version_Selection.Text)) { OperationHandler.CurrentOperation = OperationHandler.Operations.INSTALL; Tab_Output.Text = "INSTALL "; } else { Version selected_ver = new Version(Automated_Version_Selection.Text.Substring(1)); int compare_ver = selected_ver.CompareTo(Program.CurrentInstalledVersion); if (compare_ver < 0) { OperationHandler.CurrentOperation = OperationHandler.Operations.DOWNGRADE; Tab_Output.Text = "DOWNGRADE "; } else if (compare_ver > 0) { OperationHandler.CurrentOperation = OperationHandler.Operations.UPDATE; Tab_Output.Text = "UPDATE "; } else { OperationHandler.CurrentOperation = OperationHandler.Operations.REINSTALL; Tab_Output.Text = "RE-INSTALL "; } } bool legacy_version = (Automated_Version_Selection.Text.StartsWith("v0.2") || Automated_Version_Selection.Text.StartsWith("v0.1")); string selected_version = Automated_Version_Selection.Text; new Thread(() => { OperationHandler.Automated_Install(Path.GetDirectoryName(Automated_UnityGame_Display.Text), selected_version, (legacy_version ? false : (Automated_Arch_Selection.SelectedIndex == 0)), legacy_version); }).Start(); Program.SetTotalPercentage(0); PageManager.Cursor = Cursors.Default; PageManager.Controls.Clear(); PageManager.Controls.Add(Tab_Output); }