The constant {pf} is the directory of
C:\Program Files
for 32bit systems and
C:\Program Files (x86)
for 64bit systems.
However I want to use the directory
C:\Program Files
for both, 32 and 64bit systems. How can I achieve this?
Use a scripted constant like:
[Setup]
DefaultDirName={code:GetProgramFiles}\My Program
[Code]
function GetProgramFiles(Param: string): string;
begin
if IsWin64 then Result := ExpandConstant('{commonpf64}')
else Result := ExpandConstant('{commonpf32}')
end;
Though this approach should only be used, if you generate binaries for the respective platform on the fly. Like in your case, if understand correctly, you compile the Java binaries for the respective architecture.
You can also use 64-bit install mode.
Then you can simply use {autopf}
constant (previously {pf}
):
[Setup]
DefaultDirName={autopf}\My Program
If you have a separate 32-bit and 64-bit binaries in the installer, use a script like:
[Files]
Source: "MyDll32.dll"; DestDir: "{pf32}\My Program"; Check: not IsWin64
Source: "MyDll64.dll"; DestDir: "{pf64}\My Program"; Check: IsWin64
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With