我有一个用 C# 开发的应用程序。我正在使用 Visual Studio 安装项目为该应用程序创建安装程序。
安装时,我想执行一个 32 位和 64 位分别不同的 exe 文件。所以我必须为 32 位和 64 位使用不同的文件。
为了执行 exe 文件,我添加了“自定义操作”,这也有效。但如前所述,exe 文件因系统架构而异。我如何知道安装程序中的体系结构并执行相应的文件。
我尝试了以下方法:
检查 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node - 如果找到则它也返回“”,否则也返回“”,所以没有用。
VersionNT - 只提供版本,我更关心架构。
我怎样才能做到这一点? VBS 可以做这个工作吗?我不知道vbs,但知道它可以添加到动作中并设置其条件以及诸如此类的小事情。
如果我创建另一个 32 位应用程序来检测架构,那么这个可靠的安装又将如何解决?
非常感谢任何帮助。
谢谢
I have a application developed in C#. I am creating an installer for the app using Visual Studio Setup Project.
While installation, I want to execute an exe file which differs for 32 and 64 bit respectively. So I have to use different file for 32bit and 64bit.
For executing exe file, I have added "Custom Action" and that works also. But as said, the exe file differs for system architectire. How can I knwo the architecture in installer and execute the respective file.
I tried the following :
Check the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node - If found then also it returns "" and else also returns "", so of no use.
VersionNT - that provides only version, I am more concerned with Architecture.
How can I achieve this ? VBS can do the work or not ? I don't know vbs, but know that it can be added to action and set its condition and little bit things like that.
If at all I create another 32bit app that detects the architecture, then also how would that work out with this suring installation ?
Any help is highly appreciated.
Thanks
发布评论
评论(2)
请参阅属性版本NT64 仅在 64 位系统上设置。如果您需要区分 IA64 和 x64,另请参阅属性Intel64 和 Msix64。
例如,如果您希望组件或自定义操作仅在 64 位系统上安装或运行,则可以在组件或自定义操作上使用读取 VersionNT64 的条件。
Refer to the property VersionNT64 which is only set on 64-bit systems. If you need to differentiate between IA64 and x64, see also properties Intel64 and Msix64.
For example you may use a condition on your component or custom action that reads VersionNT64 if you want it to install or run on only 64-bit systems.
看这里的第二条评论: http://msdn.microsoft .com/en-us/library/ms724072%28VS.85%29.aspx
Look at second comment here: http://msdn.microsoft.com/en-us/library/ms724072%28VS.85%29.aspx