<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<installer-gui-script minSpecVersion='1'>
    <options customize='never'/>
    <options hostArchitectures='i386,ppc'/>
    <platforms>
        <client arch="i386,ppc"/>
        <server arch="i386,ppc"/>
    </platforms>
    <title>SU_TITLE</title>
    <!-- Lion App Closing -->
    <pkg-ref id='com.apple.pkg.AirMacUtility'>
        <must-close>
            <app id="com.apple.airport.airportutility"/>
            <app id="com.apple.airport.airportutility56"/>
        </must-close>
    </pkg-ref>
    <pkg-ref id='a'>
        <must-close>
            <app id="com.apple.airport.airportutility"/>
            <app id="com.apple.airport.airportutility56"/>
        </must-close>
    </pkg-ref>
    <!-- manual choices -->
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choice id='manual'>
        <pkg-ref auth='Root' id='com.apple.pkg.AirMacUtility'>#AirMacUtility.pkg</pkg-ref>
    </choice>
    <!-- SU choices -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='su' suDisabledGroupID='AirMacUtility'>
        <pkg-ref id='a' auth='Root'>AirMacUtility.pkg</pkg-ref>
    </choice>
    <choice id='su' title='SU_TITLE' versStr='SU_VERS'/>
    <choice id='su' description='SU_DESCRIPTION' description-mime-type='text/html'/>
    <choice id='su' visible='isVisible()'/>
    <volume-check script='volumeCheck()'/>
    <script>
		var updateName = "AirPortUtilityUpdate";
        function volumeCheck()
        {
            // must have an OS
            debuglog("Checking for presence of Mac OS X.");
            if(! system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist")) {
                debuglog("No OS detected!");
                my.result.type = 'Fatal';
                my.result.message = system.localizedString('ERR_OSLOW');
                return (false);
            }

            // 10.7.5+
            debuglog("Checking for presence of Mac OS X less than 10.7.5.");
            if(-1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.7.5')) {
                debuglog("Detected Mac OS X less than 10.7.5!");
				my.result.type = 'Fatal';
                my.result.message = system.localizedString('ERR_OSLOW');
                return (false);
            }

			// Update not eligible for systems at Mac OS X 10.8.
            debuglog("Checking for presence of Mac OS X at 10.8.");
			if(0 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.8'))
			    {
			            debuglog("Detected Mac OS X 10.8!");
						my.result.message = system.localizedString('ERR_OSHIGH1');
			            my.result.type = 'Fatal';
			            return false;
			    }

			// Update not eligible for systems at Mac OS X 10.8.1.
            debuglog("Checking for presence of Mac OS X at 10.8.1.");
			if(0 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.8.1'))
			    {
			            debuglog("Detected Mac OS X 10.8.1!");
			            my.result.message = system.localizedString('ERR_OSHIGH1');
			            my.result.type = 'Fatal';
			            return false;
			    }

			// Update not eligible for systems at Mac OS X 10.8.2.
			debuglog("Checking for presence of Mac OS X at 10.8.2.");
			if(0 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.8.2'))
			    {
					    debuglog("Detected Mac OS X 10.8.2!");
			            my.result.message = system.localizedString('ERR_OSHIGH1');
			            my.result.type = 'Fatal';
			            return false;
			    }

			// Update not eligible for systems at Mac OS X 10.8.3.
//			if(0 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.8.3'))
//			    {
//			            debuglog("Detected Mac OS X 10.8.3!");
//			            my.result.message = system.localizedString('ERR_OSHIGH1');
//			            my.result.type = 'Fatal';
//			            return false;
//			    }
			
			// Less than 10.10
			debuglog("Checking for presence of Mac OS X less than 10.10.");
            if(-1 != system.compareVersions(my.target.systemVersion.ProductVersion, '10.10')) {
                debuglog("Detected Mac OS X greater than or equal to 10.10!");
				my.result.type = 'Fatal';
                my.result.message = system.localizedString('ERR_OSHIGH');
                return (false);
            }

            // must not have newer version of APU
            debuglog("Checking for presence of APU greater than 6.3.1.");
            var plist = system.files.plistAtPath(my.target.mountpoint + '/Applications/Utilities/AirPort Utility.app/Contents/Info.plist');
            if (plist &amp;&amp; (1 == system.compareVersions(plist.CFBundleShortVersionString, "6.3.1"))) {
                debuglog("Detected a version of AirPort Utility greater than 6.3.1!");
                my.result.type = 'Fatal';
                my.result.message = system.localizedString('ERR_NEWER');
                return (false);
            }

            // must not have tier3 loc
            //if(true == system.files.fileExistsAtPath(my.target.mountpoint + "/var/db/.AppleTier3Language")) {
            //    my.result.type = 'Fatal';
            //    my.result.message = system.localizedString('ERR_TIER3');
            //    return (false);
            //}

            return(true);
        }

        function isVisible()
        {
            // must have AirMac Utility less than 6.3.1
            debuglog("Checking for presence of APU greater than 6.3.1.");
            var plist = system.files.plistAtPath('/Applications/Utilities/AirPort Utility.app/Contents/Info.plist');
            if (!plist) {
                return (false);
            }

            if (plist &amp;&amp; (-1 != system.compareVersions(plist.CFBundleShortVersionString, '6.3.1'))) {
                return false;
            }

			// 10.7.5+
			if(-1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.7.5')) {
			    return false;
			}

            // display update only if system language is japanese
            debuglog("Checking for running language. Display only for Japanese.");
            var appleLanguages = system.defaults['AppleLanguages'];
            if(appleLanguages &amp;&amp; (appleLanguages.length != 0) &amp;&amp; ((appleLanguages[0] == 'Japanese') || (appleLanguages[0] == 'ja'))) {
                return true;
            }
            debuglog("Display only for Japanese. Running Language: appleLanguages[0]");

            return false;
        }

		function debuglog(message)
		{
			// yes, this is secure
			if (system.files.fileExistsAtPath("/tmp/com.apple.pkg.testing")) system.log("********** " + updateName + ": " + message);
		}
    </script>
    <welcome file='ReadMe.rtf'/>
    <license file='License.rtf' sla="EA0998"/>
    <background file='background.tif' alignment='bottomleft' scaling='none'/>
    <localization>
        <strings language="pl"><![CDATA["SU_SERVERCOMMENT" = "Dla systemów klienckich oraz serwerów";
"SU_TITLE" = "Narzędzie AirPort";
"SU_VERS" = "6.3.1";

"SU_DESCRIPTION"='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	  <meta http-equiv="Content-Style-Type" content="text/css">
	  <title></title>
	  <style type="text/css">
		body {font: 11.0px Lucida Grande;}
	    p {margin: 0.0px 0.0px 0.0px 0.0px;}
	  </style>
</head>
<body>
	<p class="p1"><b>Narzędzie AirPort 6.3.1 dla Maca</b></p>
	<br />
	<p class="p1">Narzędzie AirPort służy do konfigurowania i zarządzania stacjami bazowymi AirPort 802.11n i 802.11ac, takimi jak AirPort Express, AirPort Extreme i AirPort Time Capsule. Narzędzie AirPort 6.3.1 rozwiązuje problem, który mógł powodować, że stacje bazowe AirPort nie były widoczne w Narzędziu AirPort.</p>
	
	<p class="p1">Aby uzyskać najnowsze informacje dotyczące oprogramowania AirPort, wybierz Uaktualnienia programów w Preferencjach systemowych lub zajrzyj na witrynę Apple z materiałami do pobrania: <a href="http://support.apple.com/pl_PL/downloads/">http://support.apple.com/pl_PL/downloads/</a>.</p>
	<br />
	<p class="p1">Aby dowiedzieć się więcej o urządzeniach Wi-Fi firmy Apple, zobacz: <a href="http://www.apple.com/pl/wifi/">http://www.apple.com/pl/wifi/</a>.</p>
	<p class="p1">Aby dowiedzieć się więcej o korzystaniu z produktów AirPort, zajrzyj na witrynę wsparcia produktu: <a href="http://www.apple.com/pl/support/airport/">http://www.apple.com/pl/support/airport/</a>.</p>
</body>
</html>';
]]></strings>
    </localization>

	<pkg-ref id='a' installKBytes='44342' version='6.3.1.0.1.1245777430'/>
</installer-gui-script>