mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add admin permissions when non-admin doesn't work
This commit is contained in:
parent
c55edca7cc
commit
6cc5fe8ff6
1 changed files with 16 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
@ -201,6 +202,21 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
|
|||
Process.Start(processStartInfo);
|
||||
return true;
|
||||
}
|
||||
catch (Win32Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
processStartInfo.UseShellExecute = true;
|
||||
processStartInfo.Verb = "runas";
|
||||
Process.Start(processStartInfo);
|
||||
return true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.Exception("can't open settings on elevated permission", exception, typeof(ResultHelper));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.Exception("can't open settings", exception, typeof(ResultHelper));
|
||||
|
|
|
|||
Loading…
Reference in a new issue