<?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="SUDescription.html"/>
    <options hostArchitectures='i386' rootVolumeOnly='true'/>
    <options customize='never'/>
    <options type='firmware'/>
    <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='DisplayPortFWUpdate'>
        <pkg-ref id='auto' auth='Root' onConclusion='RequireRestart'>iMacDisplayUpdate.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' onConclusion='RequireRestart'>#iMacDisplayUpdate.pkg</pkg-ref>
    </choice>
    <installation-check script='installationCheck()'/>
    <volume-check script="volumeCheck()"/>
    <script>
        		
		function checkSystemVersion() {
			if( -1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.6.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 obj = system.ioregistry.fromPath("IODeviceTree:/");
			if( obj )
			{
				var property = obj["board-id"];
				if( property &amp;&amp;	((property == "Mac-F2268DC8") || (property == "Mac-F2268DAE")) ){ 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 objs = system.ioregistry.matchingClass("IOFBStub");
	        if( objs )
			{
				for( var i = 0; i &lt; objs.length; i++ )
				{
					var entry = objs[i];
					
					var portnumber = entry["port-number"];
					if( portnumber )
					{
						if( portnumber == "1" )
						{
							var dpcd_registers = entry["dpcd-registers"];
							if( dpcd_registers )
							{
								var cOUI   = dpcd_registers.substring(2048, 2054);
								var cModel = dpcd_registers.substring(2054, 2066);
								
								if( (cOUI == "0010fa") &amp;&amp; (cModel == "4d4f4e323761") )
								{
									var nHWRev = dpcd_registers.substring(2066, 2068);
									var nFWVer = dpcd_registers.substring(2068, 2070);
									var nBLVer = dpcd_registers.substring(2070, 2072);
									
									if( (system.numericalCompare(nHWRev, "10") > 0) &amp;&amp; (nFWVer == "13") &amp;&amp; (system.numericalCompare(nBLVer, "30") > 0)  )
									{
										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 27-calowego iMaca";
"SU_VERS" = "1.0";
"SU_FIRMWARE_POST_INSTALL_STATUS" = "Instaluję oprogramowanie sprzętowe monitora...";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich";

"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">Ten pakiet uaktualnia oprogramowanie sprzętowe 27-calowego iMaca, aby rozwiązać problem sporadycznego występowania efektu migotania ekranu.</p><br>
<p class="p1">Uaktualnienie oprogramowania sprzętowego grafiki 27-calowego iMaca uaktualni Twojego iMaca. Nie przerywaj procesu uaktualniania, ani nie wyłączaj iMaca w jego trakcie.</p>
</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">Czy na pewno chcesz zainstalować Uaktualnienie oprogramowania sprzętowego grafiki 27-calowego iMaca?</p><br>
<p class="p1">Uaktualnia ono oprogramowanie sprzętowe 27-calowego iMaca, aby rozwiązać problem sporadycznego występowania efektu migotania ekranu.</p><br>
<p class="p1">Kliknij w Instaluj uaktualnienie, aby kontynuować.  Po ponownym uruchomieniu komputera na szarym ekranie pojawi się pasek wskazujący postęp instalowania tego uaktualnienia.  Nie przerywaj uaktualniania, ani nie wyłączaj iMaca w jego trakcie.  Zainstalowanie tego uaktualnienia może potrwać do dwóch minut.</p>
</body>
</html>
]]></readme>

	<pkg-ref id='auto' installKBytes='251' version='1.0.1.1264623272'/>
</installer-gui-script>