<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script minSpecVersion='1'>

	<title>SU_TITLE</title>
	
	<license file="License.rtf"/>
	<welcome file="Welcome.rtf"/>
	<background file="background.tiff"  alignment='topleft' scaling='proportional'/>
	<options hostArchitectures='i386,ppc'/>
	
        <choices-outline ui='SoftwareUpdate'>
                <line choice='su'/>
        </choices-outline>

        <choices-outline>
                <line choice='manual'/>
        </choices-outline>

        <options customize='never'/>

        <choice id='su' suDisabledGroupID='CompressorUpdate2.3.1'>
                <pkg-ref id='com.apple.pkg.CompressorUpdate2.3.1' auth='Root'>CompressorUpdate2.3.1.pkg</pkg-ref>
        </choice>

        <choice id='su' visible='checkQTVersion() &amp;&amp; hasSWConfig() &amp;&amp; noTier3() &amp;&amp; checkSystemVersion()'/>
        <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='manual'>
                <pkg-ref id='manual' auth='Root'>.</pkg-ref>
        </choice>
        <choice id='manual' title='SU_TITLE'/>
        <choice id='manual' versStr='SU_VERS' />

		<volume-check script = "volumeCheck()"/>
	
        <script>
		
			function volumeCheck()
			{
				if( my.target.mountpoint != '/' )
				{
					my.result.message = system.localizedString('ERROR_BOOTVOL');
					my.result.type = 'Fatal';

					return false;
				}

				if( !noTier3() )
				{
					my.result.type = 'Fatal';
					my.result.message = system.localizedString('ERROR_SWCONFIG');
					return false;
				}

				if( !(checkCompressorVersion() || checkQmasterVersion()) )
				{
					my.result.type = 'Fatal';
					my.result.message = system.localizedString('ERROR_SWCONFIG');
					return false;
				}

				if( !checkQTVersion() )
				{
					my.result.type = 'Fatal';
					my.result.message = system.localizedString('ERROR_QTVER');
					return false;
				}

				if( !checkSystemVersion() )
				{
					my.result.type = 'Fatal';
					my.result.message = system.localizedString('ERROR_OSVER');
					return false;
				}

				return true;
			}

			function noTier3()
			{
				var path = my.target.mountpoint + "/var/db/.AppleTier3Language";
				if( !system.files.fileExistsAtPath(path) ){	return true; }
				return false;
			}

			function hasSWConfig()
			{
				var retVal = false;
				
				var path = my.target.mountpoint + "/Applications/Compressor.app/Contents/Info.plist";
				var plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var version = plist.CFBundleShortVersionString;
				
					if( version &amp;&amp; (system.compareVersions(version, "2.3") &gt;= 0) &amp;&amp; (system.compareVersions(version, "2.3.1") &lt; 0) ){	retVal = true; }
				}
				
				path = my.target.mountpoint + "/Applications/Apple Qmaster.app/Contents/Info.plist";
				plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var version = plist.CFBundleShortVersionString;
				
					if( version &amp;&amp; (system.compareVersions(version, "2.3") &gt;= 0) &amp;&amp; (system.compareVersions(version, "2.3.1") &lt; 0) ){	retVal = true; }
				}
				
				return retVal;
			}

			function checkCompressorVersion()
			{
				var retVal = false;
				var path = my.target.mountpoint + "/Applications/Compressor.app/Contents/Info.plist";
				var plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var version = plist.CFBundleShortVersionString;
				
					if( version &amp;&amp; (system.compareVersions(version, "2.3") &gt;= 0) &amp;&amp; (system.compareVersions(version, "2.3.2") &lt; 0) ){	retVal = true; }
				}
				
				return retVal ;
			}
	
			function checkQmasterVersion()
			{
				var retVal = false;
				var path = my.target.mountpoint + "/Applications/Apple Qmaster.app/Contents/Info.plist";
				var plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var version = plist.CFBundleShortVersionString;
				
					if( version &amp;&amp; (system.compareVersions(version, "2.3") &gt;= 0) &amp;&amp; (system.compareVersions(version, "2.3.2") &lt; 0) ){	retVal = true; }
				}
				
				return retVal ;
			}
	
			function checkQTVersion()
			{
				var retVal = false;
				var path = my.target.mountpoint + "/System/Library/Frameworks/QuickTime.framework/Versions/A/Resources/Info.plist";
				var plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var version = plist.CFBundleShortVersionString;
				
					if( version &amp;&amp; (system.compareVersions(version, "7.1.1") != -1) ){ retVal = true; }
				}
				
				return retVal;
			}
			
			function checkSystemVersion()
			{
				var path = my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist";
				
				if( !system.files.fileExistsAtPath(path) ){	return false; }
				
				var plist = system.files.plistAtPath(path);
				
				if( plist )
				{
					var property = plist.ProductVersion;
					if (property &amp;&amp; (system.compareVersions(property,"10.5") &lt; 0))
					return false;
				}
				
				return true;
			}

		</script>

	<localization>
		<strings language="pl">
<![CDATA[
// From Localiazable.strings
"SU_TITLE" = "Compressor Update";
"SU_VERS" = "2.3.1";

// From HTML description file
"SU_DESCRIPTION" = '<HTML>

<HEAD> <meta http-equiv="content-type" content="text/html;charset=utf-8"> </meta>
	<meta name="ApplePartNumber" content="UP01284"></meta>
</HEAD>

<BODY>
<FONT FACE="Lucida Grande">

<P>Compressor 2.3.1 and Apple Qmaster 2.3.1 address Mac OS X v10.5 compatibility issues for customers using the 2.3 releases of Compressor and Apple Qmaster.</P>

<P>This update is recommended for all users of Compressor and Apple Qmaster versions 2.3 when upgrading to Mac OS X v10.5.</P>

<P>For more information about Compressor 2.3.1, see the <A HREF="http://www.apple.com/support/lbn/?product=Compressor&version=2.0&language=z">Late-Breaking News</A>.</P>

<P>For more information about Apple Qmaster 2.3.1, see the <A HREF="http://www.apple.com/support/lbn/?product=AppleQmaster&version=2.0&language=z">Late-Breaking News</A>.</P>
</FONT> 

</BODY>

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