mirror of
https://github.com/greenshot/greenshot
synced 2025-07-15 17:43: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.Plugin;
|
||||
using GreenshotPlugin.Core;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ExternalCommand {
|
||||
/// <summary>
|
||||
|
@ -103,8 +104,20 @@ namespace ExternalCommand {
|
|||
ProcessExport(exportInformation, surface);
|
||||
return exportInformation;
|
||||
}
|
||||
|
||||
|
||||
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 arguments = config.arguments[commando];
|
||||
output = null;
|
||||
|
@ -114,6 +127,9 @@ namespace ExternalCommand {
|
|||
p.StartInfo.Arguments = String.Format(arguments, fullPath);
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
if (verb != null) {
|
||||
p.StartInfo.Verb = verb;
|
||||
}
|
||||
LOG.Info("Starting : " + p.StartInfo.FileName + " " + p.StartInfo.Arguments);
|
||||
p.Start();
|
||||
p.WaitForExit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue