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);
if (p is not null) {
try {
// this is an attempt to work around a bug where the restarted app fails to come to foreground.
AllowSetForegroundWindow(p.Id);
} catch (Exception ex) {
logger.LogWarning(ex, "Failed to allow Update.exe to set foreground window.");
if (VelopackRuntimeInfo.IsWindows) {
if (p is not null) {
try {
// this is an attempt to work around a bug where the restarted app fails to come to foreground.
AllowSetForegroundWindow(p.Id);
} catch (Exception ex) {
logger.LogWarning(ex, "Failed to allow Update.exe to set foreground window.");
}
}
}