Old 4th November 2015, 21:30   #1
dam101
Junior Member
 
Join Date: Nov 2015
Posts: 3
Running signtool from script

I'm trying to follow the instructions for signing an uninstaller located here: Signing an Uninstaller

I've changed the line in the script that uses SIGNCODE to use signtool instead:

!system: ""signtool" "sign /v /f MySPC.pfx /n 'My Company' /d 'My Program Uninstaller' /du http://www.mycompany.com /t http://timestamp.verisign.com/scripts/timstamp.dll $%TEMP%\uninstaller.exe"

I receive an error here:

"SignTool Error: Invalid command: sign /v /f MySPC.pfx /n 'My Company' /d 'My Program Uninstaller' /du http://www.mycompany.com /t http://timestamp.verisign.com/scripts/timstamp.dll C:\Users\me\AppData\Local\Temp\uninstaller.exe

Has anyone done this successfully?
dam101 is offline   Reply With Quote
Old 4th November 2015, 23:15   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
It would help if you posted the line with !system and not just its output but my guess is that your quotes are wrong, the parameters are sign /v ... and not "sign /v ...". You should double-quote filenames like $%TEMP%\uninstaller.exe but not the entire thing...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th November 2015, 13:45   #3
dam101
Junior Member
 
Join Date: Nov 2015
Posts: 3
Um...I did post the line with !system. It's directly above the line with the output. As you can see, I put the entire I put the entire string in double quotes; the name of the tool, in this case signtool, also in double quotes; the command line to signtool also in double quotes; and the command line parameters that included spaces in single quotes. I did not, however, put the path to the uninstaller.exe in quotes as I thought they would not be necessary for a path with no spaces. I did attempt to use escaped double quotes around the elements with spaces ($\") but the spaces caused errors when I did that:

SignTool Error: Invalid command: sign /v /f MySPC.pfx /n "My

I am unable to try your suggestion of quoting the path right now because now makensis is crashing with error -1073741819 (whatever that means). Here's the context:

Inner invocation (My Program.nsi:93)
OutFile: "C:\Users\me\AppData\Local\Temp\tempinstaller.exe"
SetCompress: off
!system: returned -1073741819, aborting
Error in script "..\BuildInstall\My Program.nsi" on line 103 -- aborting creation process

Anyway, that should probably be another post if I can't find the answer elsewhere. Thanks for the attention.
dam101 is offline   Reply With Quote
Old 5th November 2015, 14:43   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Quote:
Originally Posted by dam101 View Post
Um...I did post the line with !system. It's directly above the line with the output.
No you did not, try searching this page for "!system ". The line with "!system:" does not compile even after removing the colon so I had to conclude that it came from compiler output and not your .nsi but I guess I could have been more clear about wanting the line from your .nsi and not just compiler output.

Anyway, all I can tell you is how to use !system:

The basic syntax is:
Quote:
!system '"c:\path\to\app.exe" param1 "pa ra m2" param3'
so basically !system takes a single string parameter and the outer set of quotes will be removed by the compiler like it does with all strings.

For you it should probably be:

Quote:
!system '"signtool" sign /v /f MySPC.pfx /n "My Company" /d "My Program Uninstaller" /du http://www.mycompany.com /t http://timestamp.verisign.com/scripts/timstamp.dll "$%TEMP%\uninstaller.exe"' = 0 ; Hoping signtool is in %path%

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th November 2015, 15:28   #5
dam101
Junior Member
 
Join Date: Nov 2015
Posts: 3
My apologies, you were correct. That was the compiler output, copied from the command window. Your suggestion worked! Not only was the signtool command run successfully but the crash that appeared has gone away. Thank you for your help. The rules for quoting when using the !system command are now much clearer.
dam101 is offline   Reply With Quote
Old 6th November 2015, 04:37   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Quote:
Originally Posted by dam101 View Post
Your suggestion worked! Not only was the signtool command run successfully but the crash that appeared has gone away.
It was probably not a crash. Certainly not a crash in our compiler, possibly a crash in signtool but it is most likely the exit code of the signtool process...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump