Fixed bug when restarting from options menu
This commit is contained in:
parent
cf4d9d6e85
commit
fa681f52ff
|
@ -451,9 +451,14 @@ namespace LaptopSimulator2015
|
||||||
if (tmp && MessageBox.Show(strings.langWarning, "LaptopSimulator2015", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
if (tmp && MessageBox.Show(strings.langWarning, "LaptopSimulator2015", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
winShouldClose = true;
|
winShouldClose = true;
|
||||||
|
string ex = "";
|
||||||
|
if (Application.ExecutablePath.Contains(" "))
|
||||||
|
ex = "\"\" \"" + Application.ExecutablePath + "\"";
|
||||||
|
else
|
||||||
|
ex = Application.ExecutablePath;
|
||||||
Process.Start(new ProcessStartInfo
|
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,
|
WindowStyle = ProcessWindowStyle.Hidden,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
FileName = "cmd.exe"
|
FileName = "cmd.exe"
|
||||||
|
|
Reference in New Issue