<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--
    Distribution.xml.template
    productbuild definition for the AppAutoPatch installer.

    The release.sh script substitutes the 4.0.0 token with the current
    MARKETING_VERSION before running productbuild. Other placeholders are
    intentionally left literal.

    The bundle reference inside pkg-ref id="..." must match the
    component identifier passed to pkgbuild via its identifier flag.
-->
<installer-gui-script minSpecVersion="2">
    <title>App Auto-Patch 4.0.0</title>
    <organization>xyz.techitout.appAutoPatch</organization>
    <!-- macOS 14.0 (Sonoma) is the minimum we currently support. SMAppService
         daemon support is macOS 13+, but a few APIs in our codebase target 14. -->
    <allowed-os-versions>
        <os-version min="14.0"/>
    </allowed-os-versions>
    <!-- Single-volume install: nothing for the user to choose.

         hostArchitectures pins the arch list the installer reports for
         the package's scripts. Without it, macOS 26's PackageKit
         defaults to flagging the postinstall script for Rosetta
         translation (Installer.log emits "Install request is requesting
         Rosetta translation." + "Preparing to execute with Rosetta Intel
         Translation" lines) even though our postinstall is plain shell
         and `/bin/bash` is universal. The translation is a no-op in
         practice ("PackageKit: No Intel binaries to translate.") but
         the noise gets reported as installer errors — see issue #9. -->
    <options customize="never" require-scripts="true" rootVolumeOnly="true" hostArchitectures="arm64,x86_64"/>
    <!-- Domain target: install to the system /Applications, not to a user
         home directory. We need root for the postinstall script anyway. -->
    <domains enable_localSystem="true"/>
    <!-- License, readme, and background image. Even though `customize="never"`
         hides the license/readme panes from the installer UI, declaring the
         resources here silences the macOS Installer.app log warnings
         "Could not load resource readme: (null)" / "Could not load resource
         license: (null)" / "Failed to load specified background image" that
         would otherwise appear in /var/log/install.log on every install.
         The files live in Scripts/pkg/resources/ and are passed to
         productbuild via its resources flag. See issue #9. -->
    <license file="license.txt" mime-type="text/plain"/>
    <readme file="readme.txt" mime-type="text/plain"/>
    <background file="background.png" alignment="bottomleft" scaling="proportional"/>
    <background-darkAqua file="background.png" alignment="bottomleft" scaling="proportional"/>
    <choices-outline>
        <line choice="default">
            <line choice="xyz.techitout.appAutoPatch.app"/>
        </line>
    </choices-outline>
    <!-- title= keeps Installer.app's install summary from logging
         'Upgrade: "(null)"' for the unnamed parent choice. -->
    <choice id="default" title="App Auto-Patch"/>
    <choice id="xyz.techitout.appAutoPatch.app" visible="false">
        <pkg-ref id="xyz.techitout.appAutoPatch.app"/>
    </choice>
    <pkg-ref id="xyz.techitout.appAutoPatch.app" version="4.0.0" auth="root" installKBytes="10175" updateKBytes="0">#AppAutoPatch.pkg</pkg-ref>
    <pkg-ref id="xyz.techitout.appAutoPatch.app">
        <bundle-version>
            <bundle CFBundleShortVersionString="4.0.0" CFBundleVersion="65" id="xyz.techitout.appAutoPatch" path="App Auto-Patch.app"/>
        </bundle-version>
    </pkg-ref>
</installer-gui-script>