<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script/>
    <installation-check script="InstallationCheck()"/>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.6.8') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.6.8');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_1');
	if (!dontDowngrade("/")) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function dontDowngrade(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_2');
	if (iTunesAppOlderOrEqual(prefix) &amp;&amp; sourceVersionOlderOrEqual(prefix)) {
		return true;
	}
	return false;
}
function iTunesAppOlderOrEqual(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iTunes.app');
	if (!bundle) {
		return true;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return true;
	}
	if (system.compareVersions(bundleKeyValue, '11.4.0.0') > 0) {
		return false;
	}
	return true;
}
function sourceVersionOlderOrEqual(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iTunes.app');
	if (!bundle) {
		return true;
	}
	var bundleKeyValue = bundle['SourceVersion'];
	if (!bundleKeyValue) {
		return true;
	}
	if (system.compareVersions(bundleKeyValue, '1140011004000018') > 0) {
		return false;
	}
	return true;
}
function needsUpdate(prefix) {
	if (iTunesAppOlder(prefix) &amp;&amp; sourceVersionOlder(prefix)) {
		return true;
	}
	return false;
}
function iTunesAppOlder(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iTunes.app');
	if (!bundle) {
		return true;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return true;
	}
	if (system.compareVersions(bundleKeyValue, '11.4.0.0') >= 0) {
		return false;
	}
	return true;
}
function sourceVersionOlder(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iTunes.app');
	if (!bundle) {
		return true;
	}
	var bundleKeyValue = bundle['SourceVersion'];
	if (!bundleKeyValue) {
		return true;
	}
	if (system.compareVersions(bundleKeyValue, '1140011004000018') >= 0) {
		return false;
	}
	return true;
}
function dontUsePatch(prefix) {
	if (!(usePatch(prefix))) {
		return true;
	}
	return false;
}
function usePatch(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iTunes.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '11.3.1.0') != 0) {
		return false;
	}
	return true;
}
function installMobileDevice(prefix) {
	if (system.files.fileExistsAtPath(prefix + '/tmp/com.apple.mpkg.iTunes.noAMDS') == 0) {
		return true;
	}
	return false;
}
</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="iTunesX" start_selected="true" visible="needsUpdate('/') &amp;&amp; dontUsePatch('/')">
        <pkg-ref id="iTunesX" auth="Root" packageIdentifier="com.apple.pkg.iTunesX">iTunesX.pkg<must-close>
                <app id="com.apple.iTunes"/>
                <app id="com.apple.dt.Xcode"/>
            </must-close>
        </pkg-ref>
        <pkg-ref id="iTunesAccess" auth="Root" packageIdentifier="com.apple.pkg.iTunesAccess">iTunesAccess.pkg</pkg-ref>
        <pkg-ref id="CoreFP" auth="Root" packageIdentifier="com.apple.pkg.CoreFP">CoreFP.pkg</pkg-ref>
        <pkg-ref id="CoreADI" auth="Root" packageIdentifier="com.apple.pkg.CoreADI">CoreADI.pkg</pkg-ref>
        <pkg-ref id="MobileDevice" auth="Root" packageIdentifier="com.apple.pkg.MobileDevice" active="installMobileDevice('/')">MobileDevice.pkg<must-close>
                <app id="com.apple.dt.Xcode"/>
                <app id="com.apple.PurpleRestore"/>
                <app id="com.apple.AppleConfigurationUtility"/>
                <app id="com.apple.configurator"/>
                <app id="com.apple.iTunes"/>
                <app id="com.apple.iPhoto"/>
                <app id="com.apple.Aperture"/>
            </must-close>
        </pkg-ref>
    </choice>
    <localization>
        <strings language="pl">"SU_TITLE" = "iTunes";
"SU_VERS" = "11.4";
"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">
&lt;html>
&lt;head>
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  &lt;meta http-equiv="Content-Style-Type" content="text/css">
  &lt;title>&lt;/title>
  &lt;meta name="Generator" content="Cocoa HTML Writer">
  &lt;meta name="CocoaVersion" content="1265.21">
  &lt;style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica}
  &lt;/style>
&lt;/head>
&lt;body>
&lt;p class="p1">iTunes 11.4 pozwala teraz synchronizować ulubioną muzykę, filmy itd. na urządzeniach z systemem iOS 8.&lt;/p>
&lt;/body>
&lt;/html>
';
</strings>
    </localization>
    <pkg-ref id="iTunesAccess" installKBytes="1093" version="11.4.0.0.1.1188253749"/>
    <pkg-ref id="CoreFP" installKBytes="20934" version="2.6.16.0.1.1188253749"/>
    <pkg-ref id="iTunesX" installKBytes="215548" version="11.4.0.0.1.1188253749"/>
    <pkg-ref id="CoreADI" installKBytes="1727" version="2.9.2.0.1.1188253749"/>
    <pkg-ref id="MobileDevice" installKBytes="21307" version="4.0.0.0.1.1217269835"/>
</installer-gui-script>