如何根据目标机器(32 位或 64 位)有条件地安装带有 WiX 的文件? [英] How do I conditionally install a file with WiX based on the target machine (32bit or 64bit)?

查看:25
本文介绍了如何根据目标机器(32 位或 64 位)有条件地安装带有 WiX 的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件,有 32 位版本和 64 位版本.如果我在 32 位机器上安装我的应用程序,我希望安装 32 位版本的文件.同样,如果安装在 64 位机器上运行,则应安装 64 位版本.如何检查安装程序在哪种类型的机器上运行 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?

请不要单行回答.我正在寻找特定的 WiX 标签以及将它们放在我的 WiX 脚本中的什么位置.

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

推荐答案

你可以可能使用条件来做两个独立的组件

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

 VersionNT64

 Not VersionNT64

但正确的方法是为 32 位和 64 位操作系统编译单独的安装程序,64 位组件也应该被标记为这样(使用 Win64="yes") - 我不知道如果甚至可以将 Windows 安装程序包标记为针对 Intel 和 x64.我唯一一次使用 NSIS 完成了混合架构安装,我所有的 WiX 安装程序都有针对每个架构的单独安装程序.

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.

这篇关于如何根据目标机器(32 位或 64 位)有条件地安装带有 WiX 的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆