gpt4 book ai didi

windows - Inno 安装程序 : Use "Program Files" directory on both 32bit/64bit systems with {pf}

转载 作者:可可西里 更新时间:2023-11-01 14:02:37 25 4
gpt4 key购买 nike

常量{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('{commonpf64}')
else Result := ExpandConstant('{commonpf32}')
end;

虽然这种方法只适用于动态为相应平台生成二进制文件的情况。就像您的情况一样,如果理解正确,您可以为各自的体系结构编译 Java 二进制文件。


您还可以使用 64-bit install mode .

然后你可以简单地使用{autopf} constant (以前的 {pf}):

[Setup]
DefaultDirName={autopf}\My Program

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

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

另见:

关于windows - Inno 安装程序 : Use "Program Files" directory on both 32bit/64bit systems with {pf},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38443714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com