Introducing a new way to review your PRs.

Read the announcement

mustardchef / wsabuilds

Run Windows Subsystem For Android on your Windows 10 and Windows 11 PC using prebuilt binaries with Google Play Store (MindTheGapps) and/or Magisk or KernelSU (root solutions) built in.

View on GitHub

12 documents · Updated Nov 16, 2026

docs / magiskonwsa-installer-packaging

MagiskOnWSA installer packaging

Overview

This area provides the Windows-side installer assets that are copied into the generated MagiskOnWSA package directory and run from there, not from the source tree. The generated output is expected to contain AppxManifest.xml, filelist.txt, dependency .appx files named from manifest dependencies, resources.pri, optional pri/ and xml/ resource folders, makepri.exe, and the installer scripts from MagiskOnWSA/installer/**.

Path responsibilities:

  • MagiskOnWSA/installer/Run.bat is the user-friendly batch entrypoint. It changes to its own drive and directory, verifies that Install.ps1 exists beside it, and starts powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1.
  • MagiskOnWSA/installer/Install.ps1 is the generic installer script used from the package root. It elevates to administrator, validates every path listed in generated filelist.txt, optionally invokes MakePri.ps1 when both MakePri.ps1 and makepri.exe are present, enables sideloading and Virtual Machine Platform, installs missing dependency .appx packages for the manifest architecture, removes or preserves an existing WSA install as needed, shuts down WsaClient, and registers the unpacked appx with Add-AppxPackage -Register .\AppxManifest.xml. On success it opens the Magisk and Play Store WSA protocols.
  • MagiskOnWSA/installer/MakePri.ps1 performs the one-shot PRI/resource merge inside the generated package. It copies the existing resources.pri into pri/resources.pri, runs makepri.exe new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn .\AppxManifest.xml /o, and falls back to dumping each pri/*.pri into priinfo/*.xml before rebuilding if the direct merge fails. It then appends <Resource> entries from every xml/*.xml except priconfig.xml into AppxManifest.xml, deletes pri/, xml/, makepri.exe, and itself, and removes those names from filelist.txt so later installer validation reflects the post-merge package.
  • MagiskOnWSA/installer/arm64/Install.ps1 and MagiskOnWSA/installer/x64/Install.ps1 are architecture-specific copies of the installer. They follow the same install flow as the generic script but choose pwsh.exe whenever available, while MagiskOnWSA/installer/Install.ps1 only prefers pwsh.exe on Windows 11.
  • MagiskOnWSA/installer/arm64/MakePri.ps1 and MagiskOnWSA/installer/x64/MakePri.ps1 are architecture-specific copies of the PRI merge script. Their resource merge, manifest update, cleanup, and filelist.txt mutation behavior matches the generic MagiskOnWSA/installer/MakePri.ps1.
  • MagiskOnWSA/arm64/makepri.exe is the ARM64 MakePRI binary that the built package can place next to MakePri.ps1 for on-device resource merging.
  • MagiskOnWSA/…/priconfig.xml is the MakePRI configuration consumed as .\xml\priconfig.xml in the generated package. It indexes from the package root, defaults language qualification to en-US, and enables folder/filename qualifiers plus PRI and priinfo inputs.

The installer treats package metadata as runtime input from AppxManifest.xml: Identity.Name identifies the existing package to update or remove, Identity.Version is displayed to the user, Identity.ProcessorArchitecture selects matching dependency packages, and Dependencies.PackageDependency provides dependency names and minimum versions. The scripts do not generate this metadata; they enforce and consume it after the build has produced the unpacked appx/MSIX layout.

Coupling

  • If the build changes the generated filelist.txt format, update MagiskOnWSA/installer/Install.ps1 and the architecture-specific copies under MagiskOnWSA/installer/arm64/ and MagiskOnWSA/installer/x64/; they pass each line directly to Test-Path and abort installation when any listed path is missing.
  • If generated dependency package names change, verify MagiskOnWSA/installer/Install.ps1 and its architecture-specific copies; they derive dependency filenames as $($_.Name)_$ProcessorArchitecture.appx from AppxManifest.xml and do not search for alternatives.
  • If MagiskOnWSA/…/priconfig.xml changes its indexer types or root, verify all MakePri.ps1 copies; they assume .\xml\priconfig.xml can rebuild resources.pri from both .pri files and dumped priinfo XML.
  • If resource XML files added to the generated xml/ directory no longer use Package.Resources.Resource, update all MakePri.ps1 copies; they append only that exact node shape into AppxManifest.xml.
  • If installer scripts are changed in one architecture folder, mirror the change deliberately across MagiskOnWSA/installer/Install.ps1, MagiskOnWSA/installer/arm64/Install.ps1, and MagiskOnWSA/installer/x64/Install.ps1 unless the difference is intentional. The same applies to the three MakePri.ps1 copies.

Risks

  • MagiskOnWSA/installer/MakePri.ps1, MagiskOnWSA/installer/arm64/MakePri.ps1, and MagiskOnWSA/installer/x64/MakePri.ps1 delete pri/, xml/, makepri.exe, and the running MakePri.ps1 after a successful merge. If the generated output is reused after this one-shot cleanup without rebuilding, localized resources cannot be regenerated and Install.ps1 will validate against the mutated filelist.txt rather than the original build layout.
  • MagiskOnWSA/installer/Install.ps1 and the architecture-specific copies enable VirtualMachinePlatform and may restart the computer before registering the package. If this feature enablement fails or the user declines restart, installation exits before dependency or app registration work begins.