7

If the OS is 64bit I want to install a 32bit DLL to the Program Files (x86) folder and 64bit DLL to Program Files folder and register them respectively. If it is a 32bit OS I just want to copy the file to the normal program folder and register.

How can I do this in Inno Setup? Also will the 64bit DLL be registered by the 64bit regsvr32 program?

Here is my code so far. It works fine on 32bit OS but on 64bit OS it dumps both set of files in the Program Files (x86).

[Files]
Source: D:\..\32bit files\mylibrary.dll; DestDir: {app}; \
    Flags: restartreplace ignoreversion regserver 32bit

Source: D:\..\64bit files\mylibrary.dll; DestDir: {app}; \
    Flags: restartreplace ignoreversion regserver 64bit; Check: IsWin64

I have looked at the 64BitTwoArch.iss example but that tells how to do a 32bit OR 64bit install not a 32bit AND 64bit install.

4

2 回答 2

4

我在以下方面取得了成功:

[Files]
Source: D:\..\32bit files\mylibrary.dll; DestDir: {app}; \
    Flags: restartreplace ignoreversion regserver 32bit; **Check: "not IsWin64"**

Source: D:\..\64bit files\mylibrary.dll; DestDir: {app}; \
    Flags: restartreplace ignoreversion regserver 64bit; Check: IsWin64
于 2013-07-30T14:34:25.740 回答
3

无法仅使用{app}变量,因为您想同时安装在两个目标上。

通过像这样对程序文件文件夹进行硬编码来解决它

#define MyAppName "TestAPP"

[Files]
Source: D:\..\32bit files\mylibrary.dll; DestDir: {pf32}\{#MyAppName}; \
    Flags: restartreplace ignoreversion regserver 32bit

Source: D:\..\64bit files\mylibrary.dll; DestDir: {pf64}\{#MyAppName}; \
    Flags: restartreplace ignoreversion regserver 64bit; Check: IsWin64

这对我有用。Windows 以这种方式自动为 32 位应用程序加载 32 位 dll,为 64 位应用程序加载 64 位 dll。

于 2013-08-01T07:33:00.303 回答