<?xml version="1.0" encoding="UTF-8"?>
<installer-script authoringTool="Packages" authoringToolVersion="1.1.1" authoringToolBuild="2B71" minSpecVersion="1.0">
    <options rootVolumeOnly="true" customize="always"/>
    <!--+==========================+
        |       Presentation       |
        +==========================+-->
    <title>DISTRIBUTION_TITLE</title>
    <background file="background" scaling="proportional" alignment="bottomleft"/>
    <readme file="readme.txt"/>
    <license file="license.rtf"/>
    <!--+==========================+
        |         Installer        |
        +==========================+-->
    <choices-outline>
        <line choice="installer_choice_1">
            <line choice="installer_choice_1_1"/>
        </line>
        <line choice="installer_choice_2"/>
        <line choice="installer_choice_3"/>
        <line choice="installer_choice_4"/>
        <line choice="installer_choice_5"/>
        <line choice="installer_choice_6"/>
        <line choice="installer_choice_7"/>
        <line choice="installer_choice_8"/>
        <line choice="installer_choice_9"/>
        <line choice="installer_choice_10"/>
        <line choice="installer_choice_11"/>
        <line choice="installer_choice_12"/>
    </choices-outline>
    <choice id="installer_choice_1_1" start_visible="false" title="chipsounds_Files" description="">
        <pkg-ref id="com.plogue.chipsounds.files.pkg"/>
    </choice>
    <choice id="installer_choice_1" start_visible="false" title="INSTALLER_CHOICE_1_TITLE" description=""/>
    <choice id="installer_choice_2" title="chipsounds_AU" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundsau.pkg"/>
    </choice>
    <choice id="installer_choice_3" start_visible="false" title="chipsounds_Plugins" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundsplugins.pkg"/>
    </choice>
    <choice id="installer_choice_4" title="chipsounds_RTAS" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundsrtas.pkg"/>
    </choice>
    <choice id="installer_choice_5" start_visible="false" title="chipsounds_SA" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundssa.pkg"/>
    </choice>
    <choice id="installer_choice_6" title="chipsounds_VST" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundsvst.pkg"/>
    </choice>
    <choice id="installer_choice_7" start_visible="false" title="AmbiencePlugin" description="">
        <pkg-ref id="com.Plogue.AriaAmbiencePluginpck"/>
    </choice>
    <choice id="installer_choice_8" start_visible="false" title="BasicConvPluginPack" description="">
        <pkg-ref id="com.Garritan.BasicConvPluginPack"/>
    </choice>
    <choice id="installer_choice_9" start_visible="false" title="MDAPluginsPack" description="">
        <pkg-ref id="com.Plogue.MDAPluginspck"/>
    </choice>
    <choice id="installer_choice_10" start_visible="false" title="AriaMain" description="">
        <pkg-ref id="com.Plogue.AriaMainpck"/>
    </choice>
    <choice id="installer_choice_11" start_visible="false" title="chipsounds_Converters" description="">
        <pkg-ref id="com.plogue.chipsounds.converters.pkg"/>
    </choice>
    <choice id="installer_choice_12" start_enabled="installer_choice_12_requirement(false,true)" start_selected="installer_choice_12_requirement(false,false)" title="chipsounds_AAX" description="">
        <pkg-ref id="com.plogue.chipsounds.chipsoundsaax.pkg"/>
    </choice>
    <!--+==========================+
        |    Package References    |
        +==========================+-->
    <pkg-ref id="com.plogue.chipsounds.chipsoundsplugins.pkg" version="1827" auth="Root" installKBytes="1255">#chipsounds_Plugins.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.chipsoundsaax.pkg" version="1800" auth="Root" installKBytes="323">#chipsounds_AAX.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.chipsoundsau.pkg" version="1809" auth="Root" installKBytes="751">#chipsounds_AU.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.files.pkg" version="1877" auth="Root" installKBytes="104076">#chipsounds_Files.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.converters.pkg" version="1601" auth="Root" installKBytes="626">#chipsounds_Converters.pkg</pkg-ref>
    <pkg-ref id="com.Plogue.AriaAmbiencePluginpck" version="1809" auth="Root" installKBytes="139">#AmbiencePlugin.pkg</pkg-ref>
    <pkg-ref id="com.Garritan.BasicConvPluginPack" version="1838" auth="Root" installKBytes="603">#BasicConvPluginPack.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.chipsoundssa.pkg" version="1877" auth="Root" installKBytes="6015">#chipsounds_SA.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.chipsoundsrtas.pkg" version="1773" auth="Root" installKBytes="650">#chipsounds_RTAS.pkg</pkg-ref>
    <pkg-ref id="com.Plogue.AriaMainpck" version="1877" auth="Root" installKBytes="17140">#AriaMain.pkg</pkg-ref>
    <pkg-ref id="com.Plogue.MDAPluginspck" version="1.500" auth="Root" installKBytes="277">#MDAPluginsPack.pkg</pkg-ref>
    <pkg-ref id="com.plogue.chipsounds.chipsoundsvst.pkg" version="1814" auth="Root" installKBytes="1010">#chipsounds_VST.pkg</pkg-ref>
    <!--+==========================+
        |    JavaScript Scripts    |
        +==========================+-->
    <script>

	const __IC_FLAT_DISTRIBUTION__=true;
	const IC_DISK_TYPE_DESTINATION=0;
	const IC_DISK_TYPE_STARTUP_DISK=1;
	const IC_OS_DISTRIBUTION_TYPE_ANY=0;
	const IC_OS_DISTRIBUTION_TYPE_CLIENT=1;
	const IC_OS_DISTRIBUTION_TYPE_SERVER=2;

	function IC_CheckOS(inDiskType,inMustBeInstalled,inMinimumVersion,inDistributionType)
	{
		var tOSVersion=undefined;
		
		/* Check Minimum Version */
		
		if (inDiskType==IC_DISK_TYPE_DESTINATION)
		{
			if (my.target.systemVersion!=undefined)
			{
				tOSVersion=my.target.systemVersion.ProductVersion;
			}
			
			/* Check if no OS is installed on the potential target */
			
			if (tOSVersion==undefined)
			{
				return (inMustBeInstalled==false);
			}
		}
		else
		{
			tOSVersion=system.version.ProductVersion;
		}
		
		if (system.compareVersions(tOSVersion,inMinimumVersion)==-1)
		{
			return false;
		}
		
		/* Check Distribution Type */
		
		if (inDistributionType!=IC_OS_DISTRIBUTION_TYPE_ANY)
		{
			var tIsServer;
			
			if (inDiskType==IC_DISK_TYPE_DESTINATION)
			{
				tIsServer=system.files.fileExistsAtPath(my.target.mountpoint+'/System/Library/CoreServices/ServerVersion.plist');
			}
			else
			{
				tIsServer=system.files.fileExistsAtPath('/System/Library/CoreServices/ServerVersion.plist');
			}
			
			if (inDistributionType==IC_OS_DISTRIBUTION_TYPE_CLIENT &amp;&amp; tIsServer==true)
			{
				return false;
			}
			
			if (inDistributionType==IC_OS_DISTRIBUTION_TYPE_SERVER &amp;&amp; tIsServer==false)
			{
				return false;
			}
		}
		
		return true;
	}

	function installer_choice_12_requirement(inCheckVisibilityOnly,inShowFailedToolTip)
	{
		var tResult;

		tResult=IC_CheckOS(IC_DISK_TYPE_DESTINATION,true,'10.8',IC_OS_DISTRIBUTION_TYPE_ANY);

		if (tResult==false)
		{
			if (inCheckVisibilityOnly==true)
			{
				tResult=true;
			}
		}

		return tResult;
	}

    </script>
</installer-script>