<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<installer-gui-script minSpecVersion='1'>
    <script>
var iDVDPath		= "/Applications/iDVD.app";
var iDVDMinVersion	= "7.0.4";
var iDVDMaxVersion	= "7.1.2";

</script>
    <!-- Installer UI-ey stuff -->
    <title>SU_TITLE</title>
    <welcome file="SUDescription.html"/>
    <license auto='false' file="License.rtf" sla="EA0760"/>
    <background file="background.tiff" scaling="proportional" alignment="upperleft"/>
    <options customize="never" rootVolumeOnly="true" hostArchitectures='ppc,i386'/>
    <platforms>
        <client arch="i386,ppc"/>
        <server arch="i386,ppc"/>
    </platforms>
    <!-- Manual Install package layout -->
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
    <choice id='manual'>
        <pkg-ref auth='Root' id='manual'>#iDVD7.1.2Update.pkg</pkg-ref>
    </choice>
    <choice id='manual' title='MANUAL_TITLE' versStr='SU_VERS'/>
    <!-- Software Update package layout -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choice id='su' visible='needsUpdate(iDVDPath,iDVDMinVersion,iDVDMaxVersion)' start_selected='true' suDisabledGroupID='iDVD712Update' title='SU_TITLE' versStr='SU_VERS' description='SU_DESCRIPTION' description-mime-type='text/html' secondaryDescription='SU_SERVERCOMMENT'>
        <pkg-ref auth='Root' id='auto'>iDVD7.1.2Update.pkg</pkg-ref>
    </choice>
    <!-- Installer logic -->
    <installation-check script="InstallationCheck()"/>
    <script>
	function InstallationCheck()
	{
		return (hasNoTier3() &amp;&amp; 
				hasGoodSSW() &amp;&amp; 
				canHasUpdateWithErrors(iDVDPath,iDVDMinVersion,iDVDMaxVersion)
				);
	}

	function hasGoodSSW()
	{
		var sysVersion = system.version;
		if (!sysVersion || system.compareVersions(system.version.ProductVersion, '10.6.7') == -1 )
		{
			my.result.message = system.localizedStringWithFormat('ERROR_OSSNOWLEO');
			my.result.type = 'Fatal';
			return false;
		}

		return true;
	}

	function hasNoTier3()
	{
		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 canHasUpdateWithErrors(bundlePath, minVersionString, maxVersionString)
	{
		var bundleVersion = PathGetShortVersion(bundlePath);
		if (!bundleVersion &amp;&amp; minVersionString &amp;&amp; (minVersionString != 0))
		{
			my.result.message = system.localizedStringWithFormat('ERROR_APP');
			my.result.type = 'Fatal';
			return false;
		}
		
		if (system.compareVersions(bundleVersion,minVersionString) == -1)
		{
			my.result.message = system.localizedStringWithFormat('ERROR_APP');
			my.result.type = 'Fatal';
			return false;
		}
		
		if (system.compareVersions(bundleVersion,maxVersionString) == 1)
		{
			my.result.message = system.localizedStringWithFormat('ERROR_TOONEW');
			my.result.type = 'Fatal';
			return false;
		}
		
		return true;
	}

	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"		= "iDVD 7.1.2";
"SU_VERS"		= "7.1.2";
"SU_SERVERCOMMENT"	= "Dla serwerów i komputerów klienckich";

"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="1038.35">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'; min-height: 13.0px}
    p.p3 {margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px \'Lucida Grande\'}
    li.li1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'}
    li.li2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \'Lucida Grande\'; min-height: 13.0px}
    span.s1 {text-decoration: underline ; color: #0000ee}
    span.Apple-tab-span {white-space:pre}
    ul.ul1 {list-style-type: disc}
  </style>
</head>
<body>
<p class="p3">To uaktualnienie poprawia ogólną stabilność oraz rozwiązuje inne problemy mniejszej wagi, a w tym:</p>
<ul class="ul1">
  <li class="li1">poprawia niezawodność zaimportowanych pokazów slajdów z iPhoto \'11,</li>
  <li class="li1">usuwa problem, który mógł uniemożliwiać ponowne dowiązania pomiędzy plikami,</li>
  <li class="li1">rozwiązuje problem, który mógł powodować użycie całej mocy komputera podczas szukania plików przez iDVD.</li>
</ul>
<br />
<p class="p3">To uaktualnienie jest zalecane dla wszystkich użytkowników iDVD 7.</p>
</body>
</html>
';
]]></strings>
    </localization>

	<pkg-ref id='auto' installKBytes='106080' version='7.1.2.0.1.1203730862'/>
</installer-gui-script>