Ejemplo n.º 1
0
 private static void InstallFromZip(ref int returnval)
 {
     if (!Program.ValidateZipPath(ZipPath))
     {
         // Output Error
         return;
     }
     OperationHandler.ManualZip_Install(ZipPath, Path.GetDirectoryName(ExePath));
 }
Ejemplo n.º 2
0
        private void ClickedUninstall()
        {
            DialogResult result = MessageBox.Show("Are you sure you wish to Uninstall MelonLoader?", BuildInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result != DialogResult.Yes)
            {
                return;
            }
            OperationHandler.CurrentOperation = OperationHandler.Operations.UNINSTALL;
            Tab_Output.Text = "UN-INSTALL   ";
            new Thread(() => { OperationHandler.Uninstall(Path.GetDirectoryName(Automated_UnityGame_Display.Text)); }).Start();
            Program.SetTotalPercentage(0);
            PageManager.Cursor = Cursors.Default;
            PageManager.Controls.Clear();
            PageManager.Controls.Add(Tab_Output);
        }
Ejemplo n.º 3
0
        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")));
        }
Ejemplo n.º 4
0
 private void ManualZip_Install_Click(object sender, EventArgs e)
 {
     if (Program.CurrentInstalledVersion == null)
     {
         OperationHandler.CurrentOperation = OperationHandler.Operations.INSTALL;
         Tab_Output.Text = "INSTALL  ";
     }
     else
     {
         OperationHandler.CurrentOperation = OperationHandler.Operations.REINSTALL;
         Tab_Output.Text = "RE-INSTALL   ";
     }
     new Thread(() => { OperationHandler.ManualZip_Install(ManualZip_ZipArchive_Display.Text, Path.GetDirectoryName(Automated_UnityGame_Display.Text)); }).Start();
     Program.SetTotalPercentage(0);
     PageManager.Cursor = Cursors.Default;
     PageManager.Controls.Clear();
     PageManager.Controls.Add(Tab_Output);
 }
Ejemplo n.º 5
0
        private static void Uninstall(ref int returnval)
        {
            if (!Program.ValidateUnityGamePath(ref ExePath))
            {
                // Output Error
                return;
            }
            string folderpath = Path.GetDirectoryName(ExePath);

            Program.GetCurrentInstallVersion(folderpath);
            if (Program.CurrentInstalledVersion == null)
            {
                // Output Error
                return;
            }
            OperationHandler.CurrentOperation = OperationHandler.Operations.UNINSTALL;
            OperationHandler.Uninstall(folderpath);
        }
Ejemplo n.º 6
0
        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);
        }