MSI - 有条件地注册DLL

时间:2013-04-04 16:23:44

标签: c++ visual-studio-2010 windows-installer atl

我正在研究.NET Profiler(我的项目输出是一个DLL)。我已经构建了2个DLL(用c ++编写):一个将由x86 .NET进程加载,另一个由x64加载。我想生成一个MSI(目标x86模式),检查操作系统是64位还是32位。然后注册正确的DLL,即:

 - Project output : - the_x64.DLL
                    - the_x86.DLL
 - A single MSI that targets x86 machines : contains the 2 DLLs
                    - if the OS is 64 bits then both of the DLLs are registered
                    - if the OS is 32 bits then only the x86 dll is registered

这可能吗?

1 个答案:

答案 0 :(得分:5)

MSI平台不支持混合32/64位安装程序。有些黑客可以创建“混合”MSI,但它并没有得到官方的支持。 Microsoft推荐的方法是创建2个或更多MSI(通用,32位提供商,64位提供商),然后使用WiX Burn或InstallShield Suite安装程序等引导程序为最终用户提供单一安装体验。