<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <platforms>
        <client arch="i386"/>
    </platforms>
    <title>SU_TITLE</title>
    <license file='License.rtf' sla='EA0325'/>
    <welcome file="Welcome.rtf"/>
    <conclusion file="Conclusion.rtf"/>
    <options hostArchitectures='i386' rootVolumeOnly='true'/>
    <options customize='never'/>
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='su' visible='needsUpdate()'/>
    <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' suDisabledGroupID='iMacGraphicsFWUpdate'>
        <pkg-ref id='auto' auth='Root'>iMacGraphicsFWUpdate.pkg</pkg-ref>
    </choice>
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choice id='manual' title='SU_TITLE' versStr='SU_VERS'>
        <pkg-ref id='manual' auth='Root'>#iMacGraphicsFWUpdate.pkg</pkg-ref>
    </choice>
    <installation-check script='installationCheck()'/>
    <volume-check script="volumeCheck()"/>
    <script>
        		
		function checkSystemVersion() {
			if( -1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.5.2') ) {
				return false;
			}
			
			return true;
		}

		function installationCheck() {
			if(checkHWModel() &amp;&amp; needsUpdate()) {
				return true;
			}
			
			my.result.message = system.localizedString('INCOMPATHW');
			my.result.type = 'Fatal';
			return false;
		}
        
		function checkHWModel()
		{
			var property = system.sysctl("hw.model");
			if( property &amp;&amp; (property == "iMac8,1") ) {
				return true;
			}
			
			return false;
		}

		function volumeCheck() {
			if( my.target.mountpoint != '/' )
			{
				my.result.message = system.localizedString('ERROR_BOOTVOL');
				my.result.type = 'Fatal';

				return false;
			}
			
			if( hasTier3() )
			{
				my.result.message = system.localizedString('ERROR_TIERTHREE');
				my.result.type = 'Fatal';
	
				return false;
			}

			if( !checkSystemVersion() )
			{
				my.result.message = system.localizedString('ERROR_OSVER');
				my.result.type = 'Fatal';
	
				return false;
			}
						
			return true;
		}
		
		function needsUpdate()
		{
					
			var reg = system.ioregistry.matchingClass("ATIRadeonX2000")
		
			if( reg )
			{
				for( var i = 0; i &lt; reg.length; i++ )
				{
					var parents = system.ioregistry.parentsOf(reg[i]);
					
					for( var j = 0; j &lt; parents.length; j++ )
					{
						var rom    = parents[j]['ATY,Rom#'];						
						
						if((rom.substring(0,11) == "113-B2250L-" || rom.substring(0,11) == "113-B2250H-") &amp;&amp; parseInt(rom.substring(11, 14)) &lt; 259) {
							return true;
						}
					}
				}
			}
			
			return false;
		}
	
		function hasTier3()
		{
			return system.files.fileExistsAtPath( my.target.mountpoint + "/var/db/.AppleTier3Language" );
		}
				
        </script>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE" = "Uaktualnienie oprogramowania sprzętowego grafiki iMac ATI Radeon HD";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla komputerów stacjonarnych";

"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 jest przeznaczone dla komputerów iMac z zainstalowaną kartą graficzną ATI Radeon HD 2600 Pro lub ATI Radeon HD 2400 XT i z Mac OS X wersji 10.5.2 lub nowszej.</p>
<br />
<p class="p1">Uaktualnienie aktualizuje oprogramowanie sprzętowe karty graficznej ATI Radeon HD 2600 XT lub ATI Radeon HD 2400 XT w komputerze iMac w celu poprawienia stabilności systemu.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='auto' installKBytes='1604' version='1.0.1.1250790013'/>
</installer-gui-script>