<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <options customize='never'/>
    <options hostArchitectures='i386'/>
    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>
    <title>SU_TITLE</title>
    <license file="License.rtf" sla="EA0390"/>
    <readme file='SUDescription.html'/>
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choice id='su' suDisabledGroupID='FlashbackRemovalUpdate'>
        <pkg-ref id='com.apple.pkg.update.flashbackremoval.leopard' auth='Root'>FlashbackRemovalUpdate.pkg</pkg-ref>
    </choice>
    <choice id='manual' title='SU_TITLE'>
        <pkg-ref id='manual' auth='Root'>#FlashbackRemovalUpdate.pkg</pkg-ref>
    </choice>
    <choice id='su' title='SU_TITLE'/>
    <choice id='su' versStr='SU_VERS'/>
    <choice id='su' description='SU_DESCRIPTION' description-mime-type='text/html'/>
    <choice id='su' visible='NeedsUpgrade()'/>
    <volume-check script='volumeCheck()'/>
    <script>

        function commonRequirements() {
            try {			
                // must have an OS
                if(false == system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist")) {
                    return (false);
                }

                // 10.5.8 only
                if( (my.target.systemVersion.ProductVersion != '10.5.8')) {
                    return (false);
                }
            }
            catch(err) { return false; }
            return(true);
        }

		function volumeCheck() {
            if (commonRequirements()) {
                return (true);
            }
            my.result.type = 'Fatal';
            my.result.message = system.localizedString('ERROR_INSTALL');
            return(false);
        }
		
var updateName = "FlashbackRemovalUpdate";

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

function NeedsUpgrade()
{
    return (hasOldReceipt());
}

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.update.flashbackremoval.leopard');
    if (null == MRTReceipt)
    {
        debuglog("No receipt found for myself");
        return 0;
    }
    else
    {
        var receiptVersion = MRTReceipt.version;
        debuglog("Receipt found, version " + receiptVersion);
        return receiptVersion;
    }
}

        </script>
    <localization>
        <strings language="pl"><![CDATA["SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla systemów Leopard";
"SU_TITLE" = "Uaktualnienie zabezpieczeń: usuwanie oprogramowania Flashback";

"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: 11.0px Lucida Grande; }
        </style>
    </head>
    <body>
        <p>To uaktualnienie usuwa najczęściej spotykane odmiany złośliwego oprogramowania Flashback. Jeśli oprogramowanie Flashback zostanie znalezione, wyświetlone zostanie okno dialogowe z informacją, że złośliwe oprogramowanie zostało usunięte. W niektórych przypadkach do całkowitego usunięcia złośliwego oprogramowania Flashback konieczne może być ponowne uruchomienie komputera.</p>

        <p>Aby poprawić ochronę Maca, to uaktualnienie wyłącza również wtyczkę Java w Safari. Instrukcje ponownego włączania tej wtyczki można znaleźć na stronie: <a href="http://support.apple.com/kb/HT5241?viewlocale=pl_PL">http://support.apple.com/kb/HT5241?viewlocale=pl_PL</a>.</p>
    </body>
</html>';
]]></strings>
    </localization>

	<pkg-ref id='com.apple.pkg.update.flashbackremoval.leopard' installKBytes='4822' version='1.0.0.0.1.1191932192'/>
</installer-gui-script>