<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script/>
    <volume-check script="VolumeCheck()"/>
    <installation-check script="InstallationCheck()"/>
    <pkg-ref id="SafariMountainLion" installKBytes="107490" version="1.0.0.0.1.1191932192">
        <must-close>
            <app id="com.apple.Safari"/>
        </must-close>
    </pkg-ref>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.8') &lt; 0 || system.compareVersions(system.version.ProductVersion, '10.9') &gt;= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.8');
		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.8.5') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_2', '10.8.5');
		my.result.type = 'Fatal';
		return false;
	}
	if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.8.5') &gt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_3', '10.8.5');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_4');
	if (!DoesntHaveNewerWebkit(my.target.mountpoint) || !DoesntNeedRepair(my.target.mountpoint) || !RequiresUninstall(my.target.mountpoint)) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function DoesntHaveNewerWebkit(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_5');
	if (FrameworkOlderOrEqual(prefix) &amp;&amp; StagedOlderOrEqual(prefix)) {
		return true;
	}
	return false;
}
function FrameworkOlderOrEqual(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return true;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return true;
	}
	if (system.compareVersions(plistKeyValue, '8600.8.9') &gt; 0) {
		return false;
	}
	return true;
}
function StagedOlderOrEqual(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/StagedFrameworks/Safari/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return true;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return true;
	}
	if (system.compareVersions(plistKeyValue, '8600.8.9') &gt; 0) {
		return false;
	}
	return true;
}
function DoesntNeedRepair(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_6');
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CFBundleShortVersionString'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '8536') &lt; 0) {
		return false;
	}
	return true;
}
function RequiresUninstall(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_7');
	if (!(DiracRangeCheck(prefix))) {
		return true;
	}
	return false;
}
function DiracRangeCheck(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/StagedFrameworks/Safari/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '8538.41') &gt;= 0) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '8538.1') &lt;= 0) {
		return false;
	}
	return true;
}
function DoesntHaveNewerOrSameWebkit(prefix) {
	if (FrameworkOlder(prefix) &amp;&amp; StagedOlder(prefix)) {
		return true;
	}
	return false;
}
function FrameworkOlder(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return true;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return true;
	}
	if (system.compareVersions(plistKeyValue, '8600.8.9') &gt;= 0) {
		return false;
	}
	return true;
}
function StagedOlder(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/StagedFrameworks/Safari/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return true;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return true;
	}
	if (system.compareVersions(plistKeyValue, '8600.8.9') &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="Safari6.2.8MountainLion" start_selected="true" visible="DoesntHaveNewerOrSameWebkit('/')">
        <pkg-ref id="SafariMountainLion" auth="Root" packageIdentifier="com.apple.pkg.Safari6.2.8MountainLion">Safari6.2.8MountainLion.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl">"SU_TITLE" = "Safari";
"SU_VERS" = "6.2.8";
"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"&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
    &lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
    &lt;title&gt;DiracDotEightMountain_SUDecsription&lt;/title&gt;
    &lt;meta name="Generator" content="Cocoa HTML Writer"&gt;
    &lt;meta name="CocoaVersion" content="1382"&gt;
    &lt;style type="text/css"&gt;
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    p.p3 {margin: 0.0px 0.0px 0.0px 36.0px; text-indent: -36.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000}
    p.p4 {margin: 0.0px 0.0px 0.0px 36.0px; text-indent: -36.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    span.s1 {font-kerning: none}
    span.s2 {text-decoration: underline ; font-kerning: none; color: #4787ff}
    span.Apple-tab-span {white-space:pre}
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;p class="p1"&gt;&lt;span class="s1"&gt;Uaktualnienie 6.2.8 zawiera poprawki w&amp;nbsp;zakresie bezpieczeństwa i&amp;nbsp;jest zalecane dla wszystkich użytkowników systemu OS&amp;nbsp;X Mountain Lion.&lt;/span&gt;&lt;/p&gt;
    &lt;p class="p4"&gt;&lt;span class="s1"&gt;&lt;/span&gt;&lt;br&gt;
    &lt;/p&gt;
    &lt;p class="p3"&gt;&lt;span class="s1"&gt;Szczegółowe informacje na temat zawartości tego uaktualnienia związanej z&amp;nbsp;zabezpieczeniami można znaleźć pod adresem:&amp;nbsp;&lt;a
          href="http://support.apple.com/pl-pl/HT1222"&gt;&lt;span class="s2"&gt;http://support.apple.com/pl-pl/HT1222&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
';
</strings>
    </localization>
</installer-gui-script>