<!DOCTYPE project [
    <!ENTITY importExternalLogs SYSTEM "file:./scripts/importExternalLogs.xml">
]>
<project name="createProfileShortCut2StartMenuDefault" default="createProfileShortCut2StartMenuDefault" basedir=".">
    <taskdef name="wscmtlog" classname="com.ibm.ws.install.configmanager.actionengine.ant.utils.AntTaskToLogToConfigManagersLogFiles"/>
    <taskdef name="resourcebundle" classname="com.ibm.ws.install.configmanager.actionengine.ant.utils.ResourceBundleAntTask"/> 
 	&importExternalLogs;            
    <target name="detectJSScriptExists">
        <property name="jsscript" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
    	<wscmtlog>jsscript : ${jsscript}</wscmtlog>     
    	
    	<condition property="jsscriptexists">
		<available file="${jsscript}"/>
    	</condition>    	
    </target>

    <target name="detectCurrentOSFamily"
            description="Detects the current OS family (UNIX or Windows)">
        
        <!-- OS/400 setting must come before the unix setting -->
        <condition property="currentOSFamily" value="os/400">
            <equals arg1="${os.name}" arg2="OS/400"/>
        </condition>
        
        <condition property="currentOSFamily" value="windows">
            <os family="windows"/>
        </condition>

        <condition property="currentOSFamily" value="linux">
            <equals arg1="${os.name}" arg2="Linux"/>
        </condition>
        
        <condition property="currentOSFamily" value="unix">            
            <os family="unix"/>
        </condition>
        
        <wscmtlog>Detected current OS family to be: ${currentOSFamily}</wscmtlog>
    </target>
    
    <target name="defineOSSpecificConfigFlag"
            description="Defines either configUNIX or configWindows depending on the current OS">
            
        <condition property="configOS400" value="true">
            <equals arg1="${currentOSFamily}" arg2="os/400"/>
        </condition>
        
        <condition property="configUNIX" value="true">
            <equals arg1="${currentOSFamily}" arg2="unix"/>
        </condition>

	    <condition property="configLinux" value="true">
            <equals arg1="${currentOSFamily}" arg2="linux"/>
        </condition>
        
        <condition property="configWindows" value="true">
            <equals arg1="${currentOSFamily}" arg2="windows"/>
        </condition>
    </target>
    
    <target name="setOSFileSeparator"
            description="Sets the current file separator for this platform (file.separator is unreliable on ANT 1.5.4)">
            
        <condition property="separatorFile" value="/">
            <equals arg1="${currentOSFamily}" arg2="os/400"/>
        </condition>
        
        <condition property="separatorFile" value="/">
            <equals arg1="${currentOSFamily}" arg2="unix"/>
        </condition>

        <condition property="separatorFile" value="/">
            <equals arg1="${currentOSFamily}" arg2="linux"/>
        </condition>
        
        <condition property="separatorFile" value="\">
            <equals arg1="${currentOSFamily}" arg2="windows"/>
        </condition>
    </target>

    <target name="defineDisableWASDesktopIntegrationFlag"
            description="Define the flag for start menu creation based on environment variable DisableWASDesktopIntegration">

        <property environment="env"/>
        <condition property="disableWASDesktopIntegration" value="true">
            <equals arg1="${env.DisableWASDesktopIntegration}" arg2="false"/>
        </condition>

    </target>
        
    <target name="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
        <replace file="${file}"
            token="${token}"
            value="${tokenValue}"/>
    </target>

    <target name="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
        <replace dir="${dir}"           
            token="${token}"
            value="${tokenValue}">
            <include name="**/*.${fileType}"/>
        </replace>
    </target>        

    <target name="copyJScripts"
            if="configWindows" unless="jsscriptexists">
            <copy todir="${profilePath}${separatorFile}temp">
                 <fileset dir="${WAS_HOME}${separatorFile}properties${separatorFile}version${separatorFile}nif${separatorFile}config${separatorFile}script">
                         <include name="*.*"/>
                 </fileset>
            </copy>
            <wscmtlog>Copying JScripts to: ${profilePath}${separatorFile}temp</wscmtlog>
    </target>
            
    <target name="replaceTokensForJScriptWindows"
            description="Replaces tokens for profileShortCut2StartMenu.js"
            if="configWindows">
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${WASROOT}"/>
			<param name="tokenValue" value="&quot;${WAS_HOME}&quot;"/>
	    </antcall>			
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${PROFILEROOT}"/>
			<param name="tokenValue" value="&quot;${profilePath}&quot;"/>
	    </antcall>						
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${PROFILENAME}"/>
			<param name="tokenValue" value="${profileName}"/>
	    </antcall>			
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="\"/>
			<param name="tokenValue" value="\\"/>
	    </antcall>			
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="\\\\"/>
			<param name="tokenValue" value="\\"/>
	    </antcall>
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${CELLNAME}"/>
			<param name="tokenValue" value="${cellName}"/>
	    </antcall>	    		    
            <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCutStartMenuDelete.js"/>
			<param name="token" value="${PROFILENAME}"/>
			<param name="tokenValue" value="${profileName}"/>
	    </antcall>
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${SERVERNAME}"/>
			<param name="tokenValue" value="${serverName}"/>
	    </antcall>	
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
			<param name="token" value="${HOSTNAME}"/>
			<param name="tokenValue" value="${hostName}"/>
	    </antcall>		    			
    </target>

    <target name="resolveResourceBundleString" 
        if="configWindows"
        description="Resolve resourcebundle strings in profileShortCut2StartMenuDefault">
        
        <property name="BUNDLE_NAME" value="com.ibm.ws.install.configmanager.resourcebundle.ConfigManagerResourceBundle"/>
        
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.adminconsole" param="" property="adminconsole"/>
        <!--F908-38323 <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.samplesGallery" param="" property="samplesGallery"/> -->
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.firststeps" param="" property="firststeps"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.startServer" param="" property="startServer"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.stopServer" param="" property="stopServer"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.profiles" param="" property="profilesDir"/>

        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${PROFILESDIR}"/>
		<param name="tokenValue" value="${profilesDir}"/>
	</antcall> 
        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${ADMINCONSOLE}"/>
		<param name="tokenValue" value="${adminconsole}"/>
	</antcall>
<!--F908-38323  
        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${SAMPLES}"/>
		<param name="tokenValue" value="${samplesGallery}"/>
	</antcall> 
-->
        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${FIRSTSTEPS}"/>
		<param name="tokenValue" value="${firststeps}"/>
	</antcall> 
        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${STARTSERVER}"/>
		<param name="tokenValue" value="${startServer}"/>
	</antcall>     
        <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
		<param name="token" value="${STOPSERVER}"/>
		<param name="tokenValue" value="${stopServer}"/>
	</antcall>    	
    </target>
        
    <target name="createStartMenuShortCut"
            description="Creates Start Menu shortcuts for profile created"
            if="configWindows" unless="disableWASDesktopIntegration"> 
                        <property environment="env"/>

            <property name="VAR" value="${env.SYSTEMROOT}"/>
			<available file="${env.SystemRoot}${separatorFile}system32${separatorFile}CScript.exe" property="VAR" value="${env.SystemRoot}"/>
	    <wscmtlog>Executing ${env.SystemRoot}${separatorFile}system32${separatorFile}CScript ${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js</wscmtlog>
            <wscmtlog>The output will be recorded in: ${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log</wscmtlog>
            <exec executable="${VAR}${separatorFile}system32${separatorFile}CScript.exe"
                  output="${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log">               
                  <arg value="${profilePath}${separatorFile}temp${separatorFile}profileShortCut2StartMenuDefault.js"/>
            </exec>
			<antcall target="importLogsToMain" >
				<param name="logfile" value="${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log" />
				<param name="description" value="Creating Shortcut for Profile" />
				<param name="precondition" value="foefalse" />
			</antcall>
    </target>

	<!--**************************************************-->
	<target name="chmodScripts"
		description="allows 2 shell scripts to be executable"
		if="configLinux">
			<chmod file="${profilePath}${separatorFile}properties${separatorFile}script${separatorFile}updateProfiles.menu.sh" perm="ug+x"/>
			<chmod file="${profilePath}${separatorFile}properties${separatorFile}script${separatorFile}removeAProfile.sh" perm="ug+x"/>
	</target>
    <target name="detectLinuxScriptExists">
		<property name="baseDirectory" value="${WAS_HOME}${separatorFile}properties${separatorFile}version${separatorFile}nif${separatorFile}config"/>
        <property name="linuxscript" value="${profilePath}${separatorFile}properties${separatorFile}script${separatorFile}updateProfiles.menu.sh"/>
    	<wscmtlog>linuxscript : ${linuxscript}</wscmtlog>     
    	
    	<condition property="linuxscriptexists">
		<available file="${linuxscript}"/>
    	</condition>    	
    </target>

<!--
	<target name="copySamplesShortcutIfEarExists"
		if="SamplesExists">
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications">
                 <fileset dir="${baseDirectory}${separatorFile}linuxMenu${separatorFile}applications">
                         <include name="Samples.desktop"/>
                 </fileset>
            </copy>
	</target>
 -->
	<target name="copyAdminConsoleShortcutIfEarExists"
		if="AdminConsoleExists">
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications">
                 <fileset dir="${baseDirectory}${separatorFile}linuxMenu${separatorFile}applications">
                         <include name="AdminConsole.desktop"/>
                 </fileset>
            </copy>
	</target>
    <target name="copyLinuxScripts"
            if="configLinux">
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}script">
                 <fileset dir="${baseDirectory}${separatorFile}script">
                         <include name="*.sh"/>
                 </fileset>
            </copy>
            <wscmtlog>Copying Linux Menu Files to: ${profilePath}${separatorFile}properties</wscmtlog>
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications">
                 <fileset dir="${baseDirectory}${separatorFile}linuxMenu${separatorFile}applications">
                         <include name="FirstSteps.desktop"/>
                         <include name="StartServer.desktop"/>
                         <include name="StopServer.desktop"/>
                 </fileset>
            </copy>
            <!--F908-38323 <available file="${profilePath}/installedApps/${cellName}/SamplesGallery.ear" property="SamplesExists"/> -->
            <available file="${profilePath}/config/cells/${cellName}/applications/isclite.ear" property="AdminConsoleExists"/>
	      <!--F908-38323   <antcall target="copySamplesShortcutIfEarExists"/> -->
	        <antcall target="copyAdminConsoleShortcutIfEarExists"/>
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}directories">
                 <fileset dir="${baseDirectory}${separatorFile}linuxMenu${separatorFile}directories">
                         <include name="*.directory"/>
                 </fileset>
            </copy>
            <copy todir="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}menus">
                 <fileset dir="${baseDirectory}${separatorFile}linuxMenu${separatorFile}menus">
                         <include name="*.menu"/>
                 </fileset>
            </copy>
    </target>
    <target name="loadPortsDef"
    	if="configLinux">
    		<property file="${profilePath}/properties/portdef.props"/>
    </target>
        <target name="replaceTokensForLinuxScripts"
            description="Replaces tokens for linux menu files"
            if="configLinux">
			<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
				<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}script"/>
				<param name="token" value="${WASROOT}"/>
				<param name="tokenValue" value="&quot;${WAS_HOME}&quot;"/>
				<param name="fileType" value="sh"/>
		    </antcall>
			<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
				<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}script"/>
				<param name="token" value="${PROFILEROOT}"/>
				<param name="tokenValue" value="&quot;${profilePath}&quot;"/>
				<param name="fileType" value="sh"/>
		    </antcall>
			<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
				<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}script"/>
				<param name="token" value="${INPUTPROFILENAME}"/>
				<param name="tokenValue" value="${profileName}"/>
				<param name="fileType" value="sh"/>
		    </antcall>
			<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
				<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}script"/>
				<param name="token" value="${INPUTPROFILEPATH}"/>
				<param name="tokenValue" value="${profilePath}"/>
				<param name="fileType" value="sh"/>
		    </antcall>
			<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
				<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}script"/>
				<param name="token" value="${CELLNAME}"/>
				<param name="tokenValue" value="${cellName}"/>
				<param name="fileType" value="sh"/>
		    </antcall>


		<!--APPLICATIONS-->
		<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
			<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
			<param name="token" value="${PROFILENAME}"/>
			<param name="tokenValue" value="${profileName}"/>
			<param name="fileType" value="desktop"/>
	    </antcall>
		<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
			<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
			<param name="token" value="${PROFILEROOT}"/>
			<param name="tokenValue" value="${profilePath}"/>
			<param name="fileType" value="desktop"/>
	    </antcall>
		<!-- in case AdminConsole.desktop does not exist-->
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
			<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
			<param name="token" value="${CONSOLEPORT}"/>
			<param name="tokenValue" value="${WC_adminhost}"/>
			<param name="fileType" value="desktop"/>
	    </antcall>
		<!-- in case Samples.desktop does not exist-->
<!--F908-38323
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
			<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
			<param name="token" value="${SAMPLESPORT}"/>
			<param name="tokenValue" value="${WC_defaulthost}"/>
			<param name="fileType" value="desktop"/>

	    </antcall>
-->	    
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
	    <param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
	    <param name="token" value="${HOSTNAME}"/>
	    <param name="tokenValue" value="${hostName}"/>
	    <param name="fileType" value="desktop"/>
	    </antcall>

<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
	    <param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
	    <param name="token" value="${WASROOT}"/>
	    <param name="tokenValue" value="${WAS_HOME}"/>
	    <param name="fileType" value="desktop"/>
	    </antcall>
<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
			<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
			<param name="token" value="${SERVERNAME}"/>
			<param name="tokenValue" value="${serverName}"/>
			<param name="fileType" value="desktop"/>

	    </antcall>

		
		<!--MENUS-->
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}menus${separatorFile}ProfileName.menu"/>
			<param name="token" value="${PROFILENAME}"/>
			<param name="tokenValue" value="${profileName}"/>
	    </antcall>
		<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}menus${separatorFile}ProfileName.menu"/>
			<param name="token" value="${PROFILEROOT}"/>
			<param name="tokenValue" value="${profilePath}"/>
	    </antcall>

		<!--DIRECTORIES-->
	    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
			<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}directories${separatorFile}ProfileName.directory"/>
			<param name="token" value="${PROFILENAME}"/>
			<param name="tokenValue" value="${profileName}"/>
	    </antcall>

<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
	    <param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}directories"/>
	    <param name="token" value="${WASROOT}"/>
	    <param name="tokenValue" value="${WAS_HOME}"/>
	    <param name="fileType" value="directory"/>
	    </antcall>

		<!--RENAME ProfileName.directory FILES-->
		<move file="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}directories${separatorFile}ProfileName.directory" tofile="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}directories${separatorFile}${profileName}.directory"/>

		<!--RENAME ProfileName.Menu FILES-->
		<move file="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}menus${separatorFile}ProfileName.menu" tofile="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}menus${separatorFile}${profileName}.menu"/>

    </target>

    <target name="resolveResourceBundleStringForLinux" 
        if="configLinux"
        description="Resolve resourcebundle strings in profileShortCut2StartMenuDefault">
        
        <property name="BUNDLE_NAME" value="com.ibm.ws.install.configmanager.resourcebundle.ConfigManagerResourceBundle"/>
        
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.adminconsole" param="" property="adminconsole"/>
<!--        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.samplesGallery" param="" property="samplesGallery"/> -->
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.firststeps" param="" property="firststeps"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.startServer" param="" property="startServer"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.stopServer" param="" property="stopServer"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.nd.serverStart" param="" property="startServerND"/>
        <resourcebundle resourceBundleName="${BUNDLE_NAME}" resourceBundleKey="Program.nd.serverStop" param="" property="stopServerND"/>

	<!-- in case AdminConsole.desktop does not exist -->
     <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
		<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
		<param name="token" value="${ADMINCONSOLE}"/>
		<param name="tokenValue" value="${adminconsole}"/>
		<param name="fileType" value="desktop"/>
	</antcall> 
	<!-- in case Samples.desktop does not exist -->
<!--F908-38323
    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenDirectory">
		<param name="dir" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications"/>
		<param name="token" value="${SAMPLES}"/>
		<param name="tokenValue" value="${samplesGallery}"/>
		<param name="fileType" value="desktop"/>
	</antcall> 
-->
    <antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications${separatorFile}FirstSteps.desktop"/>
		<param name="token" value="${FIRSTSTEPS}"/>
		<param name="tokenValue" value="${firststeps}"/>
	</antcall> 
	<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications${separatorFile}StartServer.desktop"/>
		<param name="token" value="${STARTSERVER}"/>
		<param name="tokenValue" value="${startServer}"/>
	</antcall>
	<antcall target="replaceAllInstancesOfGivenTokenWithGivenValueForTheGivenFile">
		<param name="file" value="${profilePath}${separatorFile}properties${separatorFile}linuxMenu${separatorFile}applications${separatorFile}StopServer.desktop"/>
		<param name="token" value="${STOPSERVER}"/>
		<param name="tokenValue" value="${stopServer}"/>
	</antcall>
    </target>
    <target name="createStartMenuShortCutForLinux"
            description="Creates Start Menu shortcuts for profile created"
            if="configLinux" unless="disableWASDesktopIntegration"> 
            <property environment="env"/>
			<mkdir dir="${WS_CMT_LOG_HOME}/${profileName}"/>
            <wscmtlog>Executing /bin/sh ${profilePath}${separatorFile}properties${separatorFile}script${separatorFile}updateProfiles.menu.sh</wscmtlog>
            <wscmtlog>The output will be recorded in: ${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log</wscmtlog>
            <exec executable="/bin/sh"
            	output="${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log">
            	<arg value="${profilePath}${separatorFile}properties${separatorFile}script${separatorFile}updateProfiles.menu.sh"/>
            </exec>
			<antcall target="importLogsToMain" >
				<param name="logfile" value="${WS_CMT_LOG_HOME}/${profileName}/createShortcutForProfile.log" />
				<param name="description" value="Creating Shortcut for Profile" />
				<param name="precondition" value="foefalse" />
			</antcall>
    </target>
    <!--********************************************************-->
    <target name="createProfileShortCut2StartMenuDefault"
        description="Set firststeps batch and shell scripts to account for server installed"
        depends="detectCurrentOSFamily,
            setOSFileSeparator,
            defineOSSpecificConfigFlag,
            defineDisableWASDesktopIntegrationFlag,
            detectJSScriptExists,
            copyJScripts,
            replaceTokensForJScriptWindows,
            resolveResourceBundleString,
            createStartMenuShortCut,
            detectLinuxScriptExists,
            loadPortsDef,
            copyLinuxScripts,
            replaceTokensForLinuxScripts,
            resolveResourceBundleStringForLinux,
            createStartMenuShortCutForLinux,
            chmodScripts"/>
</project>
