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.batis the user-friendly batch entrypoint. It changes to its own drive and directory, verifies thatInstall.ps1exists beside it, and startspowershell.exe -ExecutionPolicy Bypass -File .\Install.ps1.MagiskOnWSA/installer/Install.ps1is the generic installer script used from the package root. It elevates to administrator, validates every path listed in generated filelist.txt, optionally invokesMakePri.ps1when bothMakePri.ps1andmakepri.exeare present, enables sideloading and Virtual Machine Platform, installs missing dependency.appxpackages for the manifest architecture, removes or preserves an existing WSA install as needed, shuts downWsaClient, and registers the unpacked appx withAdd-AppxPackage -Register .\AppxManifest.xml. On success it opens the Magisk and Play Store WSA protocols.MagiskOnWSA/installer/MakePri.ps1performs the one-shot PRI/resource merge inside the generated package. It copies the existingresources.priintopri/resources.pri, runsmakepri.exe new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn .\AppxManifest.xml /o, and falls back to dumping eachpri/*.priinto priinfo/*.xml before rebuilding if the direct merge fails. It then appends<Resource>entries from every xml/*.xml except priconfig.xml into AppxManifest.xml, deletespri/,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.ps1andMagiskOnWSA/installer/x64/Install.ps1are architecture-specific copies of the installer. They follow the same install flow as the generic script but choosepwsh.exewhenever available, whileMagiskOnWSA/installer/Install.ps1only preferspwsh.exeon Windows 11.MagiskOnWSA/installer/arm64/MakePri.ps1andMagiskOnWSA/installer/x64/MakePri.ps1are architecture-specific copies of the PRI merge script. Their resource merge, manifest update, cleanup, and filelist.txt mutation behavior matches the genericMagiskOnWSA/installer/MakePri.ps1.MagiskOnWSA/arm64/makepri.exeis the ARM64 MakePRI binary that the built package can place next toMakePri.ps1for 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.ps1and the architecture-specific copies underMagiskOnWSA/installer/arm64/andMagiskOnWSA/installer/x64/; they pass each line directly toTest-Pathand abort installation when any listed path is missing. - If generated dependency package names change, verify
MagiskOnWSA/installer/Install.ps1and its architecture-specific copies; they derive dependency filenames as$($_.Name)_$ProcessorArchitecture.appxfrom AppxManifest.xml and do not search for alternatives. - If MagiskOnWSA/…/priconfig.xml changes its indexer types or root, verify all
MakePri.ps1copies; they assume .\xml\priconfig.xml can rebuildresources.prifrom both.prifiles and dumpedpriinfoXML. - If resource XML files added to the generated
xml/directory no longer usePackage.Resources.Resource, update allMakePri.ps1copies; 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, andMagiskOnWSA/installer/x64/Install.ps1unless the difference is intentional. The same applies to the threeMakePri.ps1copies.
Risks
MagiskOnWSA/installer/MakePri.ps1,MagiskOnWSA/installer/arm64/MakePri.ps1, andMagiskOnWSA/installer/x64/MakePri.ps1deletepri/,xml/,makepri.exe, and the runningMakePri.ps1after a successful merge. If the generated output is reused after this one-shot cleanup without rebuilding, localized resources cannot be regenerated andInstall.ps1will validate against the mutated filelist.txt rather than the original build layout.MagiskOnWSA/installer/Install.ps1and the architecture-specific copies enableVirtualMachinePlatformand 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.