Inno-Setup 询问一次安装两次

发布于 2024-09-13 21:33:53 字数 524 浏览 2 评论 0原文

使用 InnoSetup 我想提示用户是否希望安装附加软件 - 将其视为插件。我的问题是我想要安装的附加软件包被分成两个 MSI 文件。我只想提示用户一次安装软件包,但让 [Run] 部分中的每个文件检查相同的值。我该怎么做呢?

[Code]
function InstallSomething:Boolean;
begin
   if (MsgBox('Do you want to install something?', mbInformation, mb_YesNo) = idYes) then
      Result:=True
   else
      Result:=False;
end;

[Run]
Filename: {sd}\Software\MyAppA.msi; Check: InstallSomething;
Filename: {sd}\Software\MyAppB.msi; Check: InstallSomething;

因此,用户应该只收到一次消息,但每个文件如果为 true 则应安装,如果为 false 则跳过。

Using InnoSetup I want to prompt a user if they wish to install an additional piece of software - think of it as a plug-in. My issue is that the additional software package I wish to install is broken up into two MSI files. I want to only prompt the user once to install the package but have each file in the [Run] section check the same value. How do I go about doing this?

[Code]
function InstallSomething:Boolean;
begin
   if (MsgBox('Do you want to install something?', mbInformation, mb_YesNo) = idYes) then
      Result:=True
   else
      Result:=False;
end;

[Run]
Filename: {sd}\Software\MyAppA.msi; Check: InstallSomething;
Filename: {sd}\Software\MyAppB.msi; Check: InstallSomething;

So the user should only get the message once but each file should install if true or skip if false.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2024-09-20 21:33:53

您不能将函数调用的结果存储在布尔变量中并在 [Run] 部分中使用该布尔值吗?

阅读以下文档后似乎这是可能的: http://www. jrsoftware.org/ishelp/index.php?topic=scriptcheck

Can you not store the result of your function call in a boolean variable and use that boolean value in your [Run] section?

It seems that this is possible after reading the following documentation: http://www.jrsoftware.org/ishelp/index.php?topic=scriptcheck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文