<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options type="firmware" customize="never" hostArchitectures="i386" rootVolumeOnly="true"/>
    <title>SU_TITLE</title>
    <script>
</script>
    <installation-check script="InstallationCheck()"/>
    <script>
		var updateName = "iMacGraphicsFWUpdate";
		
			function needsGraphicsUpdate()
			{			
				var reg = system.ioregistry.matchingClass("IOPCIDevice")

				if( reg )
				{
					for( var i = 0; i &lt; reg.length; i++ )
					{
						var rom = reg[i]['ATY,Rom#'];						

						if( rom )
						{
							if ( rom.substring(0,14) == "113-C2950K-193" ) 
							{
								debuglog("ATY,ROM# for this CPU is: " + rom);
								return true;
							}
						}
					}
				}
				return false;
			}

		function debuglog(message)
		{
			// yes, this is secure
			if (system.files.fileExistsAtPath("/tmp/com.apple.pkg.testing")) system.log("********** " + updateName + ": " + message);
		}
	</script>
    <script>
function compareBuildVersions(lhs, rhs) {
	var lhsMatch = lhs.match(/([0-9]+)([A-Z])([0-9]+)([a-z])?/);
	var rhsMatch = rhs.match(/([0-9]+)([A-Z])([0-9]+)([a-z])?/);
	return system.compareVersions(lhsMatch.slice(1).join(","), rhsMatch.slice(1).join(","));
}
function InstallationCheck(prefix) {
	var models = ['iMac12,1',];
	var model = system.sysctl('hw.model');
	if (models.indexOf(model) == -1) {
		my.result.message = system.localizedString('ERROR_1');
		my.result.type = 'Fatal';
		return false;
	}
	if (system.compareVersions(system.version.ProductVersion, '10.7') &lt; 0) {
		my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7');
		my.result.type = 'Fatal';
		return false;
	}
	if (compareBuildVersions(system.version.ProductBuildVersion, '11A511a') &lt; 0) {
		my.result.message = system.localizedString('ERROR_1');
		my.result.type = 'Fatal';
		return false;
	}
	my.result.message = system.localizedString('ERROR_1');
	if (!Script0("/")) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function Script0(prefix) {
	if (!needsGraphicsUpdate()) {
		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="iMacGraphicsFirmwareUpdate3.0" start_selected="true">
        <pkg-ref id="iMac" auth="Root" packageIdentifier="com.apple.pkg.iMacGraphicsFWUpdate" onConclusion="RequireRestart">iMacGraphicsFWUpdate.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie 3.0 oprogramowania sprzętowego grafiki iMaca";
"SU_VERS" = "3.0";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich i serwerów";
"SU_DESCRIPTION" = '<HTML><!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">
	p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11px Lucida Grande;}
  </style>
</head>
<body>
<p class="p1">To uaktualnienie oprogramowania sprzętowego usuwa problem, który mógł powodować zawieszanie się iMaca w pewnych sytuacjach.</p><br>
</body>
</html>
';
]]></strings>
    </localization>
    <readme mime-type="text/html"><![CDATA[<HTML><!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">
	p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11px Lucida Grande;}
  </style>
</head>
<body>
<p class="p1">Uaktualniam oprogramowanie sprzętowe grafiki. Może to potrwać kilka minut. Nie przerywaj procesu uaktualniania; przerwanie procesu w wyniku utraty zasilania lub z innej przyczyny może spowodować, że uruchamianie iMaca nie będzie możliwe.</p>
</body>
</html>
]]></readme>

	<pkg-ref id='iMac' installKBytes='447' version='3.0.0.0.1.1313703033'/>
</installer-gui-script>