Inno Setup可以对新安装和更新做出不同反应吗? [英] Can Inno Setup respond differently to a new install and an update?

查看:138
本文介绍了Inno Setup可以对新安装和更新做出不同反应吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的InnoSetup脚本在安装过程结束时打开一个网页(使用用户的默认浏览器):

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

但是,如果应用程序已经存在,即用户正在安装新版本的程序,我希望不打开网页.初始安装后,应该仅打开网页. (显然,我认为值得一提的是,该安装包括一个AppID,并在安装文件的旁边在注册表中输入值.)

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.)

一如既往地感谢您-Al C.

Thank you, as always -- Al C.

推荐答案

是的,使用脚本很容易做到这一点.

Yes, this is easy to do with scripting.

只要写

[Run]
Filename: "http://example.com"; Flags: shellexec; Check: NotAnUpdate

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpInstalling then
    IsUpdate := FileExists(ExpandConstant('{app}\TheFileNameOfMyApp.exe'));
end;

function NotAnUpdate: Boolean;
begin
  result := not IsUpdate;
end;

这篇关于Inno Setup可以对新安装和更新做出不同反应吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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