<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="2">
    <title>PalmRD</title>
    <options customize="never" require-scripts="true" hostArchitectures="x86_64,arm64"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <volume-check script="true">
        <allowed-os-versions>
            <os-version min="14.0"/>
        </allowed-os-versions>
    </volume-check>
    <script><![CDATA[
function palmrdInstallCheck() {
    var version;
    try {
        version = system.version.ProductVersion;
    } catch (error) {
        version = null;
    }
    if (typeof version !== 'string' || !/^[0-9]+\.[0-9]+(?:\.[0-9]+)?$/.test(version)) {
        my.result.type = 'Fatal';
        my.result.message = '无法确认 macOS 版本，安装已停止。请更新系统后重试。 / Unable to determine the macOS version. Installation has stopped. Update macOS and try again.';
        return false;
    }
    if (Number(version.split('.')[0]) < 14) {
        my.result.type = 'Fatal';
        my.result.message = 'PalmRD 需要 macOS 14.0 或更新版本。请先更新 macOS。 / PalmRD requires macOS 14.0 or later. Update macOS before installing.';
        return false;
    }
    return true;
}
    ]]></script>
    <installation-check script="palmrdInstallCheck();"/>
    <choices-outline>
        <line choice="default">
            <line choice="com.palmrd.mac.installer"/>
        </line>
    </choices-outline>
    <choice id="default"/>
    <choice id="com.palmrd.mac.installer" visible="false">
        <pkg-ref id="com.palmrd.mac.installer"/>
    </choice>
    <pkg-ref id="com.palmrd.mac.installer" version="0.1.37" onConclusion="none" installKBytes="54987" updateKBytes="0">#WindowPilot-Agent.pkg</pkg-ref>
    <pkg-ref id="com.palmrd.mac.installer">
        <bundle-version>
            <bundle CFBundleShortVersionString="0.1.37" CFBundleVersion="38" id="com.palmrd.mac" path="Applications/PalmRD.app"/>
            <bundle CFBundleShortVersionString="2.10.0" CFBundleVersion="2064" id="org.sparkle-project.Sparkle" path="Applications/PalmRD.app/Contents/Frameworks/Sparkle.framework"/>
            <bundle CFBundleShortVersionString="2.10.0" CFBundleVersion="2064" id="org.sparkle-project.DownloaderService" path="Applications/PalmRD.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Downloader.xpc"/>
            <bundle CFBundleShortVersionString="2.10.0" CFBundleVersion="2064" id="org.sparkle-project.Sparkle.Updater" path="Applications/PalmRD.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app"/>
            <bundle CFBundleShortVersionString="1.0" CFBundleVersion="5" id="com.windowpilot.inputmethod.remote" path="Applications/PalmRD.app/Contents/Library/Input Methods/WindowPilotInput.app"/>
            <bundle id="com.palmrd.mac.update-authorization" path="Applications/PalmRD.app/Contents/Resources/UpdateAuthorization.bundle"/>
            <bundle CFBundleShortVersionString="1.0" CFBundleVersion="1.0" id="org.webrtc.WebRTC" path="Applications/PalmRD.app/Contents/Frameworks/WebRTC.framework"/>
            <bundle CFBundleShortVersionString="2.10.0" CFBundleVersion="2064" id="org.sparkle-project.InstallerLauncher" path="Applications/PalmRD.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Installer.xpc"/>
        </bundle-version>
    </pkg-ref>
</installer-gui-script>