|
@@ -69,296 +69,227 @@ namespace Optimizer
|
|
|
Application.EnableVisualStyles();
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
- // prompt to change filename to 'Optimizer' (skip if experimental build)
|
|
|
- // annoying?
|
|
|
+ // single-instance mechanism
|
|
|
+ MUTEX = new Mutex(true, MUTEX_GUID, out _notRunning);
|
|
|
|
|
|
- //if (!EXPERIMENTAL_BUILD && Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location) != "Optimizer")
|
|
|
- //{
|
|
|
- // MessageBox.Show(string.Format(_renameAppMessage, Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)), "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- // Environment.Exit(0);
|
|
|
- //}
|
|
|
+ if (!_notRunning)
|
|
|
+ {
|
|
|
+ MessageBox.Show(_alreadyRunningMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // single-instance mechanism
|
|
|
- using (MUTEX = new Mutex(true, MUTEX_GUID, out _notRunning))
|
|
|
+ if (!Utilities.IsAdmin())
|
|
|
+ {
|
|
|
+ string file = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
+ ProcessStartInfo p = new ProcessStartInfo(file);
|
|
|
+ p.Verb = "runas";
|
|
|
+ p.Arguments = string.Join(" ", switches);
|
|
|
+ Process.Start(p);
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Utilities.IsCompatible())
|
|
|
+ {
|
|
|
+ HelperForm f = new HelperForm(null, MessageType.Error, _unsupportedMessage);
|
|
|
+ f.ShowDialog();
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Required.Deploy();
|
|
|
+ FontHelper.LoadFont();
|
|
|
+
|
|
|
+ if (switches.Length == 1)
|
|
|
{
|
|
|
- if (!_notRunning)
|
|
|
+ string arg = switches[0].Trim().ToLowerInvariant();
|
|
|
+
|
|
|
+ // UNSAFE mode switch (allows running on Windows Server 2008+)
|
|
|
+ if (arg == "/unsafe")
|
|
|
{
|
|
|
- MessageBox.Show(_alreadyRunningMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ UNSAFE_MODE = true;
|
|
|
+ StartMainForm();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (arg == "/disablehpet")
|
|
|
+ {
|
|
|
+ Utilities.DisableHPET();
|
|
|
Environment.Exit(0);
|
|
|
+ return;
|
|
|
}
|
|
|
- else
|
|
|
+ if (arg == "/enablehpet")
|
|
|
+ {
|
|
|
+ Utilities.EnableHPET();
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // [!!!] unlock all cores instruction
|
|
|
+ if (arg == "/unlockcores")
|
|
|
+ {
|
|
|
+ Utilities.UnlockAllCores();
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (arg == "/repair")
|
|
|
+ {
|
|
|
+ Utilities.Repair(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (arg == "/version")
|
|
|
+ {
|
|
|
+ if (!EXPERIMENTAL_BUILD) MessageBox.Show($"Optimizer: {GetCurrentVersionTostring()}\n\nCoded by: deadmoon © ∞\n\nhttps://github.com/hellzerg/optimizer", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ else MessageBox.Show("Optimizer: EXPERIMENTAL BUILD. PLEASE DELETE AFTER TESTING.\n\nCoded by: deadmoon © ∞\n\nhttps://github.com/hellzerg/optimizer", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // instruct to restart in safe-mode
|
|
|
+ if (arg == "/restart=safemode")
|
|
|
+ {
|
|
|
+ RestartInSafeMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // instruct to restart normally
|
|
|
+ if (arg == "/restart=normal")
|
|
|
+ {
|
|
|
+ RestartInNormalMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // disable defender automatically
|
|
|
+ if (arg == "/restart=disabledefender")
|
|
|
+ {
|
|
|
+ // set RunOnce instruction
|
|
|
+ Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerDisableDefender", Assembly.GetExecutingAssembly().Location + " /silentdisabledefender", Microsoft.Win32.RegistryValueKind.String);
|
|
|
+ RestartInSafeMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // enable defender automatically
|
|
|
+ if (arg == "/restart=enabledefender")
|
|
|
{
|
|
|
- // Restart process with admin rights, preserving arguments
|
|
|
- if (!Utilities.IsAdmin())
|
|
|
+ // set RunOnce instruction
|
|
|
+ Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerEnableDefender", Assembly.GetExecutingAssembly().Location + " /silentenabledefender", Microsoft.Win32.RegistryValueKind.String);
|
|
|
+ RestartInSafeMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // return from safe-mode automatically
|
|
|
+ if (arg == "/silentdisabledefender")
|
|
|
+ {
|
|
|
+ DisableDefenderInSafeMode();
|
|
|
+ RestartInNormalMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (arg == "/silentenabledefender")
|
|
|
+ {
|
|
|
+ EnableDefenderInSafeMode();
|
|
|
+ RestartInNormalMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ // disables Defender in SAFE MODE (for Windows 10 1903+ / works in Windows 11 as well)
|
|
|
+ if (arg == "/disabledefender")
|
|
|
+ {
|
|
|
+ DisableDefenderInSafeMode();
|
|
|
+
|
|
|
+ MessageBox.Show("Windows Defender has been completely disabled successfully.", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // other options for disabling specific tools
|
|
|
+ if (arg.StartsWith("/disable="))
|
|
|
+ {
|
|
|
+ string x = arg.Replace("/disable=", string.Empty);
|
|
|
+ string[] opts = x.Split(',');
|
|
|
+
|
|
|
+ bool[] codes =
|
|
|
{
|
|
|
- string file = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
- ProcessStartInfo p = new ProcessStartInfo(file);
|
|
|
- p.Verb = "runas";
|
|
|
- p.Arguments = string.Join(" ", switches);
|
|
|
- Process.Start(p);
|
|
|
+ opts.Contains("indicium"),
|
|
|
+ opts.Contains("uwp"),
|
|
|
+ opts.Contains("apps"),
|
|
|
+ opts.Contains("hosts"),
|
|
|
+ opts.Contains("startup"),
|
|
|
+ opts.Contains("cleaner"),
|
|
|
+ opts.Contains("integrator"),
|
|
|
+ opts.Contains("pinger")
|
|
|
+ };
|
|
|
+
|
|
|
+ StartMainForm(codes);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (arg.StartsWith("/config="))
|
|
|
+ {
|
|
|
+ string fileName = arg.Replace("/config=", string.Empty);
|
|
|
+
|
|
|
+ if (!File.Exists(fileName))
|
|
|
+ {
|
|
|
+ MessageBox.Show(_confNotFoundMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ SilentOps.GetSilentConfig(fileName);
|
|
|
+ if (SilentOps.CurrentSilentConfig == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
Environment.Exit(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (SilentOps.CurrentSilentConfig.WindowsVersion == 7 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ SilentOps.ProcessSilentConfigGeneral();
|
|
|
+ SilentOps.SilentUpdateOptionsGeneral();
|
|
|
+ Options.SaveSettings();
|
|
|
+ }
|
|
|
+ else if (SilentOps.CurrentSilentConfig.WindowsVersion == 8 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ SilentOps.ProcessSilentConfigGeneral();
|
|
|
+ SilentOps.ProcessSilentConfigWindows8();
|
|
|
+ SilentOps.SilentUpdateOptionsGeneral();
|
|
|
+ SilentOps.SilentUpdateOptions8();
|
|
|
+ Options.SaveSettings();
|
|
|
+ }
|
|
|
+ else if (SilentOps.CurrentSilentConfig.WindowsVersion == 10 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ SilentOps.ProcessSilentConfigGeneral();
|
|
|
+ SilentOps.ProcessSilentConfigWindows10();
|
|
|
+ SilentOps.SilentUpdateOptionsGeneral();
|
|
|
+ SilentOps.SilentUpdateOptions10();
|
|
|
+ Options.SaveSettings();
|
|
|
+ }
|
|
|
+ else if (SilentOps.CurrentSilentConfig.WindowsVersion == 11 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ SilentOps.ProcessSilentConfigGeneral();
|
|
|
+ SilentOps.ProcessSilentConfigWindows10();
|
|
|
+ SilentOps.ProcessSilentConfigWindows11();
|
|
|
+ SilentOps.SilentUpdateOptionsGeneral();
|
|
|
+ SilentOps.SilentUpdateOptions10();
|
|
|
+ SilentOps.SilentUpdateOptions11();
|
|
|
+ Options.SaveSettings();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (Utilities.IsCompatible())
|
|
|
- {
|
|
|
- Required.Deploy();
|
|
|
-
|
|
|
- FontHelper.LoadFont();
|
|
|
-
|
|
|
- for (int z = 0; z < switches.Length; z++) switches[z] = switches[z].ToLowerInvariant();
|
|
|
-
|
|
|
- // checking for silent config argument
|
|
|
- if (switches.Length == 1)
|
|
|
- {
|
|
|
- string arg = switches[0].Trim();
|
|
|
-
|
|
|
- // UNSAFE mode switch (allows running on Windows Server 2008+)
|
|
|
- if (arg == "/unsafe")
|
|
|
- {
|
|
|
- UNSAFE_MODE = true;
|
|
|
-
|
|
|
- LoadSettings();
|
|
|
- StartSplashForm();
|
|
|
-
|
|
|
- _MainForm = new MainForm(_SplashForm);
|
|
|
- _MainForm.Load += MainForm_Load;
|
|
|
- Application.Run(_MainForm);
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (arg == "/disablehpet")
|
|
|
- {
|
|
|
- Utilities.DisableHPET();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- if (arg == "/enablehpet")
|
|
|
- {
|
|
|
- Utilities.EnableHPET();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- if (arg == "/addstartup")
|
|
|
- {
|
|
|
- Utilities.RegisterAutoStart();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- if (arg == "/deletestartup")
|
|
|
- {
|
|
|
- Utilities.UnregisterAutoStart();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- // [!!!] unlock all cores instruction
|
|
|
- if (arg == "/unlockcores")
|
|
|
- {
|
|
|
- Utilities.UnlockAllCores();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- // repairs corrupted configuration
|
|
|
- if (arg == "/reset")
|
|
|
- {
|
|
|
- Utilities.Repair(true);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // displays build info
|
|
|
- if (arg == "/version")
|
|
|
- {
|
|
|
- if (!EXPERIMENTAL_BUILD) MessageBox.Show($"Optimizer: {GetCurrentVersionTostring()}\n\nCoded by: deadmoon © ∞\n\nhttps://github.com/hellzerg/optimizer", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- else MessageBox.Show("Optimizer: EXPERIMENTAL BUILD. PLEASE DELETE AFTER TESTING.\n\nCoded by: deadmoon © ∞\n\nhttps://github.com/hellzerg/optimizer", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
-
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- // hibernation switches
|
|
|
- if (arg == "/disablehibernate")
|
|
|
- {
|
|
|
- Utilities.DisableHibernation();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- if (arg == "/enablehibernate")
|
|
|
- {
|
|
|
- Utilities.EnableHibernation();
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
-
|
|
|
- // instruct to restart in safe-mode
|
|
|
- if (arg == "/restart=safemode")
|
|
|
- {
|
|
|
- RestartInSafeMode();
|
|
|
- }
|
|
|
-
|
|
|
- // instruct to restart normally
|
|
|
- if (arg == "/restart=normal")
|
|
|
- {
|
|
|
- RestartInNormalMode();
|
|
|
- }
|
|
|
-
|
|
|
- // disable defender automatically
|
|
|
- if (arg == "/restart=disabledefender")
|
|
|
- {
|
|
|
- // set RunOnce instruction
|
|
|
- Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerDisableDefender", Assembly.GetExecutingAssembly().Location + " /silentdisabledefender", Microsoft.Win32.RegistryValueKind.String);
|
|
|
- RestartInSafeMode();
|
|
|
- }
|
|
|
-
|
|
|
- // enable defender automatically
|
|
|
- if (arg == "/restart=enabledefender")
|
|
|
- {
|
|
|
- // set RunOnce instruction
|
|
|
- Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce", "*OptimizerEnableDefender", Assembly.GetExecutingAssembly().Location + " /silentenabledefender", Microsoft.Win32.RegistryValueKind.String);
|
|
|
- RestartInSafeMode();
|
|
|
- }
|
|
|
-
|
|
|
- // return from safe-mode automatically
|
|
|
- if (arg == "/silentdisabledefender")
|
|
|
- {
|
|
|
- DisableDefenderInSafeMode();
|
|
|
- RestartInNormalMode();
|
|
|
- }
|
|
|
-
|
|
|
- if (arg == "/silentenabledefender")
|
|
|
- {
|
|
|
- EnableDefenderInSafeMode();
|
|
|
- RestartInNormalMode();
|
|
|
- }
|
|
|
-
|
|
|
- // other options for disabling specific tools
|
|
|
- if (arg.StartsWith("/disable="))
|
|
|
- {
|
|
|
- string x = arg.Replace("/disable=", string.Empty);
|
|
|
- string[] opts = x.Split(',');
|
|
|
-
|
|
|
- bool disableIndicium = opts.Contains("indicium");
|
|
|
- bool disableUWPTool = opts.Contains("uwp");
|
|
|
- bool disableAppsTool = opts.Contains("apps");
|
|
|
- bool disableHostsEditor = opts.Contains("hosts");
|
|
|
- bool disableStartupTool = opts.Contains("startup");
|
|
|
- bool disableCleaner = opts.Contains("cleaner");
|
|
|
- bool disableIntegrator = opts.Contains("integrator");
|
|
|
- bool disablePinger = opts.Contains("pinger");
|
|
|
-
|
|
|
- LoadSettings();
|
|
|
- StartSplashForm();
|
|
|
-
|
|
|
- _MainForm = new MainForm(_SplashForm, disableIndicium, disableHostsEditor, disableAppsTool, disableUWPTool, disableStartupTool, disableCleaner, disableIntegrator, disablePinger);
|
|
|
- _MainForm.Load += MainForm_Load;
|
|
|
- Application.Run(_MainForm);
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // disables Defender in SAFE MODE (for Windows 10 1903+ / works in Windows 11 as well)
|
|
|
- if (arg == "/disabledefender")
|
|
|
- {
|
|
|
- DisableDefenderInSafeMode();
|
|
|
-
|
|
|
- MessageBox.Show("Windows Defender has been completely disabled successfully.", "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- Environment.Exit(0);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (arg.StartsWith("/"))
|
|
|
- {
|
|
|
- if (File.Exists(arg.Remove(0, 1)))
|
|
|
- {
|
|
|
- SilentOps.GetSilentConfig(arg.Remove(0, 1));
|
|
|
-
|
|
|
- if (SilentOps.CurrentSilentConfig != null)
|
|
|
- {
|
|
|
- if (SilentOps.CurrentSilentConfig.WindowsVersion == 7 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows7)
|
|
|
- {
|
|
|
- LoadSettings();
|
|
|
- SilentOps.ProcessSilentConfigGeneral();
|
|
|
- SilentOps.SilentUpdateOptionsGeneral();
|
|
|
- Options.SaveSettings();
|
|
|
- }
|
|
|
- else if (SilentOps.CurrentSilentConfig.WindowsVersion == 8 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows8)
|
|
|
- {
|
|
|
- LoadSettings();
|
|
|
- SilentOps.ProcessSilentConfigGeneral();
|
|
|
- SilentOps.ProcessSilentConfigWindows8();
|
|
|
- SilentOps.SilentUpdateOptionsGeneral();
|
|
|
- SilentOps.SilentUpdateOptions8();
|
|
|
- Options.SaveSettings();
|
|
|
- }
|
|
|
- else if (SilentOps.CurrentSilentConfig.WindowsVersion == 10 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows10)
|
|
|
- {
|
|
|
- LoadSettings();
|
|
|
- SilentOps.ProcessSilentConfigGeneral();
|
|
|
- SilentOps.ProcessSilentConfigWindows10();
|
|
|
- SilentOps.SilentUpdateOptionsGeneral();
|
|
|
- SilentOps.SilentUpdateOptions10();
|
|
|
- Options.SaveSettings();
|
|
|
- }
|
|
|
- else if (SilentOps.CurrentSilentConfig.WindowsVersion == 11 && Utilities.CurrentWindowsVersion == WindowsVersion.Windows11)
|
|
|
- {
|
|
|
- LoadSettings();
|
|
|
- SilentOps.ProcessSilentConfigGeneral();
|
|
|
- SilentOps.ProcessSilentConfigWindows10();
|
|
|
- SilentOps.ProcessSilentConfigWindows11();
|
|
|
- SilentOps.SilentUpdateOptionsGeneral();
|
|
|
- SilentOps.SilentUpdateOptions10();
|
|
|
- SilentOps.SilentUpdateOptions11();
|
|
|
- Options.SaveSettings();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show(_confInvalidFormatMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show(_confNotFoundMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show(_argInvalidMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LoadSettings();
|
|
|
- StartSplashForm();
|
|
|
-
|
|
|
- _MainForm = new MainForm(_SplashForm);
|
|
|
- _MainForm.Load += MainForm_Load;
|
|
|
-
|
|
|
- Application.Run(_MainForm);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- HelperForm f = new HelperForm(null, MessageType.Error, _unsupportedMessage);
|
|
|
- f.ShowDialog();
|
|
|
-
|
|
|
- Environment.Exit(0);
|
|
|
- }
|
|
|
+ MessageBox.Show(_confInvalidVersionMsg, "Optimizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+ Environment.Exit(0);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ StartMainForm();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //internal static void ForceExit()
|
|
|
- //{
|
|
|
- // Environment.Exit(0);
|
|
|
- //}
|
|
|
-
|
|
|
private static void LoadSettings()
|
|
|
{
|
|
|
// for backward compatibility (legacy)
|
|
@@ -437,6 +368,26 @@ namespace Optimizer
|
|
|
File.Delete("EnableDefenderSafeMode.bat");
|
|
|
}
|
|
|
|
|
|
+ private static void StartMainForm()
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ StartSplashForm();
|
|
|
+
|
|
|
+ _MainForm = new MainForm(_SplashForm);
|
|
|
+ _MainForm.Load += MainForm_Load;
|
|
|
+ Application.Run(_MainForm);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void StartMainForm(bool[] codes)
|
|
|
+ {
|
|
|
+ LoadSettings();
|
|
|
+ StartSplashForm();
|
|
|
+
|
|
|
+ _MainForm = new MainForm(_SplashForm, codes[0], codes[1], codes[2], codes[3], codes[4], codes[5], codes[6], codes[7]);
|
|
|
+ _MainForm.Load += MainForm_Load;
|
|
|
+ Application.Run(_MainForm);
|
|
|
+ }
|
|
|
+
|
|
|
private static void StartSplashForm()
|
|
|
{
|
|
|
_SplashForm = new SplashForm();
|