Command Line Build - Passing Authenticode Password

Got a problem you cannot solve? Try here.
Post Reply
MobileMark II
Posts: 19
Joined: Thu Nov 03, 2005 11:58 am
Contact:

Command Line Build - Passing Authenticode Password

Post by MobileMark II »

Is there a way to pass the digital certificate signing password to the command line build process so that I am not prompted if I kick-off an automated build?
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Not at this time - the password must be manually entered.
H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Post by H4nd0 »

You can get around this by using AutoIt3 to automate the filling in of the password prompt.

http://www.autoitscript.com/autoit3/

From you batch file launch your project compile thus (obviously setup your environment variables correctly):

Code: Select all

AutoIt3 build.au3 ""%IW_HOME%\\miabuild" "%IW_PROJ_FILE%" /o="%IW_PROJ_OUT%" /b="%IW_PROJ_TYPE%" /r" "%IW_PASS%"
The AutoIt3 runs the script build.au3 (below). You pass the complete build command line + the cert password (as the second parameter).

The build.au3 script looks like this:

Code: Select all

Run($CmdLine[1])

WinWaitActive("Enter Private Key Password")
Send($CmdLine[2])
Send("{TAB}{ENTER}")

WinWaitActive("Enter Private Key Password")
Send($CmdLine[2])
Send("{TAB}{ENTER}")
For my build, the private key is requested twice.
neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK

Post by neillans »

There is also a Microsoft command line signing tool (aptly named signtool.exe!).

It does everything 100% at the command line; I run this immediatly after creating the installers in my automated build environment, as it gets around the annoying popup :)

Andy
H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Post by H4nd0 »

Since the EXE contains an MSI - you need to sign the MSI before including it in the EXE.

InstallAware does that for you. If you use SignTool you just sign the final EXE.

Most MS OS don't care about this level of signing ... except Vista.

... or so I am led to believe by IA support!
Post Reply