Forum Discussion

catinkayak's avatar
catinkayak
Copper Contributor
Aug 12, 2023
Solved

Does the MSIX Packaging tool support multiple architectures, and how does that work?

Here is some context of my current situation:
I have a very simple install, three executables and three DLL's and one desktop Icon;

My Installer I am using is InnoSetup, which detects the architecture and, then installs the relevant executables and DLL's depending on the architecture.. The output of this build is a single exe, installer.


 

; "ArchitecturesInstallIn64BitMode=x64 arm64" requests that the install
; be done in "64-bit mode" on x64 & ARM64, meaning it should use the
; native 64-bit Program Files directory and the 64-bit view of the
; registry. On all other architectures it will install in "32-bit mode".
ArchitecturesInstallIn64BitMode=x64 arm64

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; \
    GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
; Install MyApp-x64.exe if running on x64, MyApp-ARM64.exe if
; running on ARM64, MyApp.exe otherwise.
; Place all x64 files here
Source: "MyApp-x64.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}"; Check: InstallX64
; Place all ARM64 files here, first one should be marked 'solidbreak'
Source: "MyApp-arm64.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}"; Check: InstallARM64; Flags: solidbreak
; Place all x86 files here, first one should be marked 'solidbreak'
Source: "MyApp-x86.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}"; Check: InstallOtherArch; Flags: solidbreak
; Place all common files here, first one should be marked 'solidbreak'
Source: "data.dat"; DestDir: "{app}"; Flags: solidbreak
Source: "myapp-amd64-lib.dll"; DestDir: "{app}"; Flags: solidbreak
Source: "myapp-arm64-lib.dll"; DestDir: "{app}"; Flags: solidbreak
Source: "myapp-x86-lib.dll"; DestDir: "{app}"; Flags: solidbreak

[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";  WorkingDir: "{app}"; \
    Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function InstallX64: Boolean;
begin
  Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
end;

function InstallARM64: Boolean;
begin
  Result := Is64BitInstallMode and (ProcessorArchitecture = paARM64);
end;

function InstallOtherArch: Boolean;
begin
  Result := not InstallX64 and not InstallARM64;
end;

 



1: I am not sure if  InnoSetup`s produced single installer (setup/install.exe) is truely cross architecture compatible; I would think not. (however my install script is based InnoSetup's provided sample).

2: When I run the MSIX packaging tool, and capture the install.exe, using Parallels/MacOS, where the GuestOS is Windows 11 arm64, the resulting MSIX, appears to install the x86 executable. (When I inspect the "virtual file system", I did not run the msix installer locally).  

I want to submit the application to the store/partner centre, and it appears there is only a "single" package to be uploaded and not separate packages per architecture.

Ultimately I am intending to support x86,  x64 and arm64.

Thanks for assisting.
 

2 Replies

  • From your description, I'm not sure if you really had the x86 version installed and packaged in your test; it might have been the arm64 version. I don't know inno setup and can't see what sets {app} variable, but that may have dictated the location, which wouldn't really affect the app anyway - it is just a convention. You can probably check file sizes to confirm, or use a tool that will read the PE header to confirm. You can also just run the installer on the Arm64 OS and start the app, look in TaskManager/ProcessExplorer and confirm if 32 or 64 bit process.

Resources