在 Inno Setup 安装中运行另一个安装程序

发布于 2024-07-25 19:14:28 字数 512 浏览 7 评论 0原文

我的公司正在开发一个应用程序,该应用程序依赖于我们的另一个应用程序。 第二个应用程序已经有一个 Inno Setup 安装程序。

所以我想我想将第二个应用程序的安装程序捆绑在第一个应用程序的 Inno Setup 安装程序中。 但我不知道如何正确地处理这个问题。 有谁知道这样做的“正确方法”?

我发现了这个:Inno 安装知识库 — HOWTO:安装 .MSI 文件。 我认为该技术可用于嵌套的 Inno Setup 安装程序。 但我对细节有几个问题:

  1. 如果第一个应用程序被卸载,第二个应用程序也被卸载,我怎样才能做到这一点?
  2. 这是明智的做法(自动卸载​​第二个应用程序),还是应该让用户手动执行此操作?
  3. 如果用户在卸载第一个应用程序时尝试卸载第二个应用程序,我是否应该以某种方式检测到并发出警告? 我怎么能这么做呢?

My company is developing an application that has a dependency on another of our applications. That second application already has an Inno Setup installer.

So I think I'd like to bundle the second application's installer within the Inno Setup installer for the first application. But I'm not sure how to go about that properly. Does anyone know the "right way" to do this?

I found this: Inno Setup Knowledge Base—HOWTO: Install .MSI files. I assume the technique could be used for a nested Inno Setup installer. But I have a couple of questions about the fine details:

  1. How could I make it so if the first application is uninstalled, the second is also uninstalled?
  2. Is that a sensible thing to do (automatically uninstall the second application), or should I leave it to the user to do that manually?
  3. If the user tries to uninstall the second application while the first is uninstalled, should I somehow detect that and give a warning? How could I do that?

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

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

发布评论

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

评论(1

茶底世界 2024-08-01 19:14:28

对于您正在谈论的卸载程序功能级别,我建议您熟悉 Inno Setup 中的 pascal 脚本(如果您还不熟悉)。 它提供了令人难以置信的定制功能,但需要注意的是,它会让您的项目变得更加复杂。

首先回答你的第三个问题:

是的,你应该这样做。 为了正确执行此操作,您需要将此功能添加到第二个应用程序(即您的应用程序所依赖的应用程序)的卸载程序中。 请参阅 Inno Setup 帮助中的卸载事件函数。 如果您的应用程序已安装,您需要检查该卸载程序(例如,通过检查 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName 是否存在),并在这种情况下显示附加警告。

至于你的第二个问题:

如果你的客户很可能想继续使用第二个应用程序,即使他决定卸载第一个应用程序,你也应该为他提供选择。 卸载应用程序后,我会在应用程序的卸载程序中使用单独的向导页面来执行此操作。

最后,您的第一个问题:

您需要确定另一个应用程序的卸载程序 exe 的名称(完整路径)。 您可以从注册表项 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName\UninstallString 检索它。 要从 [CODE] 部分中的脚本执行它,请参阅 Inno Setup 帮助中的 Exec

For the level of uninstaller functionality you are talking about, I suggest you get familiar with pascal scripting in Inno Setup (if you are not already). It offers incredible customisation, but has the caveat of making your projects a lot more complex.

To answer your third question first:

Yes, you should do this. In order to do it properly, you need to add this functionality to the uninstaller of the second application (i.e. the one your app is dependent on). See Uninstall event functions in the Inno Setup help. You need to check in that uninstaller if your app is installed (by checking if HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName exists, for example) and in that case show an additional warning.

As for your second question:

If it is remotely possible that your customer wants to continue using the second app, even if he decides that he wants to uninstall the first one, you should offer him the choice. I would do this with a seperate wizard page in the uninstaller for your app, after your app is uninstalled.

And finally, your first question:

You need to determine the name (full path) of the other app's uninstaller exe. You can retrieve it from the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName\UninstallString. For executing it from a script in the [CODE] section, see Exec in the Inno Setup help.

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