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

    <options customize='never'/>
    <options hostArchitectures='i386'/>    
    <options visibleOnlyForPredicate='true'/>    

	<tags>
		<tag>QuickTimePlayerLegacyContentHandler</tag>
	</tags>

    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>    
        
    <title>SU_TITLE</title>
	<welcome file='SUDescription.html'/>
	
	<choices-outline ui='SoftwareUpdate'>
        <line choice='su'/>
    </choices-outline>
    <choices-outline>
        <line choice='manual'/>
    </choices-outline>
	
	<choice id='su' suDisabledGroupID='QuickTimePlayer7'>
		<pkg-ref id='auto' auth='Root'>QuickTimePlayer7.pkg</pkg-ref>
    </choice>
    
	<choice id='manual' title='SU_TITLE'>
		<pkg-ref id='manual' auth='Root'>QuickTimePlayer7.pkg</pkg-ref>
    </choice>

	<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'/>
    
    <volume-check script='volumeCheck()'/>

    <script>
		var versionPlistPath = "/private/var/db/QuickTimePlayerVersion.plist";
		var version = "1.0";


		
        function volumeCheck()
        {
            if (system.env.OS_INSTALL == 1) {
                return true;
            }
            
            if (commonRequirements()) {
                return true;
            }
            
            my.result.type = 'Fatal';
            my.result.message = system.localizedString('ERROR_INSTALL');
            return false;
        }
        
        function commonRequirements()
        {
            try {
                // 10.6 only
                if(-1 == system.compareVersions(my.target.systemVersion.ProductVersion, '10.6')) {
                    return false;
                }
                if(-1 != system.compareVersions(my.target.systemVersion.ProductVersion, '10.7')) {
                    return false;
                }

				var versionPlist = system.files.plistAtPath(my.target.mountpoint + versionPlistPath);
				if (versionPlist) {
					if (system.compareVersions(versionPlist["ProductVersion"], version) != 0) {
						return false;
					}
				}

				// 10A315 and later
				if(-1 == system.compareVersions(my.target.systemVersion.ProductBuildVersion.substring(3), '315')) {
					return false;
				}
				
            }
            catch(err) { return false; }

            return true;
        }

    </script>
	<localization>
		<strings language="pl">
<![CDATA[
// From Localiazable.strings
"SU_TITLE" = "QuickTime Player 7";
"SU_VERS" = "1.0";
"SU_SERVERCOMMENT" = "Dla systemów klienckich oraz serwerów";

// From HTML description file
"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.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Lucida Grande}
</style>
</head>
<body>
<p class="p1">Ten pakiet instaluje QuickTime Player 7.</p>
</body>
</html>
';
]]>
		</strings>
	</localization>

	<pkg-ref id='auto' installKBytes='21433' version='10.6.0.1.1.1248706578'/>
	<pkg-ref id='manual' installKBytes='21433' version='10.6.0.1.1.1248706578'/>
</installer-gui-script>
