<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="2">
    <title>Premadonna</title>
    <options customize="always" require-scripts="false" hostArchitectures="x86_64,arm64"/>
    <domains enable_localSystem="true" enable_currentUserHome="false" enable_anywhere="false"/>
    <background file="background.png" alignment="center" scaling="none"/>
    <background-darkAqua file="background-darkAqua.png" alignment="center" scaling="none"/>
    <welcome file="welcome.html" mime-type="text/html"/>
    <readme file="readme.html" mime-type="text/html"/>
    <conclusion file="conclusion.html" mime-type="text/html"/>
    <!-- license pane omitted until an approved agreement exists -->
    <volume-check>
        <allowed-os-versions>
            <os-version min="15.0"/>
        </allowed-os-versions>
    </volume-check>
    <installation-check script="installationCheck()"/>
    <script><![CDATA[
function installationCheck() {
    var incoming = "0.0.1";
    var vst = choices["vst3"];
    if (vst && vst.selected == false) {
        my.result.title = "Choose the plug-in";
        my.result.message = "Select VST3. Notices and documentation install with it.";
        my.result.type = "Fatal";
        return false;
    }
    var ids = [
        "com.abeant.premadonna.pkg.vst3",
        "com.abeant.premadonna.pkg.documentation"
    ];
    var i;
    for (i = 0; i < ids.length; i++) {
        if (!my || !my.target || !my.target.receiptForIdentifier) {
            break;
        }
        var receipt = my.target.receiptForIdentifier(ids[i]);
        if (receipt && receipt.version && system.compareVersions(incoming, String(receipt.version)) < 0) {
            my.result.title = "Newer Premadonna is already installed";
            my.result.message = "This package is " + incoming + " and " + ids[i] + " " + receipt.version + " is already on this Mac. An older package is not installed over a newer one.";
            my.result.type = "Fatal";
            return false;
        }
    }
    return true;
}
function documentationSelected() {
    return true;
}
]]></script>
    <choices-outline>
        <line choice="vst3"/>
        <line choice="documentation"/>
    </choices-outline>
    <choice id="vst3" title="VST3" description="Installs Premadonna.vst3 for all users at /Library/Audio/Plug-Ins/VST3. A later install of this package replaces that file. A copy in the home Library is left in place. This installer does not move or delete that copy." start_selected="true" start_enabled="true" start_visible="true">
        <pkg-ref id="com.abeant.premadonna.pkg.vst3"/>
    </choice>
    <choice id="documentation" title="Notices and documentation" description="Installs third-party notices, license copies, privacy notes, and installation notes for all users at /Library/Application Support/ABEANT/Premadonna/Documentation. Required with the plug-in. Does not modify presets, projects, or trial records." start_selected="true" start_enabled="false" start_visible="true" selected="documentationSelected()">
        <pkg-ref id="com.abeant.premadonna.pkg.documentation"/>
    </choice>
    <pkg-ref id="com.abeant.premadonna.pkg.vst3" version="0.0.1" auth="Root" installKBytes="20225" updateKBytes="0">#Premadonna-vst3.pkg</pkg-ref>
    <pkg-ref id="com.abeant.premadonna.pkg.documentation" version="0.0.1" auth="Root" installKBytes="113" updateKBytes="0">#Premadonna-documentation.pkg</pkg-ref>
    <pkg-ref id="com.abeant.premadonna.pkg.vst3">
        <bundle-version>
            <bundle CFBundleShortVersionString="0.0.1" CFBundleVersion="0.0.1" id="com.premadonna.plugin" path="Library/Audio/Plug-Ins/VST3/Premadonna.vst3"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.abeant.premadonna.pkg.documentation">
        <bundle-version/>
    </pkg-ref>
    <product id="com.abeant.premadonna.installer" version="0.0.1"/>
</installer-gui-script>