mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Trying a fix for #1503
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2595 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
d693b3765a
commit
3820ad7c19
1 changed files with 17 additions and 1 deletions
|
@ -26,6 +26,7 @@ using System.Threading;
|
||||||
using Greenshot.IniFile;
|
using Greenshot.IniFile;
|
||||||
using Greenshot.Plugin;
|
using Greenshot.Plugin;
|
||||||
using GreenshotPlugin.Core;
|
using GreenshotPlugin.Core;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace ExternalCommand {
|
namespace ExternalCommand {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -105,6 +106,18 @@ namespace ExternalCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int CallExternalCommand(string commando, string fullPath, out string output) {
|
private int CallExternalCommand(string commando, string fullPath, out string output) {
|
||||||
|
try {
|
||||||
|
return CallExternalCommand(commando, fullPath, null, out output);
|
||||||
|
} catch (Win32Exception ex) {
|
||||||
|
try {
|
||||||
|
return CallExternalCommand(commando, fullPath, "runas", out output);
|
||||||
|
} catch {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int CallExternalCommand(string commando, string fullPath, string verb, out string output) {
|
||||||
string commandline = config.commandlines[commando];
|
string commandline = config.commandlines[commando];
|
||||||
string arguments = config.arguments[commando];
|
string arguments = config.arguments[commando];
|
||||||
output = null;
|
output = null;
|
||||||
|
@ -114,6 +127,9 @@ namespace ExternalCommand {
|
||||||
p.StartInfo.Arguments = String.Format(arguments, fullPath);
|
p.StartInfo.Arguments = String.Format(arguments, fullPath);
|
||||||
p.StartInfo.UseShellExecute = false;
|
p.StartInfo.UseShellExecute = false;
|
||||||
p.StartInfo.RedirectStandardOutput = true;
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
|
if (verb != null) {
|
||||||
|
p.StartInfo.Verb = verb;
|
||||||
|
}
|
||||||
LOG.Info("Starting : " + p.StartInfo.FileName + " " + p.StartInfo.Arguments);
|
LOG.Info("Starting : " + p.StartInfo.FileName + " " + p.StartInfo.Arguments);
|
||||||
p.Start();
|
p.Start();
|
||||||
p.WaitForExit();
|
p.WaitForExit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue