<?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'/>
    <conclusion file="Conclusion.rtf"/>
    <license file="License.rtf" sla="EA0325"/>
    <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'>#MacProEFIUpdate.pkg</pkg-ref>
    </choice>
    <choice id='su' suDisabledGroupID='MacProFirmwareUpdate'>
        <pkg-ref auth='Root' id='su'>MacProEFIUpdate.pkg</pkg-ref>
    </choice>
    <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;
		}

		my.result.message = system.localizedStringWithFormat('ERR_OS', '10.5.8');
		if ( !hasOS() || !hasOSVer() ) {
			my.result.type = 'Fatal';
			return false;
		}

		return true;
	}

	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.8')) {
			my.result.message = system.localizedStringWithFormat('ERR_OS', '10.5.8');
			return false;
		}
		
		if (system.compareVersions(my.target.systemVersion.ProductVersion, '10.6') >= 0) {
			if (system.compareVersions(my.target.systemVersion.ProductVersion, '10.6.2') == -1) {
				my.result.message = system.localizedStringWithFormat('ERR_OS', '10.6.2');
				return false;
			}
		}
		
		return true;
	}

	var validEFIVersions = [
		'MP41.88Z.0081.B00.0902051328',
		'MP41.88Z.0081.B01.0902200831',
		'MP41.88Z.0081.B02.0902221922',
		'MP41.88Z.0081.B03.0902231259',
		'MP41.88Z.0081.B04.0903051113',
	];

	function hasValidEFI() {
		var obj = system.ioregistry.fromPath("IODeviceTree:/rom@0");
		if (obj) {
			var property = obj.version;
			if (!property) { return false; };
			
			for (var i = 0; i &lt; validEFIVersions.length; i = i + 1) {
				if (validEFIVersions[i] == property) {
					return true;
				}
			}
			
			return false;
		}
		
		return false;
    }

	var validMachineVersions = [
		'MacPro4,1',
	];
	function isValidMachine() {
		var property = system.sysctl("hw.model");
		if (!property) { return false; };

		for (var i = 0; i &lt; validMachineVersions.length; i = i + 1) {
			if (validMachineVersions[i] == property) {
				return true;
			}
		}

		return false;
	}
        
	</script>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie oprogramowania sprzętowego EFI Maca Pro";
"SU_VERS" = "1.4";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich.";

"SU_DESCRIPTION"='<HTML><!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: 11px "Lucida Grande";}
  </style>
</head>
<body>
<p>To uaktualnienie rozwiązuje następujące problemy z Makami Pro (z początki 2009 roku):
<ul><li>problemy ze zgodnością z rozwiązaniami wirtualizacji bazującymi na VT-d,</li>
<li>problemy ze zgodnością z systemem Windows XP dla użytkowników programu Boot Camp,</li>
<li>problemy z niezawodnością w czasie uruchamiania systemu.</li>
</ul></p>
<p>
Aby uaktualnić oprogramowanie sprzętowe, postępuj zgodnie z instrukcjami programu uaktualniającego (/Programy/Narzędzia/Uaktualnienie oprogramowania sprzętowego EFI Maca Pro.app). Program uaktualniający zostanie uruchomiony automatycznie po zamknięciu Instalatora.
</p>
<p>
Więcej informacji o uaktualnieniach oprogramowania sprzętowego Maków z procesorem Intel można znaleźć pod adresem: <a href="http://support.apple.com/kb/HT1557?viewlocale=pl_PL">http://support.apple.com/kb/HT1557?viewlocale=pl_PL1557</a>.
</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='su' installKBytes='5121' version='1.4.1.1262649589'/>
</installer-gui-script>