Better path handeling

Thanks @orzFly
This commit is contained in:
Coenraad Stijne 2014-07-19 18:14:31 +02:00
parent 60df499584
commit a72d1a13b6

View File

@ -101,7 +101,20 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
else if (currentKey.OpenSubKey("Shell\\Open\\Command") != null && currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null) != null)
{
//Other files (usually third party items)
executablePath.FileName = Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString());
string value = Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString());
if (value[0] == '"')
{
for (int x = 1; x < value.Length && value[x] != '"'; x++)
{
executablePath.FileName += value[x];
}
executablePath.Arguments = value.Remove(0, executablePath.FileName.Length + 2).Trim();
}
else
{
executablePath.FileName = value;
}
}
else
{