common helper for execute shell process from run plugins (#9538)

This commit is contained in:
Davide Giacometti
2021-02-23 09:53:08 +01:00
committed by GitHub
parent 20a922ce21
commit 571bceb386
17 changed files with 77 additions and 128 deletions

View File

@@ -4,11 +4,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Abstractions;
using System.Text;
using ManagedCommon;
using Microsoft.Plugin.Uri.UriHelper;
using Wox.Infrastructure;
using Wox.Infrastructure.Storage;
using Wox.Plugin;
using Wox.Plugin.Logger;
@@ -67,10 +67,14 @@ namespace Microsoft.Plugin.Uri
: DefaultIconPath,
Action = action =>
{
Process.Start(new ProcessStartInfo(uriResultString)
if (!Helper.OpenInShell(uriResultString))
{
UseShellExecute = true,
});
var title = $"Plugin: {Properties.Resources.Microsoft_plugin_uri_plugin_name}";
var message = $"{Properties.Resources.Microsoft_plugin_uri_open_failed}: {uriResultString}";
Context.API.ShowMsg(title, message);
return false;
}
return true;
},
});