【发布时间】:2011-05-06 08:16:14
【问题描述】:
如果没有安装其他程序,我必须想办法跳过安装。我可以检测到其他程序的注册表(基本脚本返回真/假),没问题。但我不知道如何跳过安装。
简而言之:如果注册表中的某个键未设置,则打印消息'instal program xyz before this one'并完成安装程序。
【问题讨论】:
如果没有安装其他程序,我必须想办法跳过安装。我可以检测到其他程序的注册表(基本脚本返回真/假),没问题。但我不知道如何跳过安装。
简而言之:如果注册表中的某个键未设置,则打印消息'instal program xyz before this one'并完成安装程序。
【问题讨论】:
这很容易。只需添加
[Code]
function IsApp2Installed: boolean;
begin
result := RegKeyExists(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\app2.exe');
end;
function InitializeSetup: boolean;
begin
result := IsApp2Installed;
if not result then
MsgBox('You need to install App2 before you install ThisApp. Install App2 and then run this installer again.', mbError, MB_OK);
end;
到您的 ISS 文件。 InitializeSetup 是所谓的event function,它在安装程序启动时执行(甚至在显示向导 GUI 之前)。如果您返回false,安装程序将立即退出。
【讨论】: