diff --git a/src/Squirrel/Utility.cs b/src/Squirrel/Utility.cs index a0ea19cb2..2b693ff9a 100644 --- a/src/Squirrel/Utility.cs +++ b/src/Squirrel/Utility.cs @@ -177,7 +177,7 @@ public static T Retry(this Func block, int retries = 2) } } - public static Task> InvokeProcessAsync(string fileName, string arguments, CancellationToken ct) + public static Task> InvokeProcessAsync(string fileName, string arguments, CancellationToken ct, string workingDirectory = null) { var psi = new ProcessStartInfo(fileName, arguments); if (Environment.OSVersion.Platform != PlatformID.Win32NT && fileName.EndsWith (".exe", StringComparison.OrdinalIgnoreCase)) { @@ -190,6 +190,7 @@ public static Task> InvokeProcessAsync(string fileName, strin psi.CreateNoWindow = true; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; + psi.WorkingDirectory = workingDirectory; return InvokeProcessAsync(psi, ct); } diff --git a/src/Update/Program.cs b/src/Update/Program.cs index 4d57dc94d..d6adde95e 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -663,7 +663,7 @@ static async Task createMsiPackage(string setupExe, IPackage package) var candleParams = String.Format("-nologo -ext WixNetFxExtension -out \"{0}\" \"{1}\"", wxsTarget.Replace(".wxs", ".wixobj"), wxsTarget); var processResult = await Utility.InvokeProcessAsync( - Path.Combine(pathToWix, "candle.exe"), candleParams, CancellationToken.None); + Path.Combine(pathToWix, "candle.exe"), candleParams, CancellationToken.None, setupExeDir); if (processResult.Item1 != 0) { var msg = String.Format( @@ -675,7 +675,7 @@ static async Task createMsiPackage(string setupExe, IPackage package) var lightParams = String.Format("-ext WixNetFxExtension -sval -out \"{0}\" \"{1}\"", wxsTarget.Replace(".wxs", ".msi"), wxsTarget.Replace(".wxs", ".wixobj")); processResult = await Utility.InvokeProcessAsync( - Path.Combine(pathToWix, "light.exe"), lightParams, CancellationToken.None); + Path.Combine(pathToWix, "light.exe"), lightParams, CancellationToken.None, setupExeDir); if (processResult.Item1 != 0) { var msg = String.Format(