<?xml version="1.0" encoding="UTF-8"?>
<installer-gui-script authoringTool="Packages" authoringToolVersion="1.2.9" authoringToolBuild="603" minSpecVersion="1.0">
    <options rootVolumeOnly="true" customize="never"/>
    <installation-check script="installation_check()"/>
    <!--+==========================+
        |       Presentation       |
        +==========================+-->
    <title>DISTRIBUTION_TITLE</title>
    <!--+==========================+
        |         Installer        |
        +==========================+-->
    <choices-outline>
        <line choice="installer_choice_1"/>
    </choices-outline>
    <choice id="installer_choice_1" start_enabled="false" start_selected="true" title="INSTALLER_CHOICE_1_TITLE" description="INSTALLER_CHOICE_1_DESCRIPTION">
        <pkg-ref id="de.dshs-koeln.spss28log4jfix"/>
    </choice>
    <!--+==========================+
        |    Package References    |
        +==========================+-->
    <pkg-ref id="de.dshs-koeln.spss28log4jfix" version="1.0" auth="Root" installKBytes="2245">#SPSS_28_log4j_Fix.pkg</pkg-ref>
    <pkg-ref id="de.dshs-koeln.spss28log4jfix">
        <must-close>
            <app id="com.ibm.spss.statistics.one"/>
        </must-close>
    </pkg-ref>
    <!--+==========================+
        |    JavaScript Scripts    |
        +==========================+-->
    <script>

	const __IC_FLAT_DISTRIBUTION__=true;
	const IC_CONDITION_EXIST=0;
	const IC_CONDITION_DOES_NOT_EXIST=1;
	const IC_SELECTOR_ANY=0;
	const IC_DISK_TYPE_DESTINATION=0;
	const IC_SELECTOR_ALL=1;
	const IC_DISK_TYPE_STARTUP_DISK=1;

	function IC_CheckFiles(inSelector,inCondition,inDiskType,inFiles)
	{
		var tCount;
		
		tCount=inFiles.length;
		
		if (tCount&gt;0)
		{
			var tIndex;
			var tExists;
			var tPath;
			var atLeastOneTrue=false;
			
			for(tIndex=0;tIndex&lt;tCount;tIndex++)
			{
				tPath=inFiles[tIndex];
			
				if (inDiskType==IC_DISK_TYPE_DESTINATION)
				{
					tPath=my.target.mountpoint+tPath;
				}
			
				if (system.files.fileExistsAtPath(tPath)==true)
				{
					if (inCondition==IC_CONDITION_EXIST)
					{
						atLeastOneTrue=true;
						
						if (inSelector==IC_SELECTOR_ANY)
						{
							return true;
						}
					}
					else if (inCondition==IC_CONDITION_DOES_NOT_EXIST &amp;&amp; inSelector==IC_SELECTOR_ALL)
					{
						return false;
					}
				}
				else
				{
					if (inCondition==IC_CONDITION_EXIST &amp;&amp; inSelector==IC_SELECTOR_ALL)
					{
						return false;
					}
					else if (inCondition==IC_CONDITION_DOES_NOT_EXIST)
					{
						atLeastOneTrue=true;
						
						if (inSelector==IC_SELECTOR_ANY)
						{
							return true;
						}
					}
				}
			}
		
			return atLeastOneTrue;
		}
		
		return true;
	}

	function installation_check()
	{
		var tResult;

		var tFilesToCheck0=new Array('//Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/bin/log4j-core-2.13.3.jar',
		                             '/Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/bin/log4j-1.2-api-2.13.3.jar',
		                             '/Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/bin/log4j-api-2.13.3.jar');

		tResult=IC_CheckFiles(IC_SELECTOR_ANY,IC_CONDITION_EXIST,IC_DISK_TYPE_STARTUP_DISK,tFilesToCheck0);

		if (tResult==false)
		{
			my.result.title = system.localizedString('REQUIREMENT_FAILED_MESSAGE_INSTALLATION_CHECK_1');
			my.result.message = system.localizedString('REQUIREMENT_FAILED_DESCRIPTION_INSTALLATION_CHECK_1');
			my.result.type = 'Fatal';
		}

		return tResult;
	}

    </script>
</installer-gui-script>