<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options allow-install-later="true" post-logout="true" should-authenticate-reboot="true"/>
    <title>SU_TITLE</title>
    <script>
</script>
    <volume-check script="VolumeCheck()"/>
    <installation-check script="InstallationCheck()"/>
    <script>
function compareBuildVersions(lhs, rhs) {
	var lhsMatch = lhs.match(/([0-9]+)([A-Z])([0-9]+)([a-z])?/);
	var rhsMatch = rhs.match(/([0-9]+)([A-Z])([0-9]+)([a-z])?/);
	return system.compareVersions(lhsMatch.slice(1).join(","), rhsMatch.slice(1).join(","));
}
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.9') &lt; 0 || system.compareVersions(system.version.ProductVersion, '10.10') &gt;= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.9');
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
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.9') &lt; 0 || system.compareVersions(my.target.systemVersion.ProductVersion, '10.10') &gt;= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.9');
		my.result.type = 'Fatal';
		return false;
	}
	if (compareBuildVersions(my.target.systemVersion.ProductBuildVersion, '13A584') &lt; 0) {
		my.result.message = system.localizedString('ERROR_2');
		my.result.type = 'Fatal';
		return false;
	}
	if (compareBuildVersions(my.target.systemVersion.ProductBuildVersion, '13A598') &gt; 0) {
		my.result.message = system.localizedString('ERROR_2');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_2');
	if (!Script0(my.target.mountpoint) || !LogicalOr1(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function Script0(prefix) {
	if (!system.env.OS_INSTALL != 1) {
		return false;
	}
	return true;
}
function LogicalOr1(prefix) {
	if (PlistCheck2(prefix) || Script3(prefix)) {
		return true;
	}
	return false;
}
function PlistCheck2(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/Extensions/CoreStorage.kext/Contents/Info.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CoreStorageDiskFormatVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '1') != 0) {
		return false;
	}
	return true;
}
function Script3(prefix) {
	if (!system.ioregistry.matchingClass('CoreStorageGroup').length == 0) {
		return false;
	}
	return true;
}
function PlistCheck4(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['ProductBuildVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '13A598') &gt;= 0) {
		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="OS X Mavericks GM Seed" start_selected="true" visible="PlistCheck4('/')">
        <pkg-ref id="OSXUpd10.9" auth="Root" packageIdentifier="com.apple.update.convergence.13A598" onConclusion="RequireRestart">OSXUpd10.9.pkg</pkg-ref>
        <pkg-ref id="OSXUpd10.9Patch" auth="Root" packageIdentifier="com.apple.update.convergence.13A598" onConclusion="RequireRestart">OSXUpd10.9Patch.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "OS X Mavericks GM Seed";
"SU_VERS" = "10.9";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich 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>
        <style type="text/css">
            body {font: 11.0px Lucida Grande;}
            p {margin: 0.0px 0.0px 0.0px 0.0px;}
        </style>
    </head>
    <body>
        <p>To uaktualnienie jest zalecane dla wszystkich użytkowników systemu OS X Mavericks Developer Preview 8.</p>
    </body>
</html>
';
"SU_SECURITY_UPDATE_NOTIFY_TEXT" = "Zainstaluj to uaktualnienie.";
"SU_SECURITY_UPDATE_NOTIFY_TITLE" = "Test uaktualnienia zabezpieczeń";
]]></strings>
    </localization>

	<pkg-ref id='OSXUpd10.9' installKBytes='1180234' version='1.0.1.1306847324'/>
	<pkg-ref id='OSXUpd10.9Patch' installKBytes='933817' version='1.0.0.0.1.1306847324'/>
</installer-gui-script>