<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>
    <script>
var	GBDefaultPath	= "/Applications/GarageBand.app";
var GBMinVersion	= "5.0";
var GBMaxVersion	= "5.1";
</script>
    <!-- Installer UI-ey stuff -->
    <title>SU_TITLE</title>
    <welcome file="SUDescription.html"/>
    <license auto='false' file="License.rtf" sla="EA0502"/>
    <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>
    <!-- Manual Install package layout -->
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choice id='manual' title='SU_TITLE'>
        <pkg-ref id='manual' auth='Root'>#GarageBand51.pkg</pkg-ref>
    </choice>
    <!-- Software Update package layout -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='su' visible='needsUpdate(GBDefaultPath,GBMinVersion,GBMaxVersion)' suDisabledGroupID='GB51' title='SU_TITLE' versStr='SU_VERS' description='SU_DESCRIPTION' description-mime-type='text/html' secondaryDescription='SU_SERVERCOMMENT'>
        <pkg-ref id='su' auth='Root'>GarageBand51.pkg</pkg-ref>
    </choice>
    <!-- SCRIPT stuff -->
    <installation-check script="InstallationCheck()"/>
    <script>
function InstallationCheck()
{
	// Installation check since we're root volume only. That way, the user gets error
	// right away, not at volume select screen.
	
	return (rootVolumeOSGood() &amp;&amp;
			canHasUpdateWithErrors(GBDefaultPath,GBMinVersion,GBMaxVersion,"noUpdate","tooNew")
			);
}

function rootVolumeOSGood()
{
	// Error if OS X below 10.5.6
	if (-1 == system.compareVersions(system.version.ProductVersion, '10.5.6'))
	{
		my.result.title = system.localizedStringWithFormat('TITLE_OS_Leopard');
		my.result.message = system.localizedStringWithFormat('ERROR_OS_Leopard');
		my.result.type = 'Fatal';
		return false;
	}

	// OS X 10.5.6 or newer -- PASS
	return true;
}

	function canHasUpdateWithErrors(bundlePath, minVersionString, maxVersionString, minErrString, maxErrString)
	{
		var bundleVersion = PathGetShortVersion(bundlePath);
		if (!bundleVersion &amp;&amp; minVersionString &amp;&amp; (minVersionString != 0))
		{
			my.result.title = system.localizedStringWithFormat('TITLE_' + minErrString);
			my.result.message = system.localizedStringWithFormat('ERROR_' + minErrString);
			my.result.type = 'Fatal';
			return false;
		}
		
		if (system.compareVersions(bundleVersion,minVersionString) == -1)
		{
			my.result.title = system.localizedStringWithFormat('TITLE_' + minErrString);
			my.result.message = system.localizedStringWithFormat('ERROR_' + minErrString);
			my.result.type = 'Fatal';
			return false;
		}
		
		if (system.compareVersions(bundleVersion,maxVersionString) == 1)
		{
			my.result.title = system.localizedStringWithFormat('TITLE_' + maxErrString);
			my.result.message = system.localizedStringWithFormat('ERROR_' + maxErrString);
			my.result.type = 'Fatal';
			return false;
		}
		
		return true;
	}

function canHasUpdate(bundlePath, minVersionString, maxVersionString)
{
	return ((system.compareVersions(PathGetShortVersion(bundlePath),minVersionString) >= 0) &amp;&amp;
			(system.compareVersions(PathGetShortVersion(bundlePath),maxVersionString) &lt;= 0));
}

function needsUpdate(bundlePath, minVersionString, maxVersionString)
{
	return ((system.compareVersions(PathGetShortVersion(bundlePath),minVersionString) >= 0) &amp;&amp;
			(system.compareVersions(PathGetShortVersion(bundlePath),maxVersionString) &lt;0));
}

</script>
    <!-- Common include -->
    <script>
	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 _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 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" 			= "Uaktualnienie GarageBand";
"SU_VERS" 			= "5.1";
"SU_SERVERCOMMENT" 	= "Dla systemów klienckich oraz serwera.";

"SU_DESCRIPTION"='<!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>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="949.43">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Lucida Grande}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px}
    p.p4 {margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px}
    ul.ul1 {list-style-type: disc}
  </style>
</head>
<body>
<p class="p1">To uaktualnienie rozwiązuje ogólne zagadnienia zgodności, poprawia stabilność i naprawia kilka problemów mniejszej wagi. Poprawione problemy obejmują:</p>
<ul class="ul1">
  <li style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande">Do ścieżek gitarowych można teraz dodawać efekty ścieżek GarageBand oraz jednostki audio</li>
  <li style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande">Poprawiona obsługa interfejsów audio Apogee</li>
  <li style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande">Szybsze przełączanie do pełnego ekranu w Magic GarageBand</li>
  <li style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande">Poprawiony dostęp do ustawień odsłuchiwania audio</li>
</ul>
<p class="p3"><br></p>
<p class="p2">To uaktualnienie jest zalecane dla wszystkich użytkowników GarageBand \'09.</p>
<p class="p4"><br></p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='su' installKBytes='250651' version='5.1.1.1203730862'/>
</installer-gui-script>