<?xml version="1.0" encoding="UTF-8"?>
<installer-script authoringTool="Packages" authoringToolVersion="1.1.3" authoringToolBuild="2B112" minSpecVersion="1">
    <options rootVolumeOnly="true"/>
    <installation-check script="installation_check()"/>
    <!--+==========================+
        |       Presentation       |
        +==========================+-->
    <title>DISTRIBUTION_TITLE</title>
    <background file="background" scaling="tofit" alignment="center"/>
    <welcome file="welcome.rtfd"/>
    <readme file="readme.rtfd"/>
    <license file="license.rtf"/>
    <!--+==========================+
        |         Installer        |
        +==========================+-->
    <choices-outline>
        <line choice="installer_choice_1"/>
        <line choice="installer_choice_2"/>
    </choices-outline>
    <choice id="installer_choice_1" title="Apps Only" description="">
        <pkg-ref id="com.triprism.pkg.TEPSOSXShareApps"/>
    </choice>
    <choice id="installer_choice_2" title="Folders Only" description="">
        <pkg-ref id="com.triprism.pkg.TEPSOSXShareFolders"/>
    </choice>
    <!--+==========================+
        |    Package References    |
        +==========================+-->
    <pkg-ref id="com.triprism.pkg.TEPSOSXShareFolders" version="17" auth="Root" installKBytes="79716">#Folders%20Only.pkg</pkg-ref>
    <pkg-ref id="com.triprism.pkg.TEPSOSXShareApps" version="17.10.11" auth="Root" installKBytes="212219">#Apps%20Only.pkg</pkg-ref>
    <!--+==========================+
        |    JavaScript Scripts    |
        +==========================+-->
    <script>

	const __IC_FLAT_DISTRIBUTION__=false;
	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 (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_CheckOS(IC_DISK_TYPE_STARTUP_DISK,true,'10.5',IC_OS_DISTRIBUTION_TYPE_ANY);

		if (tResult==false)
		{
			my.result.title = system.localizedStandardStringWithFormat('InstallationCheckError', system.localizedString('DISTRIBUTION_TITLE'));
			my.result.message = ' ';
			my.result.type = 'Fatal';
		}

		if (tResult==true)
		{
			tResult=IC_CheckOS(IC_DISK_TYPE_STARTUP_DISK,true,'10.6.5',IC_OS_DISTRIBUTION_TYPE_ANY);

			if (tResult==false)
			{
				my.result.title = system.localizedStandardStringWithFormat('InstallationCheckError', system.localizedString('DISTRIBUTION_TITLE'));
				my.result.message = ' ';
				my.result.type = 'Fatal';
			}
		}

		return tResult;
	}

    </script>
    <pkg-ref id="com.triprism.pkg.TEPSOSXShareApps">
        <bundle-version>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0016Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0016 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0013Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0013 Module.bundle"/>
            <bundle CFBundleShortVersionString="4.14.1 (ForTepsXShare)" id="com.triprism.TepsPrintCenterShare" path="Applications/TEPS OS X Share Folder/TEPS-PRINT CENTER Share.app"/>
            <bundle CFBundleShortVersionString="3.0.1.3002" CFBundleVersion="3.0.1" id="jp.co.nikon.D1Module" path="Library/Application Support/Nikon/Camera Control Modules/D1 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.10" CFBundleVersion="1.0.10" id="com.triprism.tepsDataBurn" path="Applications/TEPS OS X Share Folder/Teps-DataBurn.app"/>
            <bundle CFBundleShortVersionString="v17.10.11 ubc" CFBundleVersion="v17.10.11 ubc" id="com.triprism.tepsprocessor share" path="Applications/TEPS OS X Share Folder/Teps-Processor Share.app"/>
            <bundle CFBundleShortVersionString="1.0.0.3001" CFBundleVersion="2.10.0" id="jp.co.nikon.Type0007Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0007 Module.bundle"/>
            <bundle CFBundleShortVersionString="2.0.1.3001" CFBundleVersion="2.0.1" id="jp.co.nikon.D100Module" path="Library/Application Support/Nikon/Camera Control Modules/D100 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="2.8.0" id="jp.co.nikon.Type0004Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0004 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0015Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0015 Module.bundle"/>
            <bundle CFBundleShortVersionString="2.0.2.3005" CFBundleVersion="2.0.2" id="jp.co.nikon.D70Module" path="Library/Application Support/Nikon/Camera Control Modules/D70 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.5.0.3001" CFBundleVersion="2.8.0" id="jp.co.nikon.Type0001Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0001 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0012Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0012 Module.bundle"/>
            <bundle CFBundleVersion="1.0" id="com.triprism.Teps-HttpUploader" path="Applications/TEPS OS X Share Folder/Teps-HttpUploader.app"/>
            <bundle CFBundleShortVersionString="CPDImageFilter Ver.6.0.0, COPYRIGHT(C) 2005 (2006,2007,2009,2010,2013) MITSUBISHI ELECTRIC CORPORATION ALL RIGHTS RESERVED" CFBundleVersion="6.0.0" SourceVersion="10000" BuildVersion="100" id="com.mitsubishi.CPDImageFilter" path="Library/Frameworks/CPDImageFilter.framework"/>
            <bundle CFBundleShortVersionString="1.0.2.3005" CFBundleVersion="1.0.2" id="jp.co.nikon.D80Module" path="Library/Application Support/Nikon/Camera Control Modules/D80 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3003" CFBundleVersion="2.11.0" id="jp.co.nikon.Type0006Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0006 Module.bundle"/>
            <bundle CFBundleShortVersionString="2.0.2.3005" CFBundleVersion="2.0.2" id="jp.co.nikon.D2Module" path="Library/Application Support/Nikon/Camera Control Modules/D2 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0009Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0009 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.2.0.3000" CFBundleVersion="1.2.0" id="jp.co.nikon.Type0014Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0014 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.2.3001" CFBundleVersion="2.7.0" id="jp.co.nikon.Type0003Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0003 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.2.0.3000" CFBundleVersion="2.1.0" id="jp.co.nikon.D40Module" path="Library/Application Support/Nikon/Camera Control Modules/D40 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0017Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0017 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0011Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0011 Module.bundle"/>
            <bundle CFBundleShortVersionString="2.0.2.3005" CFBundleVersion="2.0.2" id="jp.co.nikon.D200Module" path="Library/Application Support/Nikon/Camera Control Modules/D200 Module.bundle"/>
            <bundle CFBundleShortVersionString="3.14.15.0" CFBundleVersion="3.14.15.0" id="com.canon.frameworks.DPP" path="Library/Frameworks/DPP.framework"/>
            <bundle CFBundleShortVersionString="3.2.20.1" CFBundleVersion="3.2.20.1" id="com.canon.EdsImage" path="Library/Frameworks/EDSDK.framework/Versions/Current/EdsImage.bundle"/>
            <bundle CFBundleVersion="0.1" id="com.triprism.TepsBarcode" path="Applications/TEPS OS X Share Folder/Teps-Barcode.app"/>
            <bundle CFBundleVersion="10.9sdk131" id="com.triprism.Teps_FlashWriter" path="Applications/TEPS OS X Share Folder/Teps-FlashWriter.app"/>
            <bundle CFBundleShortVersionString="2.0.2.3005" CFBundleVersion="2.0.2" id="jp.co.nikon.D50Module" path="Library/Application Support/Nikon/Camera Control Modules/D50 Module.bundle"/>
            <bundle CFBundleShortVersionString="v17.10.11 ubc" CFBundleVersion="v17.10.11" id="com.triprism.tepsxSHARE" path="Applications/TEPS OS X Share Folder/TEPS-X Share.app"/>
            <bundle CFBundleShortVersionString="1.2.0.3000" CFBundleVersion="1.2.0" id="jp.co.nikon.Type0008Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0008 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="2.4.0" id="jp.co.nikon.Type0002Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0002 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3001" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0019Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0019 Module.bundle"/>
            <bundle CFBundleShortVersionString="3.2.20.2" CFBundleVersion="3.2.20.2" id="com.canon.edsdk" path="Library/Frameworks/EDSDK.framework"/>
            <bundle CFBundleShortVersionString="1.0.0 (Build 2)" CFBundleVersion="1.1.1" id="com.kodak.dcs.KPDCFamily" path="Library/Application Support/Kodak DCS SBP2 Family.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3000" CFBundleVersion="2.9.0" id="jp.co.nikon.Type0005Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0005 Module.bundle"/>
            <bundle CFBundleShortVersionString="1.0.0.3002" CFBundleVersion="1.0.0" id="jp.co.nikon.Type0010Module" path="Library/Application Support/Nikon/Camera Control Modules/Type0010 Module.bundle"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.triprism.pkg.TEPSOSXShareFolders">
        <bundle-version/>
    </pkg-ref>
</installer-script>