ssg: StaticSiteClient: run commands with 64bit cmd on 32-on-64 environments

This commit is contained in:
Nick Vella 2019-07-03 14:20:33 +10:00
parent 7c061ba390
commit b32b6ef47a
1 changed files with 6 additions and 1 deletions

View File

@ -240,7 +240,12 @@ namespace OpenLiveWriter.BlogClient.Clients
private Process RunSiteCommand(string localCommand)
{
var proc = new Process();
proc.StartInfo.FileName = "cmd.exe";
// If a 32-bit process on a 64-bit system, call the 64-bit cmd
proc.StartInfo.FileName = (!Environment.Is64BitProcess && Environment.Is64BitOperatingSystem) ?
$"{Environment.GetEnvironmentVariable("windir")}\\Sysnative\\cmd.exe" : // 32-on-64, launch sysnative cmd
"cmd.exe"; // Launch regular cmd
// Set working directory to local site path
proc.StartInfo.WorkingDirectory = LocalSitePath;