<?xml version="1.0" encoding="UTF-8"?>
<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="SafariSnowLeo">
        <must-close>
            <app id="com.apple.Safari"/>
        </must-close>
    </pkg-ref>
    <script>
function InstallationCheck(prefix) {
	if (system.compareVersions(system.version.ProductVersion, '10.6') &lt; 0 || system.compareVersions(system.version.ProductVersion, '10.7') >= 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.6');
		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.6.8') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_2', '10.6.8');
		my.result.type = 'Fatal';
		return false;
	}
	if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.6.8') > 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_3', '10.6.8');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_4');
	if (!DoesntHaveNewerWebkit(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');
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '6534.59.10') > 0) {
		return false;
	}
	return true;
}
function DoesntHaveNewerOrSameWebkit(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/Frameworks/WebKit.framework/Resources/Info.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['CFBundleVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '6534.59.10') >= 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="Safari5.1.10SnowLeopard" start_selected="true" visible="DoesntHaveNewerOrSameWebkit('/')">
        <pkg-ref id="SafariSnowLeo" auth="Root" packageIdentifier="com.apple.pkg.Safari517SnowLeopard" onConclusion="RequireRestart">Safari5.1.10SnowLeopard.pkg</pkg-ref>
        <pkg-ref id="FlashUpdateTool" auth="Root" packageIdentifier="com.apple.pkg.FlashUpdateTool">FlashUpdateTool.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Safari";
"SU_VERS" = "5.1.10";
"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">Safari 5.1.10 dla OS X Snow Leopard zawiera poprawki zabezpieczeń i jest zalecane dla wszystkich użytkowników systemu Snow Leopard.<br /><br/></p>
<p class="p1">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='FlashUpdateTool' installKBytes='734' version='1.0.0.0.1.1191932192'/>
	<pkg-ref id='SafariSnowLeo' installKBytes='113062' version='1.0.0.0.1.1191932192'/>
</installer-gui-script>