mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 20:45:38 +02:00
#348, do upgrade after pw process is killed
This commit is contained in:
parent
e6f11c354d
commit
8d3816553b
1 changed files with 4 additions and 1 deletions
|
@ -266,7 +266,10 @@ namespace PersistentWindows.SystrayShell
|
|||
upgradeDownloaded[latestVersion] = true;
|
||||
|
||||
string batFile = Path.Combine(Program.AppdataFolder, $"pw_upgrade.bat");
|
||||
string content = "timeout /t 10 /nobreak > NUL";
|
||||
string content = ":wait_to_finish";
|
||||
content += "\ntimeout /t 2 /nobreak >nul";
|
||||
content += "\ntasklist | find \"PersistentWindows\" >nul";
|
||||
content += "\nif not errorlevel 1 goto wait_to_finish";
|
||||
content += $"\ncopy /Y \"{dst_dir}\\*.*\" \"{install_dir}\"";
|
||||
content += "\nstart \"\" /B \"" + Path.Combine(install_dir, Application.ProductName) + ".exe\" " + Program.CmdArgs;
|
||||
File.WriteAllText(batFile, content);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue