Beispiel #1
0
        internal void CheckUnityGame()
        {
            if (string.IsNullOrEmpty(Automated_UnityGame_Display.Text) || Automated_UnityGame_Display.Text.Equals("Please Select your Unity Game..."))
            {
                return;
            }
            byte[] filedata = File.ReadAllBytes(Automated_UnityGame_Display.Text);
            if ((filedata == null) ||
                (filedata.Length <= 0) ||
                (BitConverter.ToUInt16(filedata, (BitConverter.ToInt32(filedata, 60) + 4)) != 34404))
            {
                GameArch = 0;
            }
            else
            {
                GameArch = 1;
            }
            if (!string.IsNullOrEmpty(ManualZip_ZipArchive_Display.Text) &&
                !ManualZip_ZipArchive_Display.Text.Equals("Please Select your MelonLoader Zip Archive..."))
            {
                ManualZip_Install.Enabled = true;
            }
            if (Automated_Arch_AutoDetect.Checked)
            {
                Automated_Arch_Selection.SelectedIndex = GameArch;
                Automated_Arch_Selection.Select();
            }
            Program.GetCurrentInstallVersion(Path.GetDirectoryName(Automated_UnityGame_Display.Text));
            if (Program.CurrentInstalledVersion == null)
            {
                ManualZip_Install.Text      = "INSTALL";
                Automated_Install.Text      = "INSTALL";
                Automated_Install.Size      = new Size(419, 44);
                ManualZip_Install.Size      = new Size(419, 44);
                Automated_Uninstall.Visible = false;
                ManualZip_Uninstall.Visible = false;
                return;
            }
            Automated_Install.Size      = new Size(206, 44);
            ManualZip_Install.Size      = new Size(206, 44);
            Automated_Uninstall.Visible = true;
            ManualZip_Uninstall.Visible = true;
            ManualZip_Install.Text      = "RE-INSTALL";
            Version selected_ver = new Version(Automated_Version_Selection.Text.Substring(1));
            int     compare_ver  = selected_ver.CompareTo(Program.CurrentInstalledVersion);

            if (compare_ver < 0)
            {
                Automated_Install.Text = "DOWNGRADE";
            }
            else if (compare_ver > 0)
            {
                Automated_Install.Text = "UPDATE";
            }
            else
            {
                Automated_Install.Text = "RE-INSTALL";
            }
        }
Beispiel #2
0
 private void Automated_Arch_AutoDetect_CheckedChanged(object sender, EventArgs e)
 {
     Automated_Arch_Selection.Enabled = !Automated_Arch_AutoDetect.Checked;
     if (Automated_Arch_Selection.Enabled)
     {
         return;
     }
     Automated_Arch_Selection.SelectedIndex = GameArch;
     Automated_Arch_Selection.Select();
 }