Just want to report that while the "Signing" sample was of great help, the code didn't work with "signtool not found error.
In the end I implemented that method (which inject the path to signtool)
In the end I implemented that method (which inject the path to signtool)
Perhaps you could update the Tasks.DigitalySign() method?
static void SignMSI(string msi)
{
var path = Environment.GetEnvironmentVariable("PATH");
var cmdpath = @"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin";
if (!path.Contains(cmdpath))
{
Environment.SetEnvironmentVariable("PATH", cmdpath + ";" + path);
}
int exitCode = Tasks.DigitalySign(msi,
@"path.to.pfx",
"http://timestamp.verisign.com/scripts/timstamp.dll",
"password");
if (exitCode != 0)
Console.WriteLine("Could not sign the MSI file.");
else
Console.WriteLine("the MSI file was signed successfully.");
}