Architecture support

109 views
Skip to first unread message

Bill Stewart

unread,
Jun 12, 2024, 1:34:27 PMJun 12
to innosetup
I am writing an installer for program that supplies binaries in three architectures: x86, x64, and amd64.

Suppose [Setup] contains:

ArchitecturesInstallIn64BitMode=x64compatible arm64

Also suppose the following check functions:

begin
  result := (not Is64BitInstallMode()) or (Is64BitInstallMode() and (not IsX64Compatible()));
end;

function UseX64Binaries(): Boolean;
begin
  result := Is64BitInstallMode() and IsX64Compatible();
end;

function UseARM64Binaries(): Boolean;
begin
  result := Is64BitInstallMode() and IsArm64();
end;

Am I correct in assuming that the Is64BitInstallMode() function calls in the UseX64Binaries() and the UseARM64Binaries() functions are redundant?

Another way of asking this: If IsX64Compatible() returns true (or if IsArm64() returns true), does Is64BitInstallMode() also always return true?

Bill

Bill Stewart

unread,
Jun 12, 2024, 1:41:31 PMJun 12
to innosetup
On Wednesday, June 12, 2024 at 11:34:27 AM UTC-6 Bill Stewart wrote:

Another way of asking this: If IsX64Compatible() returns true (or if IsArm64() returns true), does Is64BitInstallMode() also always return true?

I think I have answered my own question...

According to the docs: "64-bit install mode is selected if the user is running a 64-bit version of Windows and the system's processor architecture is included in the value of the ArchitecturesInstallIn64BitMode [Setup] section directive. Otherwise, 32-bit install mode is used."

Since I have this in [Setup]:

ArchitecturesInstallIn64BitMode=x64compatible arm64

For this installer, this means that if either IsX64Compatible() or IsArm64() return true, then Is64BitInstallMode() also returns true.

Bill

Jordan Russell

unread,
Jun 20, 2024, 12:45:06 AMJun 20
to inno...@googlegroups.com
On 6/12/24 12:34 PM, 'Bill Stewart' via innosetup wrote:
> function UseX64Binaries(): Boolean;
> begin
> result := Is64BitInstallMode() and IsX64Compatible();
> end;
>
> function UseARM64Binaries(): Boolean;
> begin
> result := Is64BitInstallMode() and IsArm64();
> end;

I don't think that's what you want: both functions will return True on
Arm64 Windows 11.

Have a look at 6.3's 64BitThreeArch.iss example script which has updated
x64compatible-compatible code.

> Am I correct in assuming that the Is64BitInstallMode() function calls in
> the UseX64Binaries() and the UseARM64Binaries() functions are redundant?

Yes, calling Is64BitInstallMode is redundant when the same architectures
are listed in ArchitecturesInstallIn64BitMode. If the
ArchitecturesInstallIn64BitMode expression matches the current system
but Setup cannot enable 64-bit install mode, it will exit with an error
message.

I can't remember why the Is64BitInstallMode calls were in the example
(but they're gone in 6.3). Maybe an early pre-release build of 5.1
needed it.

-JR

Bill Stewart

unread,
Jun 20, 2024, 7:55:11 PMJun 20
to innosetup
On Wednesday, June 19, 2024 at 10:45:06 PM UTC-6 Jordan Russell wrote:

On 6/12/24 12:34 PM, 'Bill Stewart' via innosetup wrote:
> function UseX64Binaries(): Boolean;
> begin
> result := Is64BitInstallMode() and IsX64Compatible();
> end;
>
> function UseARM64Binaries(): Boolean;
> begin
> result := Is64BitInstallMode() and IsArm64();
> end;

I don't think that's what you want: both functions will return True on
Arm64 Windows 11.

Have a look at 6.3's 64BitThreeArch.iss example script which has updated
x64compatible-compatible code.

I was overthinking the problem. What I needed was:

* For x86-only binaries: Check: (not IsX64Compatible()) and (not IsArm64())

* For x64-only binaries: Check: IsX64Compatible() and (not IsArm64())

* For arm64-only binaries: Check: IsArm64()

Bill
Reply all
Reply to author
Forward
0 new messages