<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options customize="never" rootVolumeOnly="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.2') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_2', '10.9.2');
		my.result.type = 'Fatal';
		return false;
	}
	if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.9.2') &gt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_3', '10.9.2');
		my.result.type = 'Fatal';
		return false;
	}
	if (compareBuildVersions(my.target.systemVersion.ProductBuildVersion, '13C64') &lt; 0) {
		my.result.message = system.localizedString('ERROR_4');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_4');
	if (!BundleCheck0(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function BundleCheck0(prefix) {
	var bundle = system.files.bundleAtPath(prefix + './Applications/Server.app');
	if (!bundle) {
		return false;
	}
	return true;
}
function Not1(prefix) {
	if (!(Script2(prefix))) {
		return true;
	}
	return false;
}
function Script2(prefix) {
	if (!my.target.receiptForIdentifier('com.apple.pkg.update.server.xcode.4-1')) {
		return false;
	}
	return true;
}
function Script3(prefix) {
	if (!system.files.fileExistsAtPath('/Library/Server/Xcode/Cache/ServiceState/xcode')) {
		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="Xcode Update for OS X Server" start_selected="true" visible="Not1('/') &amp;&amp; Script3('/')">
        <pkg-ref id="XcodeServerUpdate" auth="Root" packageIdentifier="com.apple.pkg.update.server.xcode.4-1" onConclusion="RequireRestart">XcodeServerUpdate.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Xcode Update for OS X Server";
"SU_VERS" = "1.0";
"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>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1187.4">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'}
  </style>
</head>
<body>
<p class="p1">Fixes an issue that could cause Xcode Server bots to hang and logout the active user.</p>
<p class="p1">For detailed information about this update, please visit: <a href="http://support.apple.com/kb/HT6139">http://support.apple.com/kb/HT6139</a>.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='XcodeServerUpdate' installKBytes='14303' version='1.0.0.0.1.1306847324'/>
</installer-gui-script>