Inno Setup 32bit and 64bit dll installation

32bit-64bitinno-setup

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.

Best Answer

I have had success with the following:

[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
Related Topic