WIX 分别创建32位64位安装程序
来源:互联网 发布:网络外包服务流程 编辑:程序博客网 时间:2024/06/06 08:46
Rather than conditionally including the opening Directory
elements (which invalidates the XML), conditionally set preprocessor variables which are used as directory names, as @Daniel Pratt's comment refers to. Similarly, having a "yes/no" variable conditioned on platform makes it easy to set up 64 bit components, registry searches, etc.
Defining the variables
(From this answer)
<?if $(var.Platform) = x64 ?> <?define ProductName = "Product Name (64 bit)" ?> <?define Win64 = "yes" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?><?else ?> <?define ProductName = "Product Name" ?> <?define Win64 = "no" ?> <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?><?endif ?>
$(var.Platform)
is built-in, but its value is used to define custom variables $(var.ProductName)
, $(var.Win64)
and $(var.PlatformProgramFilesFolder)
.
Using the variables
You can either use preprocessor <?if
directives to test variables' values (as is done with $(var.Platform)
when defining the custom variables above) or have the preprocessor insert variables' values into XML attribute or element values. Couple of examples:
32/64-bit components
<Component Id="..." Win64="$(var.Win64)"> ...</Component>
This will produce warnings in the Visual Studio WiX editor about $(var.Win64)
not being one of the allowable attribute values (yes
/no
) but these can be safely ignored, because the preprocessor will have substituted an appropriate value by the time the compiler gets hold of it.
32/64 bit Program Files directory
<Directory Id="$(var.PlatformProgramFilesFolder)"> ...</Directory>
Update to handle separate 32/64 bit product codes
In response to rharrison33's comment asking how to handle the requirement for different product codes (or pretty much anything) in the 32 and 64 bit installers (assuming you can't/don't want to auto-generate them):
- Pass separate product codes to candle as preprocessor variables, on the command line or using a response file:
candle <all other flags> -d ProductCode32=<guid1> -d ProductCode64=<guid2>
- Add a product code as one of your architecture-dependent preprocessor variables, and set it to the appropriate input variable:
- In the 32-bit
<?if ?>
branch:<?define ProductCode = "$(var.ProductCode32)" ?>
- In the 64-bit
<?if ?>
branch:<?define ProductCode = "$(var.ProductCode64)" ?>
- In the 32-bit
- Refer to
$(var.ProductCode)
inProduct/@Id
.
Made this CW because Daniel's link answers the question and has a lot more great info besides.
- WIX 分别创建32位64位安装程序
- Wix 安装32位或64位的设定
- WiX 创建msi安装程序
- 64位ubuntu安装32位程序,兼容库
- WIN7 64位如何安装虚拟机使用32位程序
- 64位Linux(ubuntu)安装、运行32位程序
- linux (64bit)安装32位程序
- 在64位ubuntu系统上运作32位程序需要安装32位lib
- Linux在64位运行32位程序(安装32位库:rpm、deb)
- 32位QT程序读取64位系统的注册表中的64位安装软件
- memcpy的8位,16位,32位分别实现
- 32位到64位程序移植
- 64位Linux 编译32位程序
- Linux 64位 编译32位程序
- 64位系统运行32位程序
- Ubuntu 64位跑32位程序
- 32位和64位程序兼容性
- 64位系统编译32位程序
- 分布式系统编程,你到哪一级了?
- Unique Binary Search Trees
- iOS 过滤emoji表情
- 韦东山视频心得体会之矢量字体
- 技术 blog12 之 类库 by 八戒
- WIX 分别创建32位64位安装程序
- FIR.im的使用_亲自实验
- js DOM节点
- 利用ant和junit实现单元测试的自动化
- EditText只接收具体的某些字符
- java二进制的学习(一)
- HDU 5266 pog loves szh III (线段树+在线LCA转RMQ)
- HTTP/超文本传输协议
- svn: E200030: BUSY