<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script>
</script>
    <installation-check script="InstallationCheck()"/>
    <pkg-ref id="iWorkUpdate">
        <must-close>
            <app id="com.apple.iWork.Keynote"/>
            <app id="com.apple.iWork.Numbers"/>
            <app id="com.apple.iWork.Pages"/>
        </must-close>
    </pkg-ref>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.7.4') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7.4');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_1');
	if (!canHasUpdate("/")) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function canHasUpdate(prefix) {
	if (KeynoteCanHasUpdate(prefix) &amp;&amp; PagesCanHasUpdate(prefix) &amp;&amp; NumbersCanHasUpdate(prefix)) {
		return true;
	}
	return false;
}
function KeynoteCanHasUpdate(prefix) {
	if (KeynoteNewEnough(prefix) &amp;&amp; KeynoteOldEnough(prefix)) {
		return true;
	}
	return false;
}
function KeynoteNewEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_2');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Keynote.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '5.0') &lt; 0) {
		return false;
	}
	return true;
}
function KeynoteOldEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_3');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Keynote.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '5.3') > 0) {
		return false;
	}
	return true;
}
function PagesCanHasUpdate(prefix) {
	if (PagesNewEnough(prefix) &amp;&amp; PagesOldEnough(prefix)) {
		return true;
	}
	return false;
}
function PagesNewEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_4');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Pages.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '4.0') &lt; 0) {
		return false;
	}
	return true;
}
function PagesOldEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_5');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Pages.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '4.3') > 0) {
		return false;
	}
	return true;
}
function NumbersCanHasUpdate(prefix) {
	if (NumbersNewEnough(prefix) &amp;&amp; NumbersOldEnough(prefix)) {
		return true;
	}
	return false;
}
function NumbersNewEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_6');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Numbers.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '2.0') &lt; 0) {
		return false;
	}
	return true;
}
function NumbersOldEnough(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_7');
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Numbers.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '2.3') > 0) {
		return false;
	}
	return true;
}
function needsUpdate(prefix) {
	if (KeynoteNeedsUpdate(prefix) &amp;&amp; PagesNeedsUpdate(prefix) &amp;&amp; NumbersNeedsUpdate(prefix)) {
		return true;
	}
	return false;
}
function KeynoteNeedsUpdate(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Keynote.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '5.0') &lt; 0) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '5.3') >= 0) {
		return false;
	}
	return true;
}
function PagesNeedsUpdate(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Pages.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '4.0') &lt; 0) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '4.3') >= 0) {
		return false;
	}
	return true;
}
function NumbersNeedsUpdate(prefix) {
	var bundle = system.files.bundleAtPath(prefix + '/Applications/iWork \'09/Numbers.app');
	if (!bundle) {
		return false;
	}
	var bundleKeyValue = bundle['CFBundleShortVersionString'];
	if (!bundleKeyValue) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '2.0') &lt; 0) {
		return false;
	}
	if (system.compareVersions(bundleKeyValue, '2.3') >= 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="iWork_9.3_Update" visible="needsUpdate('/')">
        <pkg-ref id="iWorkUpdate" auth="Root" packageIdentifier="com.apple.pkg.iWork_9.3_Update">iWork_9.3_Update.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie iWork";
"SU_VERS" = "9.3";
"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="1162.3">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 6.0px 9.0px; font: 12.0px \'Lucida Grande\'}
    li.li2 {margin: 0.0px 0.0px 6.0px 0.0px; font: 12.0px \'Lucida Grande\'}
    span.s1 {letter-spacing: 0.0px}
    span.s2 {text-decoration: underline ; letter-spacing: 0.0px; color: #0068eb}
    ul.ul1 {list-style-type: disc}
  </style>
</head>
<body>
<p class="p1"><span class="s1">Uaktualnienie iWork 9.3 jest zgodne z programami iWork dla iOS 1.7.</span></p>
<p class="p1">
</span></p>
<p class="p1"><span class="s1">To uaktualnienie jest zalecane dla wszystkich użytkowników pakietu iWork w wersji 9.0 i nowszych. Szczegółowe informacje na temat tego uaktualnienia i zmian w poszczególnych programach można znaleźć pod adresem: <a href="http://support.apple.com/kb/HT5534?viewlocale=pl_PL"><span class="s2">http://support.apple.com/kb/HT5534?viewlocale=pl_PL</span></a>.</span></p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='iWorkUpdate' installKBytes='603041' version='1.0.0.0.1.1341568473'/>
</installer-gui-script>