<?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'/>
    <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'>.</pkg-ref>
    </choice>
    <choice id='su' suDisabledGroupID='AirPortExtremeUpdate2008002'>
        <pkg-ref id='auto' auth='Root' onConclusion='RequireRestart'>AirPortExtremeUpdate2008002.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()'/>
    <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.localizedString('ERR_OS');
          return (false);
        }

        // 10.4.11 only
        if( my.target.systemVersion.ProductVersion != '10.4.11' ) {
          my.result.type = 'Fatal';
          my.result.message = system.localizedString('ERR_OS');
          return (false);
        }

        var plist = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/version.plist");
				// Atheros kext
        var plistA = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext/Contents/Info.plist");
        // Broadcomm kext
        var plistB = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AppleAirPortBrcm4311.kext/Contents/Info.plist");
				
        // at least one kext must exist
        if ( !plist || (!plistA &amp;&amp; !plistB) ) {
          my.result.type = 'Fatal';
          my.result.message = system.localizedString('ERR_REQ');
          return (false);
        } 
			
        // kext CFBundleVersions must be greater/equal than to 236/232 and less than 245
        if ( plistA &amp;&amp;
            ((-1 == system.compareVersions(plistA.CFBundleVersion, '236')) ||
             (-1 != system.compareVersions(plistA.CFBundleVersion, '245'))) ) {
          my.result.type = 'Fatal';
          my.result.message = system.localizedString('ERR_REQ');
          return (false);
        }
        if ( plistB &amp;&amp;
            ((-1 == system.compareVersions(plistB.CFBundleVersion, '232')) ||
             (-1 != system.compareVersions(plistB.CFBundleVersion, '245'))) ) {
          my.result.type = 'Fatal';
          my.result.message = system.localizedString('ERR_REQ');
          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()
    {
      plistA = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext/Contents/Info.plist");
      plistB = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AppleAirPortBrcm4311.kext/Contents/Info.plist");
     
      // Atheros: if present, must be less than 244
      if ( plistA &amp;&amp; (-1 != system.compareVersions(plistA.CFBundleVersion, '244')) ) {
        return false;
      }

      // Broadcomm: if present, must be less than 244
      if ( plistB &amp;&amp; (-1 != system.compareVersions(plistB.CFBundleVersion, '244')) ) {
        return false;
      }

      return true;
    }
    
  </script>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie AirPort Extreme 2008-002";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla komputerów stacjonarnych oraz serwerów.";

"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.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande}
  </style>
</head>
<body>
<p class="p1">To uaktualnienie jest zalecane dla wszystkich komputerów Macintosh z procesorem Intel i systemem Mac OS 10.4.11. Uaktualnienie poprawia niezawodność połączeń AirPort oraz zgodność z programami Logic, MainStage, GarageBand i innymi.</p>
</body>
</html>
';
]]></strings>
    </localization>
</installer-gui-script>