Fixed bug when restarting from options menu

This commit is contained in:
CreepyCrafter24 2019-07-27 21:28:11 +02:00
parent cf4d9d6e85
commit fa681f52ff
1 changed files with 6 additions and 1 deletions

View File

@ -451,9 +451,14 @@ namespace LaptopSimulator2015
if (tmp && MessageBox.Show(strings.langWarning, "LaptopSimulator2015", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
winShouldClose = true;
string ex = "";
if (Application.ExecutablePath.Contains(" "))
ex = "\"\" \"" + Application.ExecutablePath + "\"";
else
ex = Application.ExecutablePath;
Process.Start(new ProcessStartInfo
{
Arguments = "/C timeout /t 2 /nobreak >nul && start \"" + Application.ExecutablePath + "\"",
Arguments = "/C timeout /t 2 /nobreak >nul && start " + ex,
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
FileName = "cmd.exe"