<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="1">
    <options customize="always" allow-external-scripts="false" hostArchitectures="i386,arm64"/>
    <installation-check script="installation_check()"/>
    <volume-check script="volume_check()"/>
    <title>Goodhertz LA-210 B1 v3.14.0</title>
    <background file="bg_ghz_3.14.0.auto.tiff" uti="public.tiff" scaling="none" alignment="bottomleft"/>
    <background-darkAqua file="bg_ghz_dark_3.14.0.auto.tiff" uti="public.tiff" scaling="none" alignment="bottomleft"/>
    <welcome file="welcome.html"/>
    <license file="license.html"/>
    <conclusion file="conclusion.html"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <choices-outline>
        <line choice="com.goodhertz.common.assets.3.14.0"/>
        <line choice="com.goodhertz.common.i18n.3.14.0"/>
        <line choice="com.goodhertz.common.superg105_3"/>
        <line choice="com.goodhertz.pkg.LAB1-VST"/>
        <line choice="com.goodhertz.pkg.LAB1-VST3"/>
        <line choice="com.goodhertz.pkg.LAB1-AAX"/>
        <line choice="com.goodhertz.pkg.LAB1-AU"/>
    </choices-outline>
    <choice id="com.goodhertz.common.assets.3.14.0" start_visible="false" title="Install GhzCommon Assets">
        <pkg-ref id="com.goodhertz.common.assets.3.14.0"/>
    </choice>
    <pkg-ref id="com.goodhertz.common.assets.3.14.0" version="3.14.0" onConclusion="none" installKBytes="1033">#GhzCommon.assets.3.14.0.pkg</pkg-ref>
    <choice id="com.goodhertz.common.i18n.3.14.0" start_visible="false" title="Install GhzCommon i18n">
        <pkg-ref id="com.goodhertz.common.i18n.3.14.0"/>
    </choice>
    <pkg-ref id="com.goodhertz.common.i18n.3.14.0" version="3.14.0" onConclusion="none" installKBytes="1">#GhzCommon.i18n.3.14.0.pkg</pkg-ref>
    <choice id="com.goodhertz.common.superg105_3" start_visible="false" title="Install GhzCommon Superg">
        <pkg-ref id="com.goodhertz.common.superg105_3"/>
    </choice>
    <pkg-ref id="com.goodhertz.common.superg105_3" version="3.14.0" onConclusion="none" installKBytes="43631">#GhzCommon.superg105_3.pkg</pkg-ref>
    <choice id="com.goodhertz.pkg.LAB1-VST" title="LA-210 B1 VST" description="An opto comp, a tape, a soft clip — as free as the freeway (VST plugin format)">
        <pkg-ref id="com.goodhertz.pkg.LAB1-VST"/>
    </choice>
    <pkg-ref id="com.goodhertz.pkg.LAB1-VST" version="3.14.0" onConclusion="none" installKBytes="14087">#GhzLA-2103B1.vst.pkg</pkg-ref>
    <choice id="com.goodhertz.pkg.LAB1-VST3" title="LA-210 B1 VST3" description="An opto comp, a tape, a soft clip — as free as the freeway (VST3 plugin format)">
        <pkg-ref id="com.goodhertz.pkg.LAB1-VST3"/>
    </choice>
    <pkg-ref id="com.goodhertz.pkg.LAB1-VST3" version="3.14.0" onConclusion="none" installKBytes="14316">#GhzLA-2103B1.vst3.pkg</pkg-ref>
    <choice id="com.goodhertz.pkg.LAB1-AAX" title="LA-210 B1 AAX" description="An opto comp, a tape, a soft clip — as free as the freeway (AAX plugin format)">
        <pkg-ref id="com.goodhertz.pkg.LAB1-AAX"/>
    </choice>
    <pkg-ref id="com.goodhertz.pkg.LAB1-AAX" version="3.14.0" onConclusion="none" installKBytes="14420">#GhzLA-2103B1.aaxplugin.pkg</pkg-ref>
    <choice id="com.goodhertz.pkg.LAB1-AU" title="LA-210 B1 AU" description="An opto comp, a tape, a soft clip — as free as the freeway (AU plugin format)">
        <pkg-ref id="com.goodhertz.pkg.LAB1-AU"/>
    </choice>
    <pkg-ref id="com.goodhertz.pkg.LAB1-AU" version="3.14.0" onConclusion="none" installKBytes="14284">#GhzLA-2103B1.component.pkg</pkg-ref>
    <script>

	const __IC_FLAT_DISTRIBUTION__=true;
	const IC_CPU_ARCHITECTURE_APPLESILICON=16777228;
	const IC_CPU_ARCHITECTURE_TYPE_ANY=0;
	const IC_CPU_ARCHITECTURE_TYPE_32=1;
	const IC_CPU_ARCHITECTURE_TYPE_64=2;
	const IC_CPU_ARCHITECTURE_INTEL=7;
	const IC_CPU_ARCHITECTURE_ANY=0;
	const IC_CPU_ARCHITECTURE_POWERPC=18;

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

	function IC_CheckCPU(inMinimumCoresCount,inSupportedArchitecture,inSupportedPowerPCArchitectureType,inSupportedIntelArchitectureType,inMinimumFrequency)
	{
		/* Check Minimum Core Count */
		
		if (system.sysctl('hw.ncpu')&gt;=inMinimumCoresCount)
		{
			var tArchitecture;
			var t64BitSupport;
			var tTranslated;

			tArchitecture=system.sysctl('hw.cputype');

			tTranslated=system.sysctl('sysctl.proc_translated');

			if (tTranslated!=null)
			{
				if (tTranslated==1)
				{
					tArchitecture=IC_CPU_ARCHITECTURE_APPLESILICON;
				}
			}
			
			/* Check Architecture */
			
			if (inSupportedArchitecture!=IC_CPU_ARCHITECTURE_ANY)
			{
				if (inSupportedArchitecture!=tArchitecture)
				{
					return false;
				}
			}
			
			/* Check Architecture Type */
			
			t64BitSupport=system.sysctl('hw.cpu64bit_capable');
			
			if (tArchitecture==IC_CPU_ARCHITECTURE_POWERPC)
			{
				if ((inSupportedPowerPCArchitectureType==IC_CPU_ARCHITECTURE_TYPE_32 &amp;&amp; t64BitSupport==1) ||
					(inSupportedPowerPCArchitectureType==IC_CPU_ARCHITECTURE_TYPE_64 &amp;&amp; t64BitSupport==0))
				{
					return false;
				}
			}
			else if (tArchitecture==IC_CPU_ARCHITECTURE_INTEL)
			{
				if ((inSupportedIntelArchitectureType==IC_CPU_ARCHITECTURE_TYPE_32 &amp;&amp; t64BitSupport==1) ||
					(inSupportedIntelArchitectureType==IC_CPU_ARCHITECTURE_TYPE_64 &amp;&amp; t64BitSupport==0))
				{
					return false;
				}
			}
			
			/* Check Minimum CPU Frequency (hw.cpufrequency_max does not exist on Apple Silicon) */
			
			var tFrequencyMax;
			
			tFrequencyMax=system.sysctl('hw.cpufrequency_max');
			
			if (tFrequencyMax==null || system.sysctl('hw.cpufrequency_max')&gt;=inMinimumFrequency)
			{
				return true;
			}
		}
		
		return false;
	}

	function IC_CheckOS(inDiskType,inMustBeInstalled,inMinimumVersion,inMaximumVersion,inDistributionType)
	{
		var tOSVersion=undefined;
		
		/* Check Version Constraints */
		
		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);
			}
			
			if (inMustBeInstalled==false)
			{
				return false;
			}
		}
		else
		{
			tOSVersion=system.version.ProductVersion;
		}
		
		if (system.compareVersions(tOSVersion,inMinimumVersion)==-1)
			return false;
			
		if (inMaximumVersion!=undefined &amp;&amp;
			system.compareVersions(tOSVersion,inMaximumVersion)==1)
			return false;
		
		/* Check Distribution Type */
		
		if (inDistributionType!=IC_OS_DISTRIBUTION_TYPE_ANY)
		{
			var tIsServer;
			
			if (system.compareVersions(tOSVersion,'10.8.0')==-1)
			{
				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');
				}
			}
			else
			{
				if (inDiskType==IC_DISK_TYPE_DESTINATION)
				{
					tIsServer=system.files.fileExistsAtPath(my.target.mountpoint+'/Applications/Server.app');
				}
				else
				{
					tIsServer=system.files.fileExistsAtPath('/Applications/Server.app');
				}
			}
			
			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 installation_check()
	{
		var tResult;

		tResult=IC_CheckCPU(1,IC_CPU_ARCHITECTURE_ANY,IC_CPU_ARCHITECTURE_TYPE_64,IC_CPU_ARCHITECTURE_TYPE_64,866666);

		if (tResult==false)
		{
			my.result.title = system.localizedString('REQUIREMENT_FAILED_MESSAGE_INSTALLATION_CHECK_1');
			my.result.message = system.localizedString('REQUIREMENT_FAILED_DESCRIPTION_INSTALLATION_CHECK_1');
			my.result.type = 'Fatal';
		}

		return tResult;
	}

	function volume_check()
	{
		var tResult;

		tResult=IC_CheckOS(IC_DISK_TYPE_DESTINATION,true,'10.13',undefined,IC_OS_DISTRIBUTION_TYPE_ANY);

		if (tResult==false)
		{
			my.result.message = system.localizedString('REQUIREMENT_FAILED_MESSAGE_VOLUME_CHECK_2');
			my.result.type = 'Fatal';
		}

		return tResult;
	}

    </script>
    <pkg-ref id="com.goodhertz.common.assets.3.14.0">
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.common.i18n.3.14.0">
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.common.superg105_3">
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.pkg.LAB1-VST">
        <bundle-version>
            <bundle CFBundleShortVersionString="3.14.0" CFBundleVersion="3.14.0" id="com.goodhertz.ghz0049B1" path="Ghz LA-210 3 B1.vst"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.pkg.LAB1-VST3">
        <bundle-version>
            <bundle CFBundleShortVersionString="3.14.0" CFBundleVersion="3.14.0" id="com.goodhertz.ghz0049B1" path="Ghz LA-210 3 B1.vst3"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.pkg.LAB1-AAX">
        <bundle-version>
            <bundle CFBundleShortVersionString="3.14.0" CFBundleVersion="3.14.0" id="com.goodhertz.ghz0049B1" path="Ghz LA-210 3 B1.aaxplugin"/>
            <bundle CFBundleShortVersionString="5.10.5 GM (b5356, c55e8d80)" CFBundleVersion="5.10.5.5356" id="com.paceap.eden.dsig.bundle" path="Ghz LA-210 3 B1.aaxplugin/Contents/__Pace_Eden.bundle"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.goodhertz.pkg.LAB1-AU">
        <bundle-version>
            <bundle CFBundleShortVersionString="3.14.0" CFBundleVersion="3.14.0" id="com.goodhertz.ghz0049B1" path="Ghz LA-210 3 B1.component"/>
        </bundle-version>
    </pkg-ref>
</installer-gui-script>