<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="2">
    <pkg-ref id="com.atera.ateraagent">
        <bundle-version>
            <bundle CFBundleShortVersionString="2.0" CFBundleVersion="1" id="com.atera.ateraagent" path="AteraAgent.app"/>
        </bundle-version>
    </pkg-ref>
    <product id="com.atera.ateraagent" version="2.0"/>
    <title>AteraAgent</title>
    <options customize="never" require-scripts="false" hostArchitectures="x86_64"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="10.9"/>
        </allowed-os-versions>
    </volume-check>
    <choices-outline>
        <line choice="default">
            <line choice="com.atera.ateraagent"/>
        </line>
    </choices-outline>
    <choice id="default" title="AteraAgent" versStr="2.0"/>
    <choice id="com.atera.ateraagent" title="AteraAgent" visible="false" customLocation="/Applications">
        <pkg-ref id="com.atera.ateraagent"/>
    </choice>
    <pkg-ref id="com.atera.ateraagent" version="2.0.0" onConclusion="none" installKBytes="15134">#com.atera.ateraagent.pkg</pkg-ref>
    <background file="background.tiff" scaling="proportional" alignment="bottomleft"/>
    <pkg-ref id="com.atera.ateraagent.myapp">
        <must-close>
            <app id="com.atera.ateraagent"/>
        </must-close>
    </pkg-ref>

    <volume-check script="VolumeCheck()"/>

    <script>
        var gCurrentFileLockerVersion = "";

        function VolumeCheck()
        {
            // do not downgrade
            var plist = system.files.plistAtPath("/Applications/MyApp.app/Contents/Info.plist");

            // no FileLocker = install
            if (!plist) {
                return true;
            }

            if (plist.CFBundleShortVersionString &amp;&amp; (system.compareVersions(plist.CFBundleShortVersionString, gCurrentFileLockerVersion) != 1)) {
                return true;
            }

            my.result.message = "A newer version of MyApp is already installed.";
            my.result.type = "Fatal";

            return false;
        }
    </script>
</installer-gui-script>
