70

I'm building an MSI installer for windows and sign the installer using signtool. When I run the .msi to test it, the UAC (User Account Control) prompt shows up to ask me if I want to allow the installation to proceed. That's fine, but the prompt shows a number of fields, and for the Program Name field it displays something like "403b3.msi". This is not the name of the msi I'm running.

How can I get the correct Program Name to be displayed?

asked Nov 30, 2010 at 16:11

2 Answers 2

86

Use the /d command line argument with the required program name when executing signtool to sign the msi.

It appears that the windows installer creates a temporary copy of the msi file and assigns it a generated name before running it. If you don't use /d with signtool, you get to see the temporary filename which isn't very useful for your users.

answered Nov 30, 2010 at 16:12
Sign up to request clarification or add additional context in comments.

1 Comment

When adding /d, you need a description also. IE: /d "My Application!"
5

this is an applied version of @Scott-langham's comment.

this was directly from the PostBuildEvent of a visual studio installer project - VDPROJ file

set signtool="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\signtool.exe"
set timestampurl=http://timestamp.digicert.com
set certpath="$(ProjectDir)CodeSigningCert.pfx"
:: Setup in your user environment variables
:: using something with low sort order to force off screen ZZCODECERTPASSWORD
if []==[%ZZCODECERTPASSWORD%] (
echo must set code signing certificate in ZZCODECERTPASSWORD environment variable. stopping build.
exit /b 2
)
:: need the filename with extension that is being generated
FOR /f %%i IN ("$(BuiltOuputPath)") DO (
SET outputfilename=%%~nxi
)
%signtool% sign /t %timestampurl% /f %certpath% /p %CODECERTPW% /d %outputfilename% "$(BuiltOuputPath)"
IF ERRORLEVEL 1 (
echo failed to sign MSI
exit /b 3
)
%signtool% sign /t %timestampurl% /f %certpath% /p %CODECERTPW% "$(ProjectDir)$(Configuration)\Setup.exe"
IF ERRORLEVEL 1 (
echo failed to sign boostrap setup EXE
exit /b 4
)
answered Mar 12, 2015 at 16:39

3 Comments

Sorry for the poorly-formatted comment. Can't figure out how to get line-breaks to work... I used this with success, except there is a change required if your path has one or more spaces in it. Use this at the top to get into a local variable: set outputdir=$(BuiltOuputPath). Then use the new variable like this: FOR %%i IN ("%outputdir%") DO ( SET outputfilename=%%~nxi ) and later in the script: %signtool% sign /a /t %timestampurl% /d "%outputfilename%" "%outputdir%" IF ERRORLEVEL 1 ( echo failed to sign MSI exit /b 3 )
@GaryWillette I am glad this helped you. >if your path has one or more spaces< path to what, exactly?
$(BuiltOutputPath)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.