1

EDITED:

I have problems with InnoSetup and signtool. The following works perfectly from the Command Line (I reverted from PowerShell in my original post to CMD).

"c:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe" sign /f certificate.p12 /p password /t http://timestamp.verisign.com/scripts/timstamp.dll MyApp.exe

However, if I put the same line in InnoSetup IDE (adding $f at the end as requested by InnoSetup), it fails with "sign tool failed with exit code 0x1". I have already seen the following answer, however as on the command line it works fine, it doesn't help. Without the codetool line "SignTool=signtool", InnoSetup compiles correctly.

Kelly o'Brian
  • 415
  • 3
  • 12
  • *"My suspect is that on Windows 10 InnoSetup needs the same systax as in PowerShell."* - That's a very wrong assumption. - This is [XY problem](https://meta.stackexchange.com/q/66377/218578). – Martin Prikryl Dec 11 '18 at 15:22

1 Answers1

0

In PowerShell, use the & symbol (aka call operator or invocation operator) to execute a command name that contains quotes and whitespace.

& "c:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe" sign /f certificate.p12 /p password /t http://timestamp.verisign.com/scripts/timstamp.dll MyApp.exe

Why? Because PowerShell interprets a quoted string (first on the line) as a string, rather than a command. The & operator means "the string that follows is a command."

Read the PowerShell help topic about_Operators for more information.

Bill_Stewart
  • 22,916
  • 4
  • 51
  • 62
  • It did not work even with &, PowerShell complained & is a wrong syntax. Anyway, I turned to the normal Command Line. – Kelly o'Brian Dec 11 '18 at 16:30
  • The command I posted is for use at the PowerShell command line. If it doesn't work (and I would point out that [you did not say _how_ it didn't work](https://blogs.msdn.microsoft.com/oldnewthing/20100421-00/?p=14283/)), then you are not doing it correctly (I do this all the time and it works just fine). – Bill_Stewart Dec 11 '18 at 16:46