Inno Setup 32bit and 64bit dll installation

会有一股神秘感。 提交于 2019-12-21 10:55:12

问题


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.


回答1:


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



回答2:


Couldn't get it to work with just the {app} variable because you want to install on two destinations simultaneously.

Solved it by hard coding the program files folder like this

#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

This works for me. Windows loads the 32bit dll for 32bit apps and 64bit dll for 64bit apps automatically this way.



来源:https://stackoverflow.com/questions/17944516/inno-setup-32bit-and-64bit-dll-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!