From fa681f52ff011a83ec605db7c1c4a256f6288393 Mon Sep 17 00:00:00 2001 From: CreepyCrafter24 <33260128+CreepyCrafter24@users.noreply.github.com> Date: Sat, 27 Jul 2019 21:28:11 +0200 Subject: [PATCH] Fixed bug when restarting from options menu --- LaptopSimulator2015/FakeDesktop.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LaptopSimulator2015/FakeDesktop.cs b/LaptopSimulator2015/FakeDesktop.cs index 141bbc7..fd62a05 100644 --- a/LaptopSimulator2015/FakeDesktop.cs +++ b/LaptopSimulator2015/FakeDesktop.cs @@ -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"