示例#1
0
        private void LoadGUI(object sender, EventArgs e)
        {
            InitTimer();                                //progress timer

            AllocConsole();                             //enables console
            JsonCommon.OverrideModInstallerVariables(); //overrides vars if possible

            //check if in vs
            string dir = Directory.GetCurrentDirectory();

            for (int i = 0; i < 3; i++)
            {
                dir = Directory.GetParent(dir).ToString(); //move up 3 dirs
            }
            dir += @"\bin\";                               //add bin
            Console.WriteLine(ModInstallerCommon.Files.MainFiledir);
            Console.WriteLine("Detecting for" + ModInstallerCommon.Files.execdir);
            if (!File.Exists(ModInstallerCommon.Files.execdir) && !ModInstallerCommon.BypassExec && !Directory.Exists(dir))
            {
                MessageBox.Show("ModInstaller cannot find the executable! Make sure my location is in a folder inside the h3vr directory! Just in case, I'll pull up a tutorial for you.", "Exectuable not found!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                var psi = new ProcessStartInfo
                {
                    FileName        = "https://youtu.be/LBcxS_mYLFE?t=21",
                    UseShellExecute = true
                };
                Process.Start(psi);
                Application.Exit();
            }

            var onlineversion = new Version(JsonModList.GetDeserializedModListFormatOnline(JsonCommon.DatabaseInfo).Modlist[0].Version);

            if (ModInstallerCommon.ModInstallerVersion.CompareTo(onlineversion) < 0)
            {
                MessageBox.Show("H3VRModInstaller is out of date! (" + ModInstallerCommon.ModInstallerVersion + " vs " + onlineversion + ")", "Wrong version detected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                var psi = new ProcessStartInfo
                {
                    FileName        = JsonModList.GetDeserializedModListFormatOnline(JsonCommon.DatabaseInfo).Modlist[0].Website,
                    UseShellExecute = true
                };
                Process.Start(psi);
            }

            InstallButton.Hide();
            UpdateButton.Hide();
            ModVer.Hide();
            Delete.Hide();
            CheckButton.Hide();
            InstalledModsList.Hide();

            ModsEnabled.Checked = true;
            UpdateModList();
            UpdateCatagories();
        }
示例#2
0
        private void LoadGUI(object sender, EventArgs e)
        {
            KeyDown += Form_KeyDown;

            if (!File.Exists(Utilities.ModCache))
            {
                MessageBox.Show("Thank you for downloading H3VRModInstaller!\nIf there are any issues, or if you want a mod added, please hit us up on the Homebrew discord (@Frityet and @Potatoes)", "Thank you!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            InitTimer();                                //progress timer
            //AllocConsole(); //enables console
            JsonCommon.OverrideModInstallerVariables(); //overrides vars if possible

            var onlineversion = new Version(JsonModList.GetDeserializedModListFormatOnline(JsonCommon.DatabaseInfo)
                                            .Modlist[0].Version);

            if (ModInstallerCommon.ModInstallerVersion.CompareTo(onlineversion) < 0)
            {
                MessageBox.Show("H3VRModInstaller is out of date! (" + ModInstallerCommon.ModInstallerVersion + " vs " + onlineversion + ")", "Out of date version detected!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                var psi = new ProcessStartInfo
                {
                    FileName = JsonModList.GetDeserializedModListFormatOnline(JsonCommon.DatabaseInfo)
                               .Modlist[0]
                               .Website,
                    UseShellExecute = true
                };
                Process.Start(psi);
            }

            InstallButton.Hide();
            UpdateButton.Hide();
            ModVer.Hide();
            Delete.Hide();
            CheckButton.Hide();
            UpdateModList();
            UpdateCatagories();

            CatagoriesComboBox.SelectedIndex = 0;
        }
        /// <summary>
        ///     Main function, the args arent used though
        /// </summary>
        /// <param name="args">dunno why these are here</param>
        public static void Main_DEPRECIATED(string[] args)
        {
            JsonCommon.OverrideModInstallerVariables();
            //exe check
            Console.WriteLine("Detecting if " + ModInstallerCommon.Files.execdir + " exists...");
            if (!File.Exists(ModInstallerCommon.Files.execdir) && !ModInstallerCommon.BypassExec)
            {
                ModInstallerCommon.throwexept("H3VR not found!");
                return;
            }

            Console.WriteLine("H3VR found!");
            //online check
            if (!NetCheck.isOnline(ModInstallerCommon.Pingsite))
            {
                ModInstallerCommon.throwexept("Cannot connect to github!");
                return;
            }

            Console.WriteLine("Welcome to the H3VR Mod installer!");
            Console.WriteLine("Please select the mod you would like to install using 'dl [modnamehere]' ");
            Console.WriteLine("ex: 'dl wurstmod'");
            Console.WriteLine("To see a list of downloadable mods, type 'modlists'");
            Console.WriteLine("To see a list of commands, type 'help' \n");
Start:
            var input = Console.ReadLine();

            var inputargs = input.Split(' ');

            Array.Resize(ref inputargs, 10); //ensures no "OUT OF INDEX TIME TO SHIT MYSELF REEEE"


            doCommand(inputargs);

            Console.WriteLine("");
            goto Start;
        }