Compare commits

...

3 Commits

2 changed files with 15 additions and 1 deletions

View File

@@ -152,7 +152,18 @@ namespace Microsoft.Plugin.Program.Programs
var info = ShellCommand.SetProcessStartInfo(command, verb: "runas");
info.UseShellExecute = true;
info.Arguments = queryArguments;
Process.Start(info);
try
{
Process.Start(info);
}
catch (Exception e)
{
ProgramLogger.Exception($"Unable to run {DisplayName} as administrator", e, MethodBase.GetCurrentMethod().DeclaringType, command);
var name = "Plugin: " + Properties.Resources.wox_plugin_program_plugin_name;
var message = Properties.Resources.powertoys_run_plugin_program_uwp_run_as_admin_not_supported;
api.ShowMsg(name, message, string.Empty);
}
return true;
},
});

View File

@@ -165,6 +165,9 @@
<data name="powertoys_run_plugin_program_uwp_failed" xml:space="preserve">
<value>Can't start UWP</value>
</data>
<data name="powertoys_run_plugin_program_uwp_run_as_admin_not_supported" xml:space="preserve">
<value>Unable to run as administrator. Packaged UWP apps do not support elevated launch via this method.</value>
</data>
<data name="wox_plugin_program_run_as_user" xml:space="preserve">
<value>Run as different user (Ctrl+Shift+U)</value>
</data>