<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <options customize='never'/>
    <options hostArchitectures='i386'/>
    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>
    <title>SU_TITLE</title>
    <welcome file='SUDescription.html'/>
    <license file='License.rtf' sla='EA0325'/>
    <background file='background.tif' alignment='bottomleft' scaling='none'/>
    <!-- manual choices -->
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <!-- SU choices -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='manual'>
        <pkg-ref auth='Root' id='manual' onConclusion='RequireRestart'>#10.5.8AirPortUpdate1.0.pkg</pkg-ref>
    </choice>
    <choice id='su' suDisabledGroupID='10.5.8AirPortUpdate1.0'>
        <pkg-ref id='auto' auth='Root' onConclusion='RequireRestart'>10.5.8AirPortUpdate1.0.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' secondaryDescription='SU_SERVERCOMMENT'/>
    <choice id='su' visible='isVisible()'/>
    <volume-check script='VolumeCheck()'/>
    <installation-check script='InstallationCheck()'/>
    <script>

      function VolumeCheck()
      {
        // must have an OS
        if(! system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist")) {
           my.result.type = 'Fatal';
          my.result.message = system.localizedStringWithFormat('ERR_OS', '10.5.8');
          return (false);
        }

       	// 10.5.8+
        if(-1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.5.8')) {
        	my.result.type = 'Fatal';
        	my.result.message = system.localizedStringWithFormat('ERR_OS', '10.5.8');
            return (false);
        }
		
		// 10.6+ not allowed
        if(-1 != system.compareVersions(my.target.systemVersion.ProductVersion, '10.6.0')) {
        	my.result.type = 'Fatal';
        	my.result.message = system.localizedString('ERR_REQ');
            return (false);
        }	

		if (isServer()) {
			my.result.type = 'Fatal';
            my.result.message = system.localizedStringWithFormat('ERR_OS', '10.5.8');
            return (false);
		}
		
        return true;
    }
	
	function InstallationCheck()
	{
        if ( !isValidMachine() ) {
            my.result.message = system.localizedStringWithFormat('ERR_HW');
            my.result.type = 'Fatal';
            return false;	       
        }
        
        return true;	   
	}

	function isServer() {
			if(!my.target['systemVersion'].isServer){
				return false;
			}
          	return true;
    }
    
	function isValidMachine()
    {
        var property = system.sysctl("hw.model");
        if (property &amp;&amp; (property == "MacBookPro4,1") || (property == "MacBook3,1") || (property == "MacBook4,1") ) {
            return true;
        }
        
        return false;
    }

    function isVisible()
    {
      var plist = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AppleAirPortBrcm4311.kext/Contents/Info.plist");

      if ( plist &amp;&amp; (-1 != system.compareVersions(plist.CFBundleShortVersionString, '3.6.6')) ) {
        return false;
      }
		
      return true;
    }
    
  </script>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie klienta AirPort dla MacBooka oraz MacBooka Pro";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich.";

"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>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="949.33">
  <style type="text/css">
    p {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande}
	ul {list-style-type:none; margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande}
  </style>
</head>
<body>
<p>	To uaktualnienie jest zalecane dla niektórych modeli Macintosha z procesorem Intel, pracujących z systemem Mac OS X 10.5.8. Rozwiązuje problem wydajności AirPort podczas pracy na baterii. Może być instalowane tylko na poniższych modelach:</p>
<p><br/></p>
		<ul><li>MacBook (13-calowy, model z końca 2007 roku)</li>
		<li>MacBook (13-calowy, model z początku 2008 roku)</li>
		<li>MacBook (13-calowy, model z końca 2008 roku)</li>
		<li><br/></li>
		<li>MacBook Pro (15-calowy, model z początku 2008 roku)</li>
		<li><br/></li>
		<li>MacBook Pro (17-calowy, model z początku 2008 roku)</li>
		<li>MacBook Pro (17-calowy, model z końca 2008 roku)</li></ul>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='auto' installKBytes='3806' version='1.0.1.1191932192'/>
</installer-gui-script>