AME.

Build from source

Build the Windows x64 installer.

Build with GitHub Actions

  • Open the repository’s Actions → Build Setup, select Run workflow, choose a branch and run. Fork and enable Actions first to build your own changes.
  • After the run succeeds, download AMExclusive-Setup-x64 from Artifacts and unzip AMExclusive-Setup.exe. Sign in to GitHub to download; artifacts are retained for 14 days.
  • Manual trigger only: builds Windows x64 Release and checks the embedded installer files without publishing a Release. The runner needs no Apple Music installation; the PC using AMExclusive still does.

Local build environment

  • Windows x64; installed Apple Music or standalone WinUI metadata.
  • Visual Studio 2022+ / Build Tools: MSVC x64 C++ tools and Windows 11 SDK.
  • CMake 3.24+ and PowerShell.

Build files and targets

Source fileResponsibility and entry points
.github/workflows/build-setup.ymlworkflow_dispatch entry point; Windows x64 Release, embedded Setup payload check and artifact upload with 14-day retention.
mod/CMakeLists.txtC++20, Windows x64 and static MSVC runtime; fetches MinHook v1.3.4, generates WinUI projections and defines all targets.
mod/scripts/Build-Mod.ps1Configuration=Debug|Release, BuildDirectory=build; WinUIMetadataDirectory overrides installed Appx metadata; discovers tools, configures/builds CMake and copies the distribution.
mod/scripts/Get-WinUIMetadata.ps1Downloads pinned WinUI and companion metadata from NuGet; extracts only .winmd files and verifies the fixed Microsoft.UI.Xaml.winmd SHA-256.
mod/scripts/Generate-SetupResources.ps1Embeds the fixed production payload, installer scripts and licenses in generated Setup .rc resources.
mod/src/SetupInstaller.cppSingle-file installer entry point and installation flow.
mod/scripts/Install-Mod.ps1Installation and upgrade; maintain together with Uninstall-Mod.ps1.
mod/scripts/Register-Companion.ps1Registers the per-user companion task and its directory/process lifetime constraints.
mod/config/am-exclusive.iniDefault [mod] config: mode=exclusive, period_100ns=200000 (20 ms); copied beside the broker.
mod/src/SetupResources.hAMMOD_RESOURCE_* installer resource IDs; keep generator and Setup lookups consistent.
mod/scripts/Uninstall-Mod.ps1Uninstall implementation: process shutdown, task and installation-state removal; retains path validation.
mod/scripts/Uninstall.cmdWindows uninstall launcher; calls Uninstall-Mod.ps1 and propagates its exit code.

Get the source

git clone https://github.com/AntiOblivionis/AMExclusive.git
cd AMExclusive

Build Release

Run from the repository root. The script activates MSVC through Visual Studio DevShell when needed, reads metadata from installed Apple Music by default, configures CMake for x64 and builds the single-file installer.

.\mod\scripts\Build-Mod.ps1 -Configuration Release

Build without installing Apple Music

Uses the same metadata downloader as Actions. WinUI 1.8.251222000 and companion versions are pinned. Metadata generates C++/WinRT projections; it does not install the UI runtime or bundle its DLLs into Setup.

.\mod\scripts\Get-WinUIMetadata.ps1 -OutputDirectory .\mod\build\winui-metadata
.\mod\scripts\Build-Mod.ps1 -Configuration Release -WinUIMetadataDirectory .\mod\build\winui-metadata

Targets and binaries

  • am_exclusive_hook → am-exclusive-hook.dll: HookDll, IPC, quality lock and audio_v2.
  • am_exclusive_ui → am-exclusive-ui.dll: UiAdapter and IPC.
  • am_exclusive_broker → am-exclusive-broker.exe: Broker and IPC.
  • am_exclusive_media_control → am_exclusive_media_control.exe: MediaSessionControl.cpp.
  • am_exclusive_setup → AMExclusive-Setup.exe: SetupInstaller.cpp and generated .rc resources.

Outputs

  • Distribution: mod\build\dist\AMExclusive-Setup.exe.
  • Build files: mod\build; binaries: mod\build\Release.
  • Setup → 1 installs or upgrades; Setup → 2 uninstalls.

Separate build directory

Relative build directories are resolved under mod; this example distributes to mod\build-release\dist. The script recreates the chosen build directory’s dist folder.

.\mod\scripts\Build-Mod.ps1 -Configuration Release -BuildDirectory build-release

Build failures

  • MSVC unavailable: install the x64 C++ workload, or run in an x64 developer PowerShell.
  • CMake unavailable: add it to PATH, or install Visual Studio’s CMake tools.
  • Apple Music package lookup fails: install Apple Music or use the standalone metadata steps and WinUIMetadataDirectory above.
  • Missing cppwinrt.exe or metadata: check Windows SDK and APPLE_MUSIC_PACKAGE_DIR, which can point to Apple Music or the complete standalone metadata directory. Redownload on a hash mismatch; do not bypass verification.
  • Initial FetchContent failure: check Git and connectivity to the MinHook repository.

Using CMake directly

Run from the repository root in x64 developer PowerShell. Initial configuration downloads MinHook. cppwinrt.exe reads metadata from APPLE_MUSIC_PACKAGE_DIR and writes build-dev/generated/winrt; the parameter also accepts the standalone metadata directory. Do not edit generated headers.

  • Direct CMake builds components and Setup under build-dev/Release; it does not perform Build-Mod.ps1’s dist-copy step.
  • Incremental target example: cmake --build mod/build-dev --config Release --target am_exclusive_hook. Build am_exclusive_setup for the complete package.
  • The public source snapshot does not include the private validation suite. Add tests for your changes and verify playback on real devices.
$amPackage = Get-AppxPackage -Name AppleInc.AppleMusicWin
cmake -S mod -B mod/build-dev -A x64 "-DAPPLE_MUSIC_PACKAGE_DIR=$($amPackage.InstallLocation)"
cmake --build mod/build-dev --config Release --parallel