<?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='MacProGraphicsFWUpdate'>
        <pkg-ref id='auto' auth='Root'>MacProGraphicsFWUpdate.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'>#MacProGraphicsFWUpdate.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()) {
				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 == "MacPro3,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;
			}
									
			if( !hasLeopardGraphicsUpdate() )
			{
				my.result.message = system.localizedString('ERROR_OSVERANDG');
				my.result.type = 'Fatal';
	
				return false;
			}
			
			if( !needsUpdate() )
			{
				my.result.message = system.localizedString('INCOMPATHW');
				my.result.type = 'Fatal';
	
				return false;
			}

			return true;
		}
		
		function hasLeopardGraphicsUpdate() {
			try {
				var plistCheck = system.files.plistAtPath(my.target.mountpoint + "/System/Library/Extensions/ATINDRV.kext/Contents/Info.plist")
				if(plistCheck) {
					if(-1 != system.compareVersions(plistCheck.CFBundleShortVersionString, '1.5.24')) {
						return true;
					}
				}
			} catch(err) { return false; }
			
	        return false;
		}

		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-B1480A-" &amp;&amp; parseInt(rom.substring(11, 14)) &lt; 252) {
							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 ATI Radeon HD 2600 XT";
"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 Mac Pro z zainstalowaną jedną lub więcej kartą graficzną ATI Radeon HD 2600 XT, pracujących z systemem Mac OS X w wersji 10.5.2 lub nowszej oraz zainstalowanym Uaktualnieniem grafiki Leopard.</p>
<br />
<p class="p1">Uaktualnia oprogramowanie sprzętowe wszystkich kart graficznych ATI Radeon HD 2600 XT zainstalowanych w komputerze Mac Pro w celu polepszenia stabilności systemu.</p>
<br />
<p class="p1">Instalacja tego uaktualnienia w komputerze Mac Pro z procesorem 2.8 GHz oraz wieloma napędami dyskowymi lub zainstalowaną więcej niż 2 GB pamięci RAM spowoduje spełnienie przez system wymagań Energy Star 3.0.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='auto' installKBytes='1488' version='1.0.1.1204765421'/>
</installer-gui-script>