安装程序根据 CPU 架构(x86 32 位、x64 64 位等)选择 MSI

发布于 2024-09-30 20:49:25 字数 882 浏览 0 评论 0原文

我有一个安装程序(Visual Studio 安装项目),它 使用 DIFxApp 和 Orca转换为安装驱动程序。问题是有两个 DIFxApp 合并模块 - 一个用于 x86,一个用于 x64。如果我同时引用它们,则安装仅适用于 64 位计算机,而仅引用 x86 版本则允许我在 32 位计算机上安装。

似乎唯一的解决方案是创建两个 MSI(一个用于 x86,一个用于 x64),每个都引用正确的合并模块。我的问题是我应该如何创建一个安装程序来根据目标计算机的处理器选择要安装的 MSI?

我曾经使用过一点 NSIS ,所以走这条路可能是最简单的。 其他可能性是 Inno-SetupdotNetInstaller

类似的问题(但答案不充分):

I have an installer (Visual Studio setup project) which uses DIFxApp and an Orca transform to install drivers. The problem is that there are two DIFxApp merge modules - one for x86 and one for x64. If I reference both of them, the installation only works on 64-bit machines, whereas referencing only the x86 version allows me to install on 32-bit machines.

It seems as though the only solution is to create two MSIs (one for x86 and one for x64), each referencing the correct merge module. My question is how should I create an installer that chooses which MSI to install based off of the target machine's processor?

I've worked with NSIS a little bit, so it might be easiest to go that route.
Other possibilities are Inno-Setup and dotNetInstaller.

Similar questions (but with inadequate answers):

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

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

发布评论

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

评论(3

好菇凉咱不稀罕他 2024-10-07 20:49:25

如果您决定使用 NSIS:

!include "x64.nsh"
${If} ${RunningX64}
   MessageBox MB_OK "running on x64"
${Else}
   MessageBox MB_OK "running on x86"
${EndIf}

If you decide to go with NSIS:

!include "x64.nsh"
${If} ${RunningX64}
   MessageBox MB_OK "running on x64"
${Else}
   MessageBox MB_OK "running on x86"
${EndIf}
半岛未凉 2024-10-07 20:49:25

您可以使用自定义操作来检测操作系统,然后调用正确的安装程序。

我在这里给出了一个例子: 单个 MSI 安装正确的 32 或 64 位 C 应用程序

You can use a custom action to detect the OS, then call the right installer.

I've given an example here: single-msi-to-install-correct-32-or-64-bit-c-application

不知在何时 2024-10-07 20:49:25

制作一个检测操作系统类型的小程序(启动器)怎么样(64 0r 32 位,应该很容易)。然后,该小程序根据检测结果启动正确的安装程序。该程序不应有任何窗口,并且具有与安装程序相同的图标。只需向客户提供所有三个文件:installer.exe(程序)、inst32.msi 和 inst64.msi。如果这对您的客户来说太多了,那么只需将它们压缩到自动启动 installer.exe 的自解压 zip 中即可。

How about making a small program (launcher) that detect the os type (64 0r 32 bit, should be easy). The little program then launch the correct installer depending on detection result. The program shouldn't has any window and has the same icon as the installer. Just give the customer all three files, installer.exe (the program), inst32.msi and inst64.msi. If that's too much for your customer then just compress them to a self extracting zip that launch the installer.exe automatically.

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