为 NSIS 安装程序设置 UAC“发布者"字段 [英] Setting the UAC 'Publisher' Field for a NSIS Installer

查看:123
本文介绍了为 NSIS 安装程序设置 UAC“发布者"字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开我的安装程序(我使用 NSIS 创建的)时,会出现 UAC 对话框,其中包含有关我的安装程序的信息.字段 Publisher 是未知".我听说过对应用程序进行数字签名,您知道如何在 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?

我认为下面的代码应该设置 Publisher 字段,但它没有,它仍然是未知":

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

推荐答案

您必须验证码 sign 具有 Windows 信任的证书颁发机构的安装程序(如果您想成为 Winqual 那么你需要一个特殊的证书,而 MS 只允许你使用 VeriSign)因为该字段是从数字证书(如果存在)中提取的,而不是从 PE 版本信息中提取的.

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.

要签名作为构建过程的一部分,您可以使用此 hack,或者如果您正在使用NSIS v3 然后你可以使用 !finalize 命令.

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.

这篇关于为 NSIS 安装程序设置 UAC“发布者"字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆