开发者

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 pla开发者_运维问答tform.

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


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. :-)


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


This link http://msdn.microsoft.com/en-us/library/cd7a85k9%28v=VS.90%29.aspx (referenced in the link you posted) has this section: To install files to the Common Files, Program Files, or System folder on a 64-bit platform.

This should help you out, as long as you target the x64 platform and doesn't have any references to libraries that are x86 only.


I use WiX for installation packages. Please review the following article to see if it fits your requirements:

Example WiX-based setup that can be used to build both 32-bit and 64-bit MSIs

s

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜