使用x32包注册x64 dll

时间:2014-02-21 09:39:32

标签: dll windows-installer installshield regsvr32

我想为x64和x32系统构建一个MSI。 MSI包含两个DLL,其中一个仅安装在x64系统上(我为此添加了VersionNT64条件),DLL正在安装但未注册,但是我已经为该文件提取了COM数据。我认为这是因为包是x32。我的问题是:是否可以使用x32 msi包注册x64 dll?

我尝试使用安装脚本,但它不起作用:

#include "ifx.h"

export prototype register64BitPropertyHandler(HWND)  ;
export prototype unregister64BitPropertyHandler(HWND)  ;

#define REGSVR64            "\""+WINSYSDIR64^"REGSVR32.EXE"+"\""
#define REGSVR64RegParam    "/s \""+INSTALLDIR^"x64"^"IADotNetProfiler_x64.dll"+"\""
#define REGSVR64UnRegParam  "/u /s" + " \"" + INSTALLDIR^"x64"^"IADotNetProfiler_x64.dll"+"\""
function register64BitPropertyHandler(hInstall)
begin
    Disable (WOW64FSREDIRECTION);
    LaunchAppAndWait( REGSVR64, REGSVR64RegParam, NOWAIT );
    Enable (WOW64FSREDIRECTION);
end;
function unregister64BitPropertyHandler(hInstall)
begin
    Disable (WOW64FSREDIRECTION);
    LaunchAppAndWait( REGSVR64, REGSVR64UnRegParam, NOWAIT );
    Enable (WOW64FSREDIRECTION);
end;

1 个答案:

答案 0 :(得分:1)

你不能真的为此做一个MSI:

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

这样,32位MSI只能包含32位组件:

http://msdn.microsoft.com/en-us/library/aa367451(v=vs.85).aspx

因此,您不太可能使其正常工作,即使您这样做也可能不受支持。请注意,因为这不是你应该做的事情,所以关于如何做或者实际上可以做的知识很少(如果有的话)。