Skip to content

Commit e1242ee

Browse files
committed
Check Process.Start usage
1 parent 8c81808 commit e1242ee

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ public static void OpenImeSettings()
674674
{
675675
try
676676
{
677+
// No need to de-elevate since we are opening windows settings which cannot bring security risks
677678
Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
678679
}
679680
catch (System.Exception)

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public static void RestartApp(bool forceAdmin = false)
367367
UseShellExecute = true,
368368
Verb = Win32Helper.IsAdministrator() || forceAdmin ? "runas" : ""
369369
};
370-
Process.Start(startInfo);
370+
Process.Start(startInfo); // No need to de-elevate since we are restarting
371371
Thread.Sleep(500);
372372
Environment.Exit(0);
373373

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null
404404
}
405405
}
406406

407-
408407
private void OpenUri(Uri uri, bool? inPrivate = null)
409408
{
410409
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
@@ -438,13 +437,7 @@ private void OpenUri(Uri uri, bool? inPrivate = null)
438437
}
439438
else
440439
{
441-
Process.Start(new ProcessStartInfo()
442-
{
443-
FileName = uri.AbsoluteUri,
444-
UseShellExecute = true
445-
})?.Dispose();
446-
447-
return;
440+
StartProcess(uri.AbsoluteUri, arguments: null, useShellExecute: true);
448441
}
449442
}
450443

Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ private static bool DoOpenSettingsAction(WindowsSetting entry)
198198

199199
try
200200
{
201+
// No need to de-elevate since we are opening windows settings which cannot bring security risks
201202
Process.Start(processStartInfo);
202203
return true;
203204
}

0 commit comments

Comments
 (0)