<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options hostArchitectures="i386" customize="never"/>
    <title>SU_TITLE</title>
    <script>
var updateName = "FlashbackMalwareRemover";

function debuglog(message)
{
    // yes, this is secure
    if (system.files.fileExistsAtPath("/tmp/com.apple.pkg.testing")) system.log("********** " + updateName + ": " + message);
}

function NeedsUpgrade()
{
    return (hasNoJava() &amp;&amp; hasOldReceipt());
}

function hasNoJava()
{
    var JVMTestPath = my.target.mountpoint + "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Info.plist";
    if (system.files.fileExistsAtPath(JVMTestPath))
    {
        debuglog("JVM is at " + JVMTestPath);
        return false;
    }
    else
    {
        debuglog("JVM test passed.");
        return true;
    }
}

function hasOldReceipt()
{
    if (-1 == system.compareVersions(MRTReceiptVersion(),"1.0"))
    {
        debuglog("No receipt, or receipt old enough to qualify.");
        return true;
    }
    else
    {
        debuglog("Receipt too new.");
        return false;
    }
}

function MRTReceiptVersion()
{
    var MRTReceipt = my.target.receiptForIdentifier('com.apple.pkg.FlashbackMalwareRemover');
    if (null == MRTReceipt)
    {
        debuglog("No receipt found for myself");
        return 0;
    }
    else
    {
        var receiptVersion = MRTReceipt.version;
        debuglog("Receipt found, version " + receiptVersion);
        return receiptVersion;
    }
}

</script>
    <installation-check script="InstallationCheck()"/>
    <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 Visible(prefix) {
	if (!NeedsUpgrade()) {
		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="FlashbackMalwareRemover" start_selected="true" visible="Visible('/')">
        <pkg-ref id="FlashbackMalwareRemover" auth="Root" packageIdentifier="com.apple.pkg.FlashbackMalwareRemover">FlashbackMalwareRemover.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Narzędzie usuwania oprogr. Flashback";
"SU_VERS" = "1.0";
"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>
		<style type="text/css">
			body { font: 12px "Lucida Grande"; }
		</style>
	</head>
	<body>
		<p>To uaktualnienie usuwa najczęściej występujące odmiany szkodliwego oprogramowania o nazwie Flashback. Zawiera ono to samo narzędzie do usuwania szkodliwego oprogramowania co Java dla OS X 2012-003.</p>
        <p>Uaktualnienie jest zalecane dla wszystkich użytkowników Maców, na których nie jest zainstalowana Java.</p>
        <p>Szczegółowe informacje na temat tego uaktualnienia można znaleźć pod adresem: <a href="http://support.apple.com/kb/HT5246?viewlocale=pl_PL">http://support.apple.com/kb/HT5246?viewlocale=pl_PL</a>.</p>
	</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='FlashbackMalwareRemover' installKBytes='1049' version='1.0.0.0.1.1247562015'/>
</installer-gui-script>