Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I write an installer for 32 and 64 bit

I have a .NET app which works in 32 and 64 bit. I would like to write one single installer that installs to c:\program files, not c:\program files(x86) regardless of the platform.

From this link: http://msdn.microsoft.com/en-us/library/w1behyzx(v=VS.90).aspx it doesn't look possible. Is it the case?

like image 793
tom greene Avatar asked Apr 09 '10 18:04

tom greene


2 Answers

According to How to: Create a Windows Installer for a 64-bit Platform:

To distribute a .NET Framework application both to 32- and 64-bit platforms, build two MSI packages, one targeted at a 32-bit and the other a 64-bit computer. The user can install the 32-bit setup project package and it will most likely run as a 64-bit application, only the 64-bit setup project will install to the "Program Files64" directory.

Not the best experience, but works.

Update: The usual way people deal with their desire to avoid two installer packages is to produce one setup executable, which packs both installers and choose the correct one on the fly.

You can just create a quick C# (though now you have the problem of bootstrapping it on machines without .Net. yeah, are there such machines yet? :-)) or C++ executable yourself that detects the platform it runs on and launches the msiexec process with the proper .msi extracted from the executable resources or downloaded from a web siter.

Or this SO question's accepted answer talks briefly about that and mentions a third-party tool called Advanced Installer, that can help you with this. Note that I have not tried that tool and I can't vouch for it, theI just mention it for mere reference; you'll have to evaluate it on your own. :-)

like image 199
Franci Penov Avatar answered Nov 01 '22 13:11

Franci Penov


If your app works in 32 and 64-bit, it is 32-bit and therefore it goes in the (x86) folder.

like image 21
Daniel DiPaolo Avatar answered Nov 01 '22 12:11

Daniel DiPaolo