<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="ppc,i386" customize="never"/>
    <title>SU_TITLE</title>
    <script>
</script>
    <volume-check script="VolumeCheck()"/>
    <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.5') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7.5');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_1');
	if (!NotTier3(my.target.mountpoint) || !NotADowngrade(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function NotTier3(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_2');
	if (system.files.fileExistsAtPath(prefix + '/var/db/.AppleTier3Language') == 0) {
		return true;
	}
	return false;
}
function NotADowngrade(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_3');
	var bundle = system.files.bundleAtPath(prefix + '/System/Library/CoreServices/RemoteManagement/ARDAgent.app');
	if (!bundle) {
		return true;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return true;
	}
	if (system.compareVersions(bundleKeyValue, '3.7.1') &gt; 0) {
		return false;
	}
	return true;
}
function OSCheck(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['ProductVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '10.7.5') &lt; 0) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '10.10') &gt;= 0) {
		return false;
	}
	return true;
}
function ARDVersion(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_4');
	var bundle = system.files.bundleAtPath(prefix + '/System/Library/CoreServices/RemoteManagement/ARDAgent.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '3.7.1') &gt;= 0) {
		return false;
	}
	return true;
}
function RemoteDesktopCheck(prefix) {
	if (NoRemoteDesktopApp(prefix) || RemoteDesktopIsCorrectVersion(prefix) || ARDAppStoreReceiptDoesExist(prefix)) {
		return true;
	}
	return false;
}
function NoRemoteDesktopApp(prefix) {
	if (system.files.fileExistsAtPath(prefix + '/Applications/Remote Desktop.app') == 0) {
		return true;
	}
	return false;
}
function RemoteDesktopIsCorrectVersion(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_5');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/Remote Desktop.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '3.7.1') != 0) {
		return false;
	}
	return true;
}
function ARDAppStoreReceiptDoesExist(prefix) {
	if (system.files.fileExistsAtPath(prefix + '/Applications/Remote Desktop.app/Contents/_MASReceipt/receipt') == 1) {
		return true;
	}
	return false;
}
</script>
    <platforms>
        <client arch="ppc,intel"/>
        <server arch="ppc,intel"/>
    </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="RemoteDesktopClient" start_selected="true" visible="OSCheck('/') &amp;&amp; ARDVersion('/') &amp;&amp; RemoteDesktopCheck('/')">
        <pkg-ref id="RemoteDesktopClient" auth="Root" packageIdentifier="com.apple.pkg.RemoteDesktopClient">RemoteDesktopClient.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie Klienta Remote Desktop";
"SU_VERS" = "3.7.1";
"SU_SERVERCOMMENT" = "Dla systemów klienckich oraz 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="1138.47">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'; min-height: 13.0px}
    span.s1 {text-decoration: underline ; color: #0000ee}
  </style>
</head>
<body>
<p class="p1">Uaktualnienie 3.7.1 jest zalecane dla wszystkich klientów Apple Remote Desktop i rozwiązuje wiele problemów związanych z niezawodnością, użytecznością oraz zgodnością.  </p>
<p class="p2"><br></p>
<p class="p1">Szczegółowe informacje dotyczące tego uaktualnienia można znaleźć pod adresem <a href="http://support.apple.com/kb/HT6045?viewlocale=pl_PL"><span class="s1">http://support.apple.com/kb/HT6045?viewlocale=pl_PL</span></a>.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='RemoteDesktopClient' installKBytes='5657' version='3.7.1.0.1.1192644438'/>
</installer-gui-script>