Inno设置-如果未安装其他程序,则跳过安装

问题描述 投票:2回答:1

如果未安装其他程序,我必须找到如何跳过安装的方法。我可以检测到其他程序的注册表(基本脚本返回true / false),这不是问题。但是我不知道如何跳过安装。

简而言之:如果未设置注册表中的一个键,则在该键之前打印消息“安装程序xyz”并完成安装程序。

installation inno-setup skip
1个回答
9
投票

这很容易。只需添加

[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,安装程序将立即退出。


0
投票

我可以用这个路径得到一个程序的示例吗?SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ App Paths \ app2.exe

© www.soinside.com 2019 - 2024. All rights reserved.