Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the UAC 'Publisher' Field for a NSIS Installer

Tags:

uac

nsis

When I open my installer(that I created using NSIS), the UAC dialog appears with information about my installer. The field Publisher is 'unknown'. I've heard of digitally signing the application, do you know how to do this in NSIS?

How can I set the field/attribute Publisher to "My Installer" or some other text?

I think the following code is supposed to set the Publisher field but it doesn't, it still remains 'unknown':

InstallDir  "abc"
Name        "def"        
OutFile     "def.exe"

VIProductVersion                 "1.0.0.0"
VIAddVersionKey ProductName      "def"
VIAddVersionKey Comments         "MY DESCRIPTION"
VIAddVersionKey CompanyName      "My Installer"
VIAddVersionKey LegalCopyright   "MY COMPANYNAME"
VIAddVersionKey FileDescription  "MY DESCRIPTION"
VIAddVersionKey FileVersion      1
VIAddVersionKey ProductVersion   1
VIAddVersionKey InternalName     "def"
VIAddVersionKey LegalTrademarks  "PTY LTD"
VIAddVersionKey OriginalFilename "def.exe"

Section
    DetailPrint "Hello World"
SectionEnd
like image 776
sazr Avatar asked May 14 '12 10:05

sazr


1 Answers

You would have to Authenticode sign the installer with a certificate authority trusted by Windows (If you want to be part of Winqual then you need a special certificate and MS only allows you to use VeriSign) because that field is extracted from the digital certificate (if one exists) and not from the PE version information.

To sign as part of the build process you can use this hack, or if you are using NSIS v3 then you can use the !finalize command.

like image 184
Anders Avatar answered Dec 16 '22 12:12

Anders