0
votes

I am working on an installer in InstallShield 2012 Spring.

The installer is for an application built in .NET that built as "Any CPU" meaning it runs 32-bit on a 32-bit machine and 64-bit on a 64-bit machine.

I would assume this means that application should always install to the Program Files folder, not the Program Files (x86) folder. I can't figure out a way to have the application install to the 64-bit Program Files folder without rendering the installer un-usable on 32-bit versions of windows.

I tried simply changing the install path from ProgramFilesFolder to ProgramFiles64Folder but this do anything unless I also made the component 64-bit and set the installer to x64. (Thus making the installer 64-bit ONLY)

Any idea how to make an installer never install to the (x86) folder or am I SOL?

1

1 Answers

1
votes

Windows Installer doesn't support "Any CPU". MSI's have to be marked as x86 or x64 and can only use ProgramFilesFolder and ProgramFiles64Folder respectively. Even if you have a custom action that tries to manually set the destination directory, the Windows Installer service will intercept the path and push it back assuming you have a badly written MSI and enforce compatibility.

But it doesn't really matter. Your Any CPU compiled EXE living in the PF 32 bit folder will still run as a 64bit app.

If it really bothers you that much, you can use a short directory name (C:\Progra~1) in that custom action I mentioned and subvert MSI's attempts to "help" you.