<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script>
	function needsRecoveryHDUpdate(){
		var baseSystemInPackage = "11C74";
		var baseSystemInstalled = my.target.recoverySystemVersion.ProductBuildVersion;
		if(system.compareVersions( baseSystemInstalled, baseSystemInPackage ) &lt; 0){
				return true;
		}
		return false;
	}

function myVolCheck() {

	if(!needsRecoveryHDUpdate()){
		my.result.message = system.localizedString('ERROR_INSTALL');
		my.result.type = 'Fatal';
		return false;
	}
	
	return true;
	
}

</script>
    <volume-check script="VolumeCheck()"/>
    <options type="firmware"/>
    <script>
function VolumeCheck(prefix) {
	if (system.env.OS_INSTALL == 1) return true;
	var hasOS = system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist");
	if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.7') &lt; 0 || system.compareVersions(my.target.systemVersion.ProductVersion, '10.8') >= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_1');
	if (!Script0(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function Script0(prefix) {
	if (!myVolCheck()) {
		return false;
	}
	return true;
}
function Not1(prefix) {
	if (!(Script2(prefix))) {
		return true;
	}
	return false;
}
function Script2(prefix) {
	if (!my.target.receiptForIdentifier('com.apple.pkg.RecoveryHDUpdate')) {
		return false;
	}
	return true;
}
</script>
    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>
    <choices-outline ui="SoftwareUpdate">
        <line choice="su"/>
    </choices-outline>
    <choices-outline>
        <line choice="su"/>
    </choices-outline>
    <choice id="su" title="SU_TITLE" versStr="SU_VERS" description="SU_DESCRIPTION" description-mime-type="text/html" secondaryDescription="SU_SERVERCOMMENT" suDisabledGroupID="Lion Recovery Update" start_selected="true" visible="Not1('/')">
        <pkg-ref id="RecoveryHDUpdate" auth="Root" packageIdentifier="com.apple.pkg.RecoveryHDUpdate">RecoveryHDUpdate.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie trybu odzyskiwania systemu Lion";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = " ";
"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>Uaktualnienie trybu odzyskiwania systemu Lion zawiera poprawki tego trybu oraz rozwiązuje problem dotyczący usługi Znajdź mój Mac w przypadku używania hasła sprzętowego.</p><br>
<p>Szczegółowe informacje na temat tego uaktualnienia można znaleźć pod adresem: <a href="http://support.apple.com/kb/HT4986?viewlocale=pl_PL">http://support.apple.com/kb/HT4986?viewlocale=pl_PL</a>.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='RecoveryHDUpdate' installKBytes='71' version='1.0.1.1306847324'/>
</installer-gui-script>
