更改NSIS安装程序属性

21

我有一个基于NSIS的安装程序文件,名称为setup.exe。当我进入“属性”->“详细信息”时,很多细节丢失了。当我运行安装程序时,用户账户控制(UAC)请求提升权限(这是可以接受的),但发布者显示为“未知”。

如何设置最终的setup.exe中的这些属性,最好只通过更改NSIS安装程序脚本本身来完成?

1个回答

阿里云服务器只需要99元/年,新老用户同享,点击查看详情
39

关于属性,您需要查看版本信息表:包含各种VIAddVersionKey指令和VIProductVersion。以下是PortableApps.com Launcher的代码片段作为示例:

Name "${NamePortable} (PortableApps.com Launcher)"
OutFile "${PACKAGE}\${AppID}.exe"
Icon "${PACKAGE}\App\AppInfo\appicon.ico"
Caption "${NamePortable} (PortableApps.com Launcher)"
VIProductVersion ${Version}
VIAddVersionKey ProductName "${NamePortable}"
VIAddVersionKey Comments "A build of the PortableApps.com Launcher for ${NamePortable}, allowing it to be run from a removable drive.  For additional details, visit PortableApps.com"
VIAddVersionKey CompanyName PortableApps.com
VIAddVersionKey LegalCopyright PortableApps.com
VIAddVersionKey FileDescription "${NamePortable} (PortableApps.com Launcher)"
VIAddVersionKey FileVersion ${Version}
VIAddVersionKey ProductVersion ${Version}
VIAddVersionKey InternalName "PortableApps.com Launcher"
VIAddVersionKey LegalTrademarks "PortableApps.com is a Trademark of Rare Ideas, LLC."
VIAddVersionKey OriginalFilename "${AppID}.exe"

至于UAC提示中的发布者字段,那是不同的。那与签名有关。你首先需要一个数字证书,这需要花钱购买,然后你才能将其与!finalize集成。


1
!finalize 仅适用于 SVN 构建,您必须等待 2.47 版本才能使用该命令。但是 NSIS 论坛上有一些关于使用 !system 进行签名的其他帖子。 - Anders
@Anders:啊,我刚刚搜索了“nsis sign”(知道可以做到,我们的主管签署我们的东西),发现很多有关签名卸载程序的信息,但关于签名安装程序的内容不是很多。 (维基页面关于签名程序卸载程序,但没有关于签名安装程序的内容?这应该得到纠正。)我没有认出!finalise,但认为它可能是在2.46中引入的,而我忘记了它。考虑到我已经为它编写了Vim语法文件并浏览了命令,我想我只是没有真正考虑过它。 - Chris Morgan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,