简体   繁体   English

WiX 安装程序始终安装到 x86 和 x64 上的“Program Files”目录

[英]WiX installer that always installs to "Program Files" directory on both x86 and x64

I have a .NET application that runs on both x86 and x64.我有一个在 x86 和 x64 上运行的 .NET 应用程序。 I'd like to have a 32 bit WiX installer that will work on both platforms but I'd like it to install to /Program Files/ rather than /Program Files (x86)/ on 64 bit operating systems.我想要一个 32 位 WiX 安装程序,它可以在两个平台上运行,但我希望它在 64 位操作系统上安装到 /Program Files/ 而不是 /Program Files (x86)/ 。

How do you go about doing this?你 go 如何做到这一点?

Update:更新:

My idea was to assign the ProgramFilesFolder or ProgramFiles64Folder value to my own property, depending on whether it was a 64 bit environment or not, and then use that property value on the directory.我的想法是将 ProgramFilesFolder 或 ProgramFiles64Folder 值分配给我自己的属性,具体取决于它是否是 64 位环境,然后在目录上使用该属性值。

I have very little experience with WiX so if this idea is even possible I have no idea.我对 WiX 的经验很少,所以如果这个想法是可能的,我不知道。 If it is what would you test on to see if it is an x64 environment?如果是,您将测试什么以查看它是否是 x64 环境? Also how would you then assign a property value from ProgramFilesFolder or ProgramFiles64Folder depending on the earlier 64 bit environment test.此外,您将如何根据早期的 64 位环境测试从 ProgramFilesFolder 或 ProgramFiles64Folder 分配属性值。

Any help is appreciated!任何帮助表示赞赏!

While it's true that MSI's support here is weak, you might want to read the following article and comments then decide for yourself how you want to proceed. 虽然MSI的支持确实很弱,但您可能希望阅读以下文章和评论,然后自己决定如何继续。

http://blog.deploymentengineering.com/2008/01/even-developers-are-concerned-about.html http://blog.deploymentengineering.com/2008/01/even-developers-are-concerned-about.html

I just found this, I tried your exact idea and no dice. 我刚刚发现了这个,我尝试了你的确切想法而没有骰子。 You can't actually access ProgramFiles64Folder unless you are running a 64-bit installer. 除非您运行的是64位安装程序,否则无法实际访问ProgramFiles64Folder

I've given up and am just installing my 64-bit component to ProgramFilesFolder . 我放弃了,只是将我的64位组件安装到ProgramFilesFolder It's not that nice aesthetically but it works :) 它在美学上不是那么好但它有效:)

MSI不支持安装到64位目录的32位软件包。

I was able to install a x32 package with WiX into the \program files folder usig the idea from http://blog.deploymentengineering.com/2008/01/even-developers-are-concerned-about.html which is to:我能够使用http://blog.deploymentengineering.com/2008/01/even-developers-are-concerned-about.html中的想法将带有 WiX 的 x32 package 安装到 \program files 文件夹中:

1 - use ProgramFiles64Folder for the directory 1 - 使用 ProgramFiles64Folder 作为目录

2 - change the setup project's settings to add a compiler switch. 2 - 更改安装项目的设置以添加编译器开关。 Its on the 'Tool Settings' tab and you add '-arch x64' to the compiler settings.它位于“工具设置”选项卡上,您可以将“-arch x64”添加到编译器设置中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM