<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script>
</script>
    <volume-check script="VolumeCheck()"/>
    <installation-check script="InstallationCheck()"/>
    <pkg-ref id="SafariLion">
        <must-close>
            <app id="com.apple.Safari"/>
        </must-close>
    </pkg-ref>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.7') &lt; 0 || system.compareVersions(system.version.ProductVersion, '10.8') >= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7');
		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.7.5') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_2', '10.7.5');
		my.result.type = 'Fatal';
		return false;
	}
	if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.7.5') > 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_3', '10.7.5');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_4');
	if (!DoesntHaveNewerWebkit(my.target.mountpoint) || !DoesntNeedRepair(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, '7537.78.2') > 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, '7537.78.2') > 0) {
		return false;
	}
	return true;
}
function DoesntNeedRepair(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_6');
	if (FrameworkMinimum(prefix) || FrameworkNewer(prefix)) {
		return true;
	}
	return false;
}
function FrameworkMinimum(prefix) {
	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, '7534.57') &lt; 0) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '7535') >= 0) {
		return false;
	}
	return true;
}
function FrameworkNewer(prefix) {
	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, '7536') &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, '7537.78.2') >= 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, '7537.78.2') >= 0) {
		return false;
	}
	return true;
}
function PDFKitNewerOrEqual(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framework/Resources/version.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '2.7.7') &lt; 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.1.6Lion" start_selected="true" visible="DoesntHaveNewerOrSameWebkit('/') &amp;&amp; PDFKitNewerOrEqual('/')">
        <pkg-ref id="SafariLion" auth="Root" packageIdentifier="com.apple.pkg.Safari6.1.6Lion">Safari6.1.6Lion.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Safari";
"SU_VERS" = "6.1.6";
"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="1038.36">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    li.li1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
    span.s1 {text-decoration: underline}
    ul.ul1 {list-style-type: disc}
  </style>
</head>
<body>
<p class="p1">Uaktualnienie Safari 6.1.6 zawiera poprawki w zakresie bezpieczeństwa i jest zalecane dla wszystkich użytkowników systemu OS X Lion.</p>
<p class="p2">&nbsp;</p>
<p class="p2">Szczegółowe informacje na temat zawartości tego uaktualnienia związanej z zabezpieczeniami można znaleźć pod adresem: <a href="http://support.apple.com/kb/HT1222?viewlocale=pl_PL">http://support.apple.com/kb/HT1222?viewlocale=pl_PL</a>.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='SafariLion' installKBytes='97405' version='1.0.0.0.1.1191932192'/>
</installer-gui-script>