<?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 = "15C50";

	if( my.target.recoverySystemVersion ) {
	    if (system.compareVersions( my.target.recoverySystemVersion.ProductBuildVersion, baseSystemInPackage ) &lt;= 0) {
		try {
			system.log('my.target.isDisallowedForCoreStorageOperations = ' + my.target.isDisallowedForCoreStorageOperations);
			if ( my.target.isDisallowedForCoreStorageOperations ) {
				return false;
			}
		} catch(e) {
			system.log('needsRecoveryHDUpdate threw exception ' + e);
		}
		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()"/>
    <installation-check script="InstallationCheck()"/>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.11') &lt; 0 || system.compareVersions(system.version.ProductVersion, '10.12') &gt;= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.11');
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function VolumeCheck(prefix) {
	if (system.env.OS_INSTALL == 1) return true;
	var myTargetSystemVersion = (my.target.systemVersion || system.files.plistAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist"));
	my.result.message = system.localizedString('ERROR_2');
	if (!Script0(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function Script0(prefix) {
	return !!(myVolCheck());
}
function Not1(prefix) {
	if (!(Script2(prefix))) {
		return true;
	}
	return false;
}
function Script2(prefix) {
	return !!(my.target.receiptForIdentifier('com.apple.pkg.RecoveryHDUpdate.15C50'));
}
</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="OS X El Capitan Recovery Update" start_selected="true" visible="Not1('/')">
        <pkg-ref id="RecoveryHDUpdate" auth="Root" packageIdentifier="com.apple.pkg.RecoveryHDUpdate.15C50">RecoveryHDUpdate.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl">"SU_TITLE" = "Uaktualnienie trybu odzyskiwania OS X El Capitan";
"SU_TITLE_ALT" = "";
"SU_VERS" = "1.0";
"SU_VERS_ALT" = "";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich i serwerów";
"SU_DESCRIPTION" = '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;style type="text/css"&gt;
	body {font: 11.0px Lucida Grande;}
    p {margin: 0.0px 0.0px 0.0px 0.0px;}
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Uaktualnienie trybu odzyskiwania OS X El Capitan zawiera ulepszenia dla trybu odzyskiwania systemu OS X i jest zalecane dla wszystkich użytkowników systemu El Capitan.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
';
"SU_DESCRIPTION_ALT" = '';
</strings>
    </localization>
    <pkg-ref id="RecoveryHDUpdate" installKBytes="63" version="1.0.1.1449123250"/>
</installer-gui-script>
