Return value of RunAsDesktopUser

This commit is contained in:
Jack251970 2025-06-12 18:46:31 +08:00
parent 9c6c015b1d
commit 8cfaeeae6b

View file

@ -586,14 +586,13 @@ namespace Flow.Launcher
// Deelevate process if it is running as administrator // Deelevate process if it is running as administrator
if (Win32Helper.IsAdministrator() && !runAsAdmin) if (Win32Helper.IsAdministrator() && !runAsAdmin)
{ {
Win32Helper.RunAsDesktopUser(filePath, workingDirectory, arguments, out var errorInfo); var result = Win32Helper.RunAsDesktopUser(filePath, workingDirectory, arguments, out var errorInfo);
if (!string.IsNullOrEmpty(errorInfo)) if (!string.IsNullOrEmpty(errorInfo))
{ {
LogError(ClassName, $"Failed to start process {filePath} with error: {errorInfo}"); LogError(ClassName, $"Failed to start process {filePath} with error: {errorInfo}");
return false;
} }
return true; return result;
} }
var info = new ProcessStartInfo var info = new ProcessStartInfo