Small fixes that make it possible to run the not installed Greenshot from a network share.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1616 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-02-01 11:58:59 +00:00
commit fddeb05d67
4 changed files with 25 additions and 10 deletions

View file

@ -41,12 +41,21 @@ namespace ExternalCommand {
public Dictionary<string, string> arguments;
private const string MSPAINT = "MS Paint";
private static string paintPath = AbstractDestination.GetExePath("pbrush.exe");
private static bool hasPaint = !string.IsNullOrEmpty(paintPath) && File.Exists(paintPath);
private static string paintPath;
private static bool hasPaint = false;
private const string PAINTDOTNET = "Paint.NET";
private static string paintDotNetPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"Paint.NET\PaintDotNet.exe");
private static bool hasPaintDotNet = !string.IsNullOrEmpty(paintDotNetPath) && File.Exists(paintDotNetPath);
private static string paintDotNetPath;
private static bool hasPaintDotNet = false;
static ExternalCommandConfiguration() {
try {
paintPath = AbstractDestination.GetExePath("pbrush.exe");
hasPaint = !string.IsNullOrEmpty(paintPath) && File.Exists(paintPath);
paintDotNetPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), @"Paint.NET\PaintDotNet.exe");
hasPaintDotNet = !string.IsNullOrEmpty(paintDotNetPath) && File.Exists(paintDotNetPath);
} catch {
}
}
/// <summary>
/// Supply values we can't put as defaults