如何根据目标计算机(32 位或 64 位)有条件地使用 WiX 安装文件?

发布于 2024-07-17 04:47:17 字数 195 浏览 5 评论 0原文

我有一个包含 32 位版本和 64 位版本的文件。 如果我在 32 位计算机上安装应用程序,我希望安装该文件的 32 位版本。 同样,如果安装在 64 位计算机上运行,​​则应安装 64 位版本。 如何检查使用 WiX 运行安装程序的机器类型?

拜托,没有一行答案。 我正在寻找特定的 WiX 标签以及将它们放在我的 WiX 脚本中的位置。

I have a file that has a 32bit version and a 64bit version. If I install my application on a 32bit machine, I want the 32bit version of the file to be installed. Likewise, the 64bit version should get installed if the installation is run on a 64bit machine. How do I check which type of machine the installer is being run on with WiX?

Please, no one-line answers. I'm looking for specific WiX tags and where to put them in my WiX script.

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

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

发布评论

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

评论(3

口干舌燥 2024-07-24 04:47:17

您可能可能只使用条件

 VersionNT64

 Not VersionNT64

来执行两个单独的组件,但正确的方法是为 32 位和 64 位操作系统编译单独的安装程序,并且 64 位组件也应该如此标记(使用 Win64="yes") - 我不知道是否可以将 Windows Installer 包标记为同时针对 Intel 和 x64。 我唯一一次使用 NSIS 进行混合架构安装,我的所有 WiX 安装程序对于每个架构都有单独的安装程序。

You could probably just do two separate components, using the conditions

 VersionNT64

and

 Not VersionNT64

But the correct way is to compile separate installers for 32 and 64 bit OS's and 64-bit components should also be marked as such (with Win64="yes") - I don't know if it's even possible to mark a Windows Installer package as targeted towards both Intel and x64. Only time I've ever done a mixed architecture installation is with NSIS, all my WiX installers have separate installers for each architecture.

分分钟 2024-07-24 04:47:17

正确的方法是编译两种设置,一种用于 32 (x86),一种用于 64 (amd64)。 然后,将这两个 msi 打包到一个 msi 中,并在运行时运行相应的 msi。

The proper way of doing so is to compile two setups, one for 32 (x86) and one for 64 (amd64). Then you package those two msi inside a single msi and run the appropriate one at runtime.

面犯桃花 2024-07-24 04:47:17

您可以使用环境或预处理器变量创建一个基本 wxs 文件,并在编译之前填写所需的属性。 另一种选择是在构建之前运行一个脚本,该脚本在文件中包含用于特定安装的不同 GUID。
简而言之,我认为没有一种简单的方法可以为不同的体系结构构建安装程序,因此您必须使用其他实用程序。

You could create a base wxs file using environment or preprocessor variables and fill in the required attributes before compiling. Another option would be running a script before the build that includes different GUIDs in the file for specific installation.
In short, I don't think there is a simple way of building installers for different architectures, so you have to use additional utilities.

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