加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – Inno设置:使用{pf}在32位/ 64位系统上使用“Program

发布时间:2020-12-14 04:25:59 所属栏目:Windows 来源:网络整理
导读:常量{pf}是目录 C:Program Files 适用于32位系统和 C:Program Files (x86) 适用于64位系统. 但是我想使用该目录 C:Program Files 适用于32和64位系统.我怎样才能做到这一点? 解决方法 使用 scripted constant像: [Setup]DefaultDirName={code:GetProgra
常量{pf}是目录

C:Program Files

适用于32位系统和

C:Program Files (x86)

适用于64位系统.

但是我想使用该目录

C:Program Files

适用于32和64位系统.我怎样才能做到这一点?

解决方法

使用 scripted constant像:

[Setup]
DefaultDirName={code:GetProgramFiles}My Program

[Code]

function GetProgramFiles(Param: string): string;
begin
  if IsWin64 then Result := ExpandConstant('{pf64}')
    else Result := ExpandConstant('{pf32}')
end;

虽然只应使用此方法,但如果您在运行中为相应平台生成二进制文件.与您的情况一样,如果正确理解,则为相应的体系结构编译Java二进制文件.

如果安装程序中有单独的32位和64位二进制文??件,请使用以下脚本:

[Files]
Source: "MyDll32.dll"; DestDir: "{pf32}My Program"; Check: not IsWin64
Source: "MyDll64.dll"; DestDir: "{pf64}My Program"; Check: IsWin64

也可以看看:

> Is it possible to set the install mode in inno setup (32 or 64 bit)?
> Inno Setup 32bit and 64bit dll installation

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读