I have (copied from the debugger after they were set, to make sure that’s what is actually passed to the command):
process.StartInfo.FileName = "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bin\\signtool.exe"
process.StartInfo.Arguments = " sign /f \"C:\\Users\\...\\myPfx.pfx\" /p \"myPassword\" \"C:\\Users\\...\\Desktop\\app.exe\""
but when I Start() it it doesn’t sign the app. (When I copy signtool to that folder and do it manually – it works.)
So, for debugging, I tried:
System.Diagnostics.Process.Start(@"cmd.exe", @" /k " + "\"" + process.StartInfo.FileName + "\"" + " " + "\"" + process.StartInfo.Arguments + "\"");
But I get:
‘C:\Program’ is not recognized as an internal or external command,
operable program or batch file.
So how do I get the signing to work (or at least the cmd, so I’ll be able to see what exactly is the problem)?
EDIT: Thanks everyone. The problem was as answered below – missing quotes. And though I did actually try that before posting the question (-adding quotes to everything) – it didn’t work then. It turns out I was adding some white space between the quotes and the actual parameters. So it seems that that causes an error.
Your filename needs to be quoted
EDIT
Try using this instead, which works for me with dummy files