<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>
    <title>SU_TITLE</title>
    <options hostArchitectures='i386' customize='never' rootVolumeOnly='true'/>
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='manual' title='SU_TITLE' versStr='SU_VERS'>
        <pkg-ref auth='Root' id='manual'>#MacBookAirFirmwareUpdate.pkg</pkg-ref>
    </choice>
    <choice id='su' suDisabledGroupID='MacBookFirmwareUpdate'>
        <pkg-ref auth='Root' id='su'>MacBookAirFirmwareUpdate.pkg</pkg-ref>
    </choice>
    <choice id='su' visible='VisibleCheck()'/>
    <choice id='su' start_selected='true'/>
    <choice id='su' title='SU_TITLE' versStr='SU_VERS'/>
    <choice id='su' description='SU_DESCRIPTION' description-mime-type='text/html'/>
    <installation-check script='InstallationCheck()'/>
    <volume-check script='VolumeCheck()'/>
    <script>
	
	function InstallationCheck()
	{
        if ( !isValidMachine() || !hasValidEFI() ) {
            my.result.message = system.localizedStringWithFormat('ERR_HW');
            my.result.type = 'Fatal';
            return false;	       
        }
        
        return true;	   
	}
	
	function VolumeCheck()
	{
        if (system.env.OS_INSTALL == 1) {
            return true;
        }

        if ( !hasOS() || !hasOSVer() ) {
            my.result.message = system.localizedStringWithFormat('ERR_OS');
            my.result.type = 'Fatal';
            return false;	       
        }
        
        if ( hasTier3() ) {
            my.result.message = system.localizedStringWithFormat('ERR_T3');
            my.result.type = 'Fatal';
            return false;	       
        }
        
        if ( !isNotDowngrade() ) {
            my.result.message = system.localizedStringWithFormat('ERR_HW');
            my.result.type = 'Fatal';
            return false;	       
        }
        
        return true;
	}

    function VisibleCheck()
	{
        return ( hasValidEFI() &amp;&amp; isValidMachine() );
    }

    function hasOS()
    {
        return (system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist"));
    }

    function hasOSVer()
    {
        if (-1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.5.2')) {
            return false;
        }
        return true;
    }
    
    function hasTier3()
    {
        return (system.files.fileExistsAtPath(my.target.mountpoint + "/var/db/.AppleTier3Language"));
    }
    
    function hasValidEFI()
    {
        var obj = system.ioregistry.fromPath("IODeviceTree:/rom@0");
        if (obj) {
            var property = obj.version;
            if (property &amp;&amp;
                ((property == "MBA11.88Z.00BB.B00.0712201139"))) {
				return true;
			}
        }    
        
        return false;
    }

    function isValidMachine()
    {
        var property = system.sysctl("hw.model");
        if (property &amp;&amp; (property == "MacBookAir1,1")) {
            return true;
        }
        
        return false;
    }
        
    function isNotDowngrade()
    {
        var action = null;
        if (choices.manual) {
            action = choices.manual.packageUpgradeAction;
        }
        else {
            action = choices.su.packageUpgradeAction;
        }
        
        if ((action == 'downgrade') || (action == 'mixed')) {
            return false;
        }
        
        return true;
    }
	
	</script>
    <conclusion file="Conclusion.rtf"/>
    <license file="License.rtf" sla="EA0325"/>
    <background file="background.tif"/>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie oprogramowania sprzętowego MacBook Air EFI";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla komputerów biurkowych i 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.27">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande; min-height: 13.0px}
    span.s1 {text-decoration: underline ; color: #0016e6}
  </style>
</head>
<body>
<p class="p1">To uaktualnienie naprawia kilka zagadnień zwiększających stabilność komputerów MacBook Air.</p>
<p class="p2"><br></p>
<p class="p1">Po pomyślnym zainstalowaniu oprogramowania sprzętowego w komputerze wersją Boot ROM będzie:</p>
<p class="p1">MBA11.00BB.B03</p>
<p class="p2"><br></p>
<p class="p1">Nową wersję Boot ROM zainstalowaną w twoim komputerze można potwierdzić w programie Profil systemu.</p>
<p class="p2"><br></p>
<p class="p1">Więcej informacji o tym uaktualnieniu można znaleźć pod adresem: <a href="http://www.info.apple.com/kb/HT1244?viewlocale=pl_PL"><span class="s1">http://www.info.apple.com/kb/HT1244?viewlocale=pl_PL</span></a></p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='su' installKBytes='5040' version='1.0.1.1207265211'/>
</installer-gui-script>