WiX installer that always installs to "Program Files" directory on both x86 and x64
Asked Answered
H

4

11

I have a .NET application that runs on both x86 and x64. 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.

How do you go about doing this?

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.

I have very little experience with WiX so if this idea is even possible I have no idea. If it is what would you test on to see if it is an x64 environment? Also how would you then assign a property value from ProgramFilesFolder or ProgramFiles64Folder depending on the earlier 64 bit environment test.

Any help is appreciated!

Hairraising answered 15/5, 2010 at 4:25 Comment(0)
E
2

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.

I've given up and am just installing my 64-bit component to ProgramFilesFolder. It's not that nice aesthetically but it works :)

Encaenia answered 27/9, 2010 at 23:29 Comment(0)
C
3

MSI doesn't support 32-bit packages installing to 64-bit directories.

Crash answered 16/5, 2010 at 3:17 Comment(3)
heh, as you know, there are ways. <evil_grin/>Waterscape
It's not a 32-bit package. The author states that the program is written in .NET (and I'm guessing he's targeting ANY CPU, since that's the default, and most common). With a .NET executable or library that targets ANY CPU: On a 32-bit machine, when it's run, the JIT compiler will generate 32-bit code to execute, and on a 64-bit machine when it's run, the JIT compiler will generate 64-bit code to execute. It makes perfect sense, that he would always want to install it under "C:\Program Files", and never "C:\Program Files (x86)".Mellar
Windows Installer doesn't support the AnyCPU concept; packages are either explicitly 32-bit or explicitly 64-bit.Crash
W
3

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.

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

Waterscape answered 16/5, 2010 at 17:15 Comment(0)
E
2

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.

I've given up and am just installing my 64-bit component to ProgramFilesFolder. It's not that nice aesthetically but it works :)

Encaenia answered 27/9, 2010 at 23:29 Comment(0)
E
0

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:

1 - use ProgramFiles64Folder for the directory

2 - change the setup project's settings to add a compiler switch. Its on the 'Tool Settings' tab and you add '-arch x64' to the compiler settings.

Electroacoustics answered 26/2, 2022 at 1:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.