    <target name="update.startmenu.xml"
    		depends="detectCurrentOS,
    			 defineOSConfigFlag,
    			 copyJScripts,
    			 replacePorts,
				 replacePortsForLinux">
    </target>   

    <target name="detectCurrentOS"
            description="Detects the current OS family (UNIX or Windows)">
        
        <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="defineOSConfigFlag"
            description="Defines either configUNIX or configWindows depending on the current OS">
            
        <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="copyJScripts"
            if="configWindows" unless="isEmbed">
            <copy todir="${profilePath}/temp">
                 <fileset dir="${WAS_HOME}/properties/version/nif/config/script">
    	              <include name="*.*"/>
    	         </fileset>
            </copy>
            <wscmtlog>Copying JScripts to: ${profilePath}${separatorFile}temp</wscmtlog>
    </target>    

    <target name="replacePorts"
    		if="configWindows" unless="isEmbed">                
    		<antcall target="replaceRegExpAllInstancesOfGivenTokenWithGivenValueForTheGivenDir">
    			<param name="port" value="WC_adminhost"/>               					
			<param name="token" value="http(.*)://(.*):(.*)/ibm/console"/>
			<param name="tokenValue" value="http\1://\2:${WC_adminhost}/ibm/console"/>
			<param name="fileType" value="js"/>
			<param name="dir" value="${profilePath}/temp"/>
    		</antcall>
		
    		<antcall target="replaceRegExpAllInstancesOfGivenTokenWithGivenValueForTheGivenDir">
    			<param name="port" value="WC_defaulthost"/>             			  			
			<param name="token" value="http(.*)://(.*):(.*)/WSsamples"/>
			<param name="tokenValue" value="http\1://\2:${WC_defaulthost}/WSsamples"/>
			<param name="fileType" value="js"/>
			<param name="dir" value="${profilePath}/temp"/>
    		</antcall>
    </target>

    <target name="replacePortsForLinux"
    		if="configLinux" unless="isEmbed">
    		<antcall target="replaceRegExpAllInstancesOfGivenTokenWithGivenValueForTheGivenDir">
    			<param name="port" value="WC_adminhost"/>               					
			<param name="token" value="http(.*)://(.*):(.*)/ibm/console"/>
			<param name="tokenValue" value="http\1://\2:${WC_adminhost}/ibm/console"/>
			<param name="fileType" value="desktop"/>			
			<param name="dir" value="${profilePath}/properties"/>
    		</antcall>
		
    		<antcall target="replaceRegExpAllInstancesOfGivenTokenWithGivenValueForTheGivenDir">
    			<param name="port" value="WC_defaulthost"/>             			  			
			<param name="token" value="http(.*)://(.*):(.*)/WSsamples"/>
			<param name="tokenValue" value="http\1://\2:${WC_defaulthost}/WSsamples"/>
			<param name="fileType" value="desktop"/>
			<param name="dir" value="${profilePath}/properties"/>
    		</antcall>
    </target>
