Look for signtool.exe in absolute paths

This commit is contained in:
DamianEdwards 2014-05-22 18:33:14 -07:00
parent 6d5e709b85
commit 464bf577bc
1 changed files with 10 additions and 3 deletions

View File

@ -5,7 +5,16 @@ default workingdir='${Directory.GetCurrentDirectory()}'
default expectedHash = ''
@{
var signToolExe = "signtool.exe";
Log.Info(string.Format("Verifying Authenticode signature of {0}", verifyFilePath));
var signToolExePaths = new [] { "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe", "C:\Program Files\Windows Kits\8.1\bin\x86\signtool.exe" };
var signToolExe = signToolExePaths.FirstOrDefault(File.Exists);
if (string.IsNullOrEmpty(signToolExe))
{
throw new Exception("Could not find signtool.exe on this machine. Ensure Visual Studio is installed.");
}
var processStartInfo = new ProcessStartInfo {
UseShellExecute = false,
WorkingDirectory = workingdir,
@ -14,8 +23,6 @@ default expectedHash = ''
Arguments = "verify /pa /v " + verifyFilePath,
};
Log.Info(string.Format("Verifying Authenticode signature of {0}", verifyFilePath));
var signTool = Process.Start(processStartInfo);
var stdout = signTool.StandardOutput.ReadToEnd();
signTool.WaitForExit();