Inno Setup 对新安装和更新的响应是否不同?
我的 InnoSetup 脚本在安装过程结束时打开一个网页(使用用户的默认浏览器):
[Run]
Filename: http://example.com; Flags: shellexec
但是,如果应用程序已存在,我希望不打开该网页,即,如果用户正在安装该程序的新版本。该网页应该仅在初始安装后打开。 (我认为值得一提的是,安装显然包括一个 AppID,并在安装文件旁边的注册表中输入值。)
一如既往地谢谢您 - Al C.
My InnoSetup script opens a web page (with the user's default browser) at the end of the install process:
[Run]
Filename: http://example.com; Flags: shellexec
However, I'd like the web page to not be opened if the app already exists, i.e., if the user is installing a new version of the program. The web page should only be opened after the initial install. (I assume it's worth mentioning that the install includes an AppID, obviously, and enters values in the registry beside installing files.)
Thank you, as always -- Al C.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这很容易通过脚本来完成。
只要写
Yes, this is easy to do with scripting.
Just write
如果用户选择将可执行文件安装到其他位置,@AndreasRejbrand 的答案将不起作用
您可以查询特定于安装程序的 Inno Setup 注册表项:
有关如何在
[Code]
部分中使用IsUpgrade
的示例,请参阅如果在 Inno Setup 中更新安装,则排除 ssPostInstall 步骤中的部分代码部分
如果您的“AppId”包含 left-,请选中此项大括号:
当 AppId 包含大括号时,检查安装是否是全新安装或升级不起作用
The answer by @AndreasRejbrand won't work, if user chooses to install the executable to a different location than the last time.
You can query installer-specific Inno Setup registry keys:
For an example how to use
IsUpgrade
in[Code]
section, seeExcludes part of Code section in ssPostInstall step if installation is update in Inno Setup
Check this if your "AppId" contains a left-curly-bracket:
Checking if installation is fresh or upgrade does not work when AppId contains a curly bracket