Inno setup-如果未安装其他程序,请跳过安装 [英] Inno setup - skip installation if other program is not installed
问题描述
如果未安装其他程序,我必须找到如何跳过安装的方法.我可以检测到其他程序的注册表(基本脚本返回true/false),这不是问题.但是我不知道如何跳过安装.
I have to find way how to skip installation if other program is not installed. I can detect registry of other program (basic script returns true/false), it is not problem. But I don't know how to skip installation.
简而言之:如果未设置注册表中的一个键,则打印消息在此之前安装instal程序xyz"并完成安装程序.
In short: if one key in registry is not set, print message 'instal program xyz before this one' and finish installator.
推荐答案
这非常容易.只需添加
[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
是所谓的事件函数,它在安装程序启动时执行(甚至在显示向导GUI之前).如果返回false
,安装程序将立即退出.
to your ISS file. InitializeSetup
is a so-called event function that is executed when the installer starts (even before the wizard GUI is shown). If you return false
, the installer will exit immediately.
这篇关于Inno setup-如果未安装其他程序,请跳过安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!