<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <script>
var	PrivateFrameworksPath	= "/System/Library/PrivateFrameworks/";
var CoreServicesPath		= "/System/Library/CoreServices/";

var iLMBPath			= PrivateFrameworksPath + "iLifeMediaBrowser.framework";
var iLMBVersion			= "1.0.10";

var GASPath				= PrivateFrameworksPath + "GraphicsAppSupport.framework";
var GASVersion			= "1.0";

var HiddenPath			= GASPath + "/Versions/A/Frameworks/";

var ImageKitPath		= HiddenPath + "ImageKit.framework";
var ImageKitVersion		= "1.0";

var QCAppSupportPath	= HiddenPath + "QuartzComposer.framework";
var QCAppSupportVersion	= "2.0";

var QCQTPath			= QCAppSupportPath + "/Versions/A/Resources/QuartzComposer.component";
var	QCQTVersion			= "2.2";

var ImageIOPath			= HiddenPath +  "ImageIO.framework";
var ImageIOVersion		= "2.0.5";

var RAWCameraPath		= CoreServicesPath + "RAWCamera.bundle";
var RAWCameraVersion	= "2.0.11";
</script>
    <!-- Installer UI-ey stuff -->
    <title>SU_TITLE</title>
    <welcome file="Welcome.rtf"/>
    <license file="License.rtf"/>
    <background file='background.tif' scaling='none' alignment='left'/>
    <options customize="never" rootVolumeOnly="true" hostArchitectures='ppc,i386'/>
    <platforms>
        <client arch="ppc,i386"/>
        <server arch="ppc,i386"/>
    </platforms>
    <!-- Software Update package layout -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <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' secondaryDescription='SU_SERVERCOMMENT'/>
    <choice id='su' suDisabledGroupID='iLifeSupport831' visible="system.files.bundleAtPath(iLMBPath) &amp;&amp; needsUpdate(iLMBPath,iLMBVersion)">
        <pkg-ref id='com.apple.pkg.iLifeMediaBrowserSU' auth='Root'>iLifeMediaBrowser.pkg</pkg-ref>
    </choice>
    <!-- Software Update "tag along" package layout -->
    <choices-outline ui='invisible'>
        <line choice='GASSU'/>
        <line choice='ImageKitSU'/>
        <line choice='QuartzComposerAppSupportSU'/>
        <line choice='QCQTComponentAppSupportSU'/>
        <line choice='ImageIOSU'/>
        <line choice='RAWCameraSU'/>
    </choices-outline>
    <choice id="GASSU" selected="needsUpdate(GASPath,GASVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.GraphicsAppSupportSU' auth='Root'>GraphicsAppSupport.pkg</pkg-ref>
    </choice>
    <choice id="ImageKitSU" selected="needsUpdate(ImageKitPath,ImageKitVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.ImageKit_TigerSU' auth='Root'>ImageKit_Tiger.pkg</pkg-ref>
    </choice>
    <choice id="QuartzComposerAppSupportSU" selected="needsUpdate(QCAppSupportPath,QCAppSupportVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.QuartzComposerAppSupportSU' auth='Root'>QuartzComposerAppSupport.pkg</pkg-ref>
    </choice>
    <choice id="QCQTComponentAppSupportSU" selected="needsUpdate(QCQTPath,QCQTVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.QCQTComponentAppSupportSU' auth='Root'>QCQTComponentAppSupport.pkg</pkg-ref>
    </choice>
    <choice id="ImageIOSU" selected="needsUpdate(ImageIOPath,ImageIOVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.ImageIO_TigerSU' auth='Root'>ImageIO.pkg</pkg-ref>
    </choice>
    <choice id="RAWCameraSU" selected="needsUpdate(RAWCameraPath,RAWCameraVersion) &amp;&amp; (typeof(choices.su) != &quot;undefined&quot;)">
        <pkg-ref id='com.apple.pkg.RAWCameraSU' auth='Root'>RAWCamera.pkg</pkg-ref>
    </choice>
    <!-- Manual package layout -->
    <!-- This is used for UPDATING the stuff only -->
    <choices-outline>
        <line choice='iLMB'/>
        <line choice='RAWCamera'/>
        <line choice='GAS'/>
        <line choice='ImageKit'/>
        <line choice='QuartzComposerAppSupport'/>
        <line choice='QCQTComponentAppSupport'/>
        <line choice='ImageIO'/>
    </choices-outline>
    <choice id="iLMB" title="iLMB" selected='canHasUpdate(iLMBPath,iLMBVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.iLifeMediaBrowser' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/iLifeMediaBrowser.pkg
	</pkg-ref>
    </choice>
    <choice id="RAWCamera" title="RAWCamera" selected='canHasUpdate(RAWCameraPath,RAWCameraVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.RAWCamera' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/RAWCamera.pkg
	</pkg-ref>
    </choice>
    <choice id="GAS" title="GAS" selected='canHasUpdate(GASPath,GASVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.GraphicsAppSupport' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/GraphicsAppSupport.pkg
	</pkg-ref>
    </choice>
    <choice id="ImageKit" title="ImageKit" selected='canHasUpdate(ImageKitPath,ImageKitVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.ImageKit_Tiger' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/ImageKit_Tiger.pkg
	</pkg-ref>
    </choice>
    <choice id="QuartzComposerAppSupport" title="QuartzComposerAppSupport" selected='canHasUpdate(QCAppSupportPath,QCAppSupportVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.QuartzComposerAppSupport' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/QuartzComposerAppSupport.pkg
	</pkg-ref>
    </choice>
    <choice id="QCQTComponentAppSupport" title="QCQTComponentAppSupport" selected='canHasUpdate(QCQTPath,QCQTVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.QCQTComponentAppSupport' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/QCQTComponentAppSupport.pkg
	</pkg-ref>
    </choice>
    <choice id="ImageIO" title="ImageIO" selected='canHasUpdate(ImageIOPath,ImageIOVersion)' enabled='false'>
        <pkg-ref id='com.apple.pkg.ImageIO' auth='Root'>
		file:../iLifeSupport.mpkg/Contents/Installers/ImageIO.pkg
	</pkg-ref>
    </choice>
    <!-- SCRIPT stuff -->
    <installation-check script="InstallationCheck()"/>
    <script>
function InstallationCheck()
{
	return(	noTier3() &amp;&amp; goodOS() &amp;&amp; 
			canHasUpdateWithErrors(iLMBPath, '0.9', iLMBVersion, 'noFramework', 'isDowngrade') );
}

function noTier3()
{
	var path = "/var/db/.AppleTier3Language";
	if (!system.files.fileExistsAtPath(path) || ( system.compareVersions(system.version.ProductVersion, "10.5") >= 0))
		return true;
		
	my.result.message = system.localizedStringWithFormat('volumeHasTier3');
	my.result.type = 'Fatal';
	return false;
}

function goodOS()
{
	// Root volume must have 10.4.11 or newer
	if (system.compareVersions(system.version.ProductVersion, "10.4.11") &lt; 0) 
	{
		my.result.message = system.localizedStringWithFormat('systemTooOld');
		my.result.type = 'Fatal';
		return false;
	}
	
	// Root volume must	not be Leopard
	if (system.compareVersions(system.version.ProductVersion, "10.5") >= 0) 
	{
		my.result.message = system.localizedStringWithFormat('systemTooNew');
		my.result.type = 'Fatal';
		return false;
	}
	
	return true;
}

function canHasUpdateWithErrors(bundlePath, minVersionString, maxVersionString, minErrString, maxErrString)
{
	if (!PathGetShortVersion(bundlePath) || system.compareVersions(PathGetShortVersion(bundlePath),minVersionString) == -1)
	{
		my.result.message = system.localizedStringWithFormat(minErrString);
		my.result.type = 'Fatal';
		return false;
	}
	
	if (system.compareVersions(PathGetShortVersion(bundlePath),maxVersionString) == 1)
	{
		my.result.message = system.localizedStringWithFormat(maxErrString);
		my.result.type = 'Fatal';
		return false;
	}
	
	return true;
}


<!-- These are used by the packages themselves -->
        
function canHasUpdate(bundlePath, versionString)
{
	return (!PathGetShortVersion(bundlePath) || system.compareVersions(PathGetShortVersion(bundlePath),versionString) &lt;= 0);
}

function needsUpdate(bundlePath, versionString)
{
	return (!PathGetShortVersion(bundlePath) || system.compareVersions(PathGetShortVersion(bundlePath),versionString) &lt; 0);
}
</script>
    <!-- Common include -->
    <script>
	function _PadVersionString(version, tupleCount)
	{
		if (version == null)
			version = "0";
		var components = version.split(".");
		if (components.length > tupleCount)
			components = components.slice(0, tupleCount);
		else
			for (; components.length&lt;tupleCount; )
				components.push("0");
		return components.join(".");
	}

	function PathGetShortVersion(path)
	{
		var bundle = system.files.bundleAtPath(path);
		if (bundle == null)
			return null;
		var shortVers = bundle.CFBundleShortVersionString;
		shortVers = _PadVersionString(shortVers, 3);
		return shortVers;
	}

	function BundleGetCompositeVersion5(bundle)
	{
		if (bundle == null)
			return null;
		var shortVers = bundle.CFBundleShortVersionString;
		shortVers = _PadVersionString(shortVers, 3);
		var sourceVers = bundle.SourceVersion;
		sourceVers = _PadVersionString(sourceVers, 1);
		var buildVers = bundle.BuildVersion;
		buildVers = _PadVersionString(buildVers, 1);
		var fiveTupleVers = shortVers + "." + sourceVers + "." + buildVers;
		return fiveTupleVers;
	}

	function CheckNameRegistry(path, property, value)
	{
		try
		{
			var obj = system.ioregistry.fromPath(path);
			if (obj == null)
				return false;

			var propObj = obj[property];
			if (propObj == null)
				return false;

			if (typeof(propObj) == "string")	// string
			{
				return (propObj == value);
			}
			else if (typeof(propObj) == "object")	// array contains
			{
				for (var i=0; i&lt;propObj.length; i++)
					if (propObj[i] == value)
						return true;
			}
		}
		catch (e) {}

		return false;
	}
</script>
    <localization>
        <strings language="pl"><![CDATA["SU_TITLE"			= "Obsługa iLife";
"SU_VERS"			= "8.3.1";
"SU_SERVERCOMMENT"	= "Dla systemów stacjonarnych oraz serwerów.";

"SU_DESCRIPTION"='<HTML>
<HEAD> <meta http-equiv="content-type" content="text/html;charset=utf-8"> </meta> </HEAD>
<BODY>
<FONT FACE="Lucida Grande">
<P>
Pakiet iLife Support zawiera składniki systemu współdzielone przez wszystkie programy iLife ’08. 
To uaktualnienie poprawia ogólną stabilność systemu i rozwiązuje kilka problemów mniejszej wagi. 
Jest zalecane dla wszystkich użytkowników iLife ’08.
</P><P>
Informacje na temat zawartości tego uaktualnienia związanej z zabezpieczeniami można znaleźć pod adresem:  <a href="http://support.apple.com/kb/HT1222?viewlocale=pl_PL">http://support.apple.com/kb/HT1222</a>

</P>
</FONT> 
</BODY>
</HTML>
';
]]></strings>
    </localization>
</installer-gui-script>