Inno Setup 32位和64位dll安装 [英] Inno Setup 32bit and 64bit dll installation

查看:40
本文介绍了Inno Setup 32位和64位dll安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果操作系统是 64 位,我想将 32 位 DLL 安装到 Program Files (x86) 文件夹和 64 位 DLL 到 Program Files 文件夹并分别注册它们.如果是 32 位操作系统,我只想将文件复制到普通程序文件夹并注册.

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.

如何在 Inno Setup 中执行此操作?64 位 DLL 也会被 64 位 regsvr32 程序注册吗?

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

到目前为止,这是我的代码.它在 32 位操作系统上运行良好,但在 64 位操作系统上它转储 Program Files (x86) 中的两组文件.

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 filesmylibrary.dll; DestDir: {app}; 
    Flags: restartreplace ignoreversion regserver 32bit

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

我查看了 64BitTwoArch.iss 示例,但它告诉我们如何进行 32 位或 64 位安装,而不是 32 位和 64 位安装.

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.

推荐答案

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

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 filesmylibrary.dll; DestDir: {pf32}{#MyAppName}; 
    Flags: restartreplace ignoreversion regserver 32bit

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

这对我有用.Windows 通过这种方式自动加载 32 位应用程序的 32 位 dll 和 64 位应用程序的 64 位 dll.

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

这篇关于Inno Setup 32位和64位dll安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆