mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Fixes for Auto Update (#1908)
* Automatically restart audio capture when device changes. * Wait for process to terminate instead of waiting a fixed amount of time. * Application.Exit might not exit if there is a child process running. Environment.Exit(0) do though.
This commit is contained in:
@@ -120,7 +120,7 @@ namespace GHelper.AutoUpdate
|
|||||||
Logger.WriteLine(zipName);
|
Logger.WriteLine(zipName);
|
||||||
Logger.WriteLine(exeName);
|
Logger.WriteLine(exeName);
|
||||||
|
|
||||||
string command = $"Start-Sleep -Seconds 1; $ErrorActionPreference = \"Stop\"; Expand-Archive \"{zipName}\" -DestinationPath . -Force; Remove-Item \"{zipName}\" -Force; \".\\{exeName}\"; ";
|
string command = $"$ErrorActionPreference = \"Stop\"; Wait-Process -Name \"GHelper\"; Expand-Archive \"{zipName}\" -DestinationPath . -Force; Remove-Item \"{zipName}\" -Force; \".\\{exeName}\"; ";
|
||||||
Logger.WriteLine(command);
|
Logger.WriteLine(command);
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -139,7 +139,7 @@ namespace GHelper.AutoUpdate
|
|||||||
Logger.WriteLine(ex.Message);
|
Logger.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
Application.Exit();
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user