Don't bother with foreground window on unix

This commit is contained in:
Caelan Sayler
2024-03-28 13:02:31 +00:00
parent 2bb2ecb370
commit 0625c1e7da

View File

@@ -74,12 +74,14 @@ namespace Velopack
var p = Process.Start(psi); var p = Process.Start(psi);
if (p is not null) { if (VelopackRuntimeInfo.IsWindows) {
try { if (p is not null) {
// this is an attempt to work around a bug where the restarted app fails to come to foreground. try {
AllowSetForegroundWindow(p.Id); // this is an attempt to work around a bug where the restarted app fails to come to foreground.
} catch (Exception ex) { AllowSetForegroundWindow(p.Id);
logger.LogWarning(ex, "Failed to allow Update.exe to set foreground window."); } catch (Exception ex) {
logger.LogWarning(ex, "Failed to allow Update.exe to set foreground window.");
}
} }
} }