Windows 0.3.7 updater exit and Windows session cleanup reliability; no private history or other platform changes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
namespace UCVL.VPNPlus;
|
||||
|
||||
// The confirmation dialog runs a nested message loop. Shutdown may win while
|
||||
// it is open, or while the package is downloading; never launch afterwards.
|
||||
internal static class ClientUpdateFlow
|
||||
{
|
||||
internal static async Task<bool> RunAsync(Func<bool> isCurrent, Func<bool> confirm,
|
||||
Func<Task<string>> download, Action<string> launch)
|
||||
{
|
||||
if (!isCurrent() || !confirm() || !isCurrent()) return false;
|
||||
var installer = await download();
|
||||
if (!isCurrent()) return false;
|
||||
launch(installer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user