Initial commit: Inno Setup installer packages
Installer packages for GE manufacturing tools: - BlueSSOFix: Blue SSO authentication fix - HIDCardPrinter: HID card printer setup - HPOfflineInstaller: HP printer offline installer - MappedDrive: Network drive mapping - PrinterInstaller: General printer installer - ShopfloorConnect: Shopfloor connectivity tool - XeroxOfflineInstaller: Xerox printer offline installer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
|
||||
<!-- NET Framework 2.0, 3.0 und 3.5: "v2.0.50727" -->
|
||||
<supportedRuntime version="v2.0.50727" sku="Client"/>
|
||||
<!-- NET Framework 4 und 4.5 (einschließlich Punktreleases wie 4.5.1): „v4.0“ -->
|
||||
<supportedRuntime version="v4.0"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,587 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project default="doinstall" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
|
||||
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
|
||||
<taskdef resource="com/sardak/antform/taskdefs.properties"/>
|
||||
|
||||
<loadfile property="VERSION" srcFile="${INST_DIR}/version.txt">
|
||||
<filterchain>
|
||||
<striplinebreaks/>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
|
||||
<property environment="env"/>
|
||||
<hostinfo/>
|
||||
|
||||
<!-- Set Default values if not received via args... -->
|
||||
<property name="sfcMtcRegisterAsService" value="true"/>
|
||||
<property name="sfcMtcServiceName" value="SFCMTCService"/>
|
||||
<property name="sfcMtcServiceStartupType" value="delayed"/>
|
||||
<property name="sfcMtcPortHttp" value="8090"/>
|
||||
<property name="sfcMtcPortHttps" value="8493"/>
|
||||
<property name="sfcMtcPortShutdown" value="8006"/>
|
||||
<property name="sfcHost" value="localhost"/>
|
||||
<property name="sfcPort" value="8888"/>
|
||||
<property name="sfcUseSecureCommunication" value="false"/>
|
||||
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="msw" />
|
||||
<then>
|
||||
<property name="isMsWin" value="true" />
|
||||
<property name="isUnix" value="false" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="isUnix" value="true" />
|
||||
<property name="isMsWin" value="false" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<target name="doinstallStandAlone">
|
||||
|
||||
<property name="sfcMtcHostName" value="${NAME}" />
|
||||
|
||||
<echo message="===================================================================="/>
|
||||
<echo message="Install Shop Floor Connect Machine Tool Client Service ${VERSION}"/>
|
||||
<echo message="===================================================================="/>
|
||||
<echo message="OS Name is: ${os.name}" />
|
||||
<echo message="OS Version is: ${os.version}" />
|
||||
<echo message="OS User Name is: ${user.name}" />
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<!-- Find server dir which contains SFC_base.jar.xz -->
|
||||
<local name="BASE_JAR_DIR"/>
|
||||
<last id="first">
|
||||
<sort id="src.files">
|
||||
<dirset id="dist.contents" dir="${INST_DIR}${file.separator}.." includes="Server*"/>
|
||||
<date />
|
||||
</sort>
|
||||
</last>
|
||||
<property name="prop.dist.contents" refid="dist.contents"/>
|
||||
<property name="BASE_JAR_DIR" value="${toString:first}"></property>
|
||||
|
||||
<echo message="Base package dir: ${BASE_JAR_DIR}"/>
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<if>
|
||||
<contains string="${BASE_JAR_DIR}" substring="server" casesensitive="false"/>
|
||||
<then>
|
||||
</then>
|
||||
<else>
|
||||
<fail message="No Server directory found in '${INST_DIR}${file.separator}..' to extract base package SFC_Base" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<isset property="sfcMtcInstallationPath"></isset>
|
||||
<then>
|
||||
<echo message="Received installation path via command line: ${sfcMtcInstallationPath}"/>
|
||||
</then>
|
||||
<else>
|
||||
<fail message="Silent installation mode enabled but 'sfcMtcInstallationPath' not specified!" if:true="${silent}" />
|
||||
|
||||
<antform title="Install ShopFloorConnect MachineToolClient Service" image="install/siemens_ab_logo_trans_klein.png">
|
||||
<label>Please select the directory into which you want to install\n SFC MTC Service.</label>
|
||||
<label>A subdirectory named "ShopFloorConnect" will be created there.</label>
|
||||
<fileSelectionProperty label="Installation directory: "
|
||||
property="sfcMtcInstallationPath"
|
||||
directoryChooser="true" Required="true"/>
|
||||
<separator/>
|
||||
<label>Please set TCP port numbers for service to listen on:</label>
|
||||
<textProperty label="HTTP Port" property="sfcMtcPortHttp" />
|
||||
<textProperty label="HTTPs Port" property="sfcMtcPortHttps" />
|
||||
<textProperty label="Shutdown Port" property="sfcMtcPortShutdown" />
|
||||
<separator if:true="${isMsWin}" />
|
||||
<booleanProperty label="Register as windows service" property="sfcMtcRegisterAsService" if:true="${isMsWin}"/>
|
||||
<textProperty label="Service Name" property="sfcMtcServiceName" if:true="${isMsWin}"/>
|
||||
<selectionProperty label="Service startup type" property="sfcMtcServiceStartupType" values="delayed,auto,manual" if:true="${isMsWin}"/>
|
||||
<textProperty label="Service user name" property="sfcMtcServiceUserName" if:true="${isMsWin}" />
|
||||
<textProperty label="Service user password" property="sfcMtcServiceUserPassword" password="true" if:true="${isMsWin}" />
|
||||
<separator if:true="${isUnix}" />
|
||||
<booleanProperty label="Register as systemd service" property="sfcMtcRegisterAsService" if:true="${isUnix}"/>
|
||||
<textProperty label="Service Name" property="sfcMtcServiceName" if:true="${isUnix}"/>
|
||||
<selectionProperty label="Service startup type" property="sfcMtcServiceStartupType" values="auto,manual" if:true="${isUnix}"/>
|
||||
<textProperty label="sudo password" property="sfcMtcServiceUserPassword" password="true" if:true="${isUnix}" />
|
||||
<separator />
|
||||
<label>Please set ShopFloorConnect Server data:</label>
|
||||
<textProperty label="SFC Host" property="sfcHost" />
|
||||
<textProperty label="SFC Port" property="sfcPort" />
|
||||
<textProperty label="Local Hostname" property="sfcMtcHostName" />
|
||||
<booleanProperty label="Secure communication" property="sfcUseSecureCommunication" />
|
||||
<separator />
|
||||
<controlbar>
|
||||
<button label="OK" type="ok"></button>
|
||||
<button label="Reset values" type="reset"></button>
|
||||
<button label="Cancel" type="cancel" target="onCancel"></button>
|
||||
</controlbar>
|
||||
</antform>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<matches string="${sfcMtcInstallationPath}" pattern="^.+ShopFloorConnect$"/>
|
||||
<then>
|
||||
<property name="BASE_DIR" value="${sfcMtcInstallationPath}" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="BASE_DIR" value="${sfcMtcInstallationPath}${file.separator}ShopFloorConnect" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<echo message="Installaton path: ${BASE_DIR}"/>
|
||||
<echo message="--------------------------------------------------------------------"/>
|
||||
<echo message="HTTP port: ${sfcMtcPortHttp}"/>
|
||||
<echo message="HTTPs port: ${sfcMtcPortHttps}"/>
|
||||
<echo message="Shutdown port: ${sfcMtcPortShutdown}"/>
|
||||
<echo message="--------------------------------------------------------------------"/>
|
||||
<echo message="Register service: ${sfcMtcRegisterAsService}" />
|
||||
<echo message="Service name: ${sfcMtcServiceName}"/>
|
||||
<echo message="Service Startup: ${sfcMtcServiceStartupType}"/>
|
||||
<echo message="Service Username: ${sfcMtcServiceUserName}" if:true="${isMsWin}"/>
|
||||
<echo message="--------------------------------------------------------------------"/>
|
||||
<echo message="SFC Server host: ${sfcHost}"/>
|
||||
<echo message="SFC Server port: ${sfcPort}"/>
|
||||
<echo message="SFC secure comm.: ${sfcUseSecureCommunication}"/>
|
||||
<echo message="Local Hostname: ${sfcMtcHostName}"/>
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<fail message="Installation path '${BASE_DIR}${file.separator}FIT-MI_Server' already exists!">
|
||||
<condition>
|
||||
<available file="${BASE_DIR}${file.separator}FIT-MI_Server" type="dir" />
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
<if>
|
||||
<available file="${BASE_DIR}" type="dir" />
|
||||
<then>
|
||||
<echo message="Installation path '${BASE_DIR}' already exists! Install SFC_MTCService into this directory." />
|
||||
<property name="isStandAlone" value="false" />
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Do standalone installation of SFC_MTCService..." />
|
||||
<property name="isStandAlone" value="true" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<input message="Press enter to continue" unless:true="${silent}"/>
|
||||
<echo message="Create directory ${BASE_DIR}" if:true="${isStandAlone}" />
|
||||
<mkdir dir="${BASE_DIR}" if:true="${isStandAlone}"/>
|
||||
|
||||
<property name="TEMP_DIR" value="${BASE_DIR}${file.separator}install_temp" />
|
||||
<mkdir dir="${TEMP_DIR}" />
|
||||
|
||||
<property name="DST_DIR" value="${BASE_DIR}${file.separator}FIT-MI_Server" />
|
||||
<echo message="Install to directory: ${DST_DIR}"/>
|
||||
|
||||
|
||||
<echo message="Extract SFC_Base.jar into ${TEMP_DIR}" if:true="${isStandAlone}"/>
|
||||
<unxz src="${BASE_JAR_DIR}${file.separator}SFC_Base.jar.xz" dest="${TEMP_DIR}${file.separator}SFC_Base.jar" if:true="${isStandAlone}"/>
|
||||
<unjar src="${TEMP_DIR}${file.separator}SFC_Base.jar" dest="${BASE_DIR}" if:true="${isStandAlone}">
|
||||
<patternset>
|
||||
<exclude name="Java/" if:true="${isUnix}"/>
|
||||
</patternset>
|
||||
</unjar>
|
||||
|
||||
<delete failonerror="false" file="${TEMP_DIR}${file.separator}SFC_Base.jar" if:true="${isStandAlone}"/>
|
||||
<delete failonerror="false" file="${BASE_DIR}${file.separator}Java${file.separator}JavaService.exe" if:true="${isStandAlone}"/>
|
||||
|
||||
<mkdir dir="${BASE_DIR}${file.separator}conf" if:true="${isStandAlone}"/>
|
||||
|
||||
<property name="j.home" value="${BASE_DIR}${file.separator}java${file.separator}j2sdk"></property>
|
||||
<antcall target="check"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="onCancel">
|
||||
<fail message="Installation canceled!"/>
|
||||
</target>
|
||||
|
||||
<target name="doinstall">
|
||||
<property name="TEMP_DIR" value="${BASE_DIR}${file.separator}install_temp" />
|
||||
<property name="isStandAlone" value="false" />
|
||||
<property name="sfcMtcHostName" value="localhost" />
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<echo message="Install Machine Tool Client Service Version ${VERSION}"/>
|
||||
<echo message=" for Shop Floor Connect for Teamcenter"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Install Fit-MI_Server Version ${VERSION}"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<echo message="===================================================="/>
|
||||
<echo message="Install to directory: ${DST_DIR}"/>
|
||||
|
||||
<antcall target="check"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="check">
|
||||
<available file="${DST_DIR}" type="dir" property="MI_EXIST" />
|
||||
<if>
|
||||
<not><equals arg1="${MI_EXIST}" arg2="true" /></not>
|
||||
<then>
|
||||
<echo message="Start installation..." />
|
||||
|
||||
<antcall target="extract"/>
|
||||
<antcall target="copy"/>
|
||||
<antcall target="prep_configFiles"/>
|
||||
<antcall target="cleanup"/>
|
||||
|
||||
<echo message="Saving configuration data..." />
|
||||
<mkdir dir="${BASE_DIR}${file.separator}conf${file.separator}install" />
|
||||
<propertyfile file="${BASE_DIR}${file.separator}conf${file.separator}install${file.separator}configuration.properties">
|
||||
<entry key="sfcMtcPortHttp" value="${sfcMtcPortHttp}" if:set="sfcMtcPortHttp"/>
|
||||
<entry key="sfcMtcPortHttps" value="${sfcMtcPortHttps}" if:set="sfcMtcPortHttps"/>
|
||||
<entry key="sfcMtcPortShutdown" value="${sfcMtcPortShutdown}" if:set="sfcMtcPortShutdown"/>
|
||||
<entry key="sfcMtcRegisterAsService" value="${sfcMtcRegisterAsService}" if:set="sfcMtcRegisterAsService"/>
|
||||
<entry key="sfcMtcServiceName" value="${sfcMtcServiceName}" if:set="sfcMtcServiceName"/>
|
||||
<entry key="sfcMtcServiceStartupType" value="${sfcMtcServiceStartupType}" if:set="sfcMtcServiceStartupType"/>
|
||||
<entry key="sfcMtcServiceUserName" value="${sfcMtcServiceUserName}" if:set="sfcMtcServiceUserName"/>
|
||||
</propertyfile>
|
||||
|
||||
</then>
|
||||
<else>
|
||||
<fail message="Service already exist! Please execute update!" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="extract">
|
||||
<mkdir dir="${TEMP_DIR}" />
|
||||
<echo message="Extract mi_server.jar into ${TEMP_DIR}"/>
|
||||
<unjar src="${INST_DIR}/mi_server.jar" dest="${TEMP_DIR}">
|
||||
</unjar>
|
||||
</target>
|
||||
|
||||
<target name="cleanup">
|
||||
<echo message="Cleanup directory ${TEMP_DIR}"/>
|
||||
<delete dir="${TEMP_DIR}" />
|
||||
|
||||
<!-- Remove not required UNIX or WIN files -->
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<!-- chmod ausführen -->
|
||||
<chmod dir="${DST_DIR}/Tomcat 5.0/bin" perm="u+x" includes="**/*.sh"/>
|
||||
<!-- Windows batch löschen -->
|
||||
<delete failonerror="false">
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.bat"/>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.dll"/>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.exe"/>
|
||||
<fileset dir="${BASE_DIR}/bin" includes="**/*.bat"/>
|
||||
<fileset dir="${BASE_DIR}" includes="**/*.bat"/>
|
||||
</delete>
|
||||
</then>
|
||||
<else>
|
||||
<!-- Unix scripte löschen -->
|
||||
<delete failonerror="false">
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.sh"/>
|
||||
<fileset dir="${BASE_DIR}/bin" includes="**/*.sh"/>
|
||||
<fileset dir="${BASE_DIR}" includes="**/*.sh"/>
|
||||
</delete>
|
||||
<delete dir="${DST_DIR}/bin/init.d_scripts" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- Remove not required scripts -->
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<delete>
|
||||
<filelist dir="${DST_DIR}/Tomcat 5.0/bin">
|
||||
<file name="FIT_MI_Tomcat_service.bat"/>
|
||||
<file name="FIT_MI-Configure.bat"/>
|
||||
<file name="FIT_MI-Monitor.bat"/>
|
||||
<file name="install_fit.bat"/>
|
||||
<file name="remove_fit.bat"/>
|
||||
<file name="setenv_fit.bat"/>
|
||||
<file name="setenv_fit.sh"/>
|
||||
</filelist>
|
||||
</delete>
|
||||
</then>
|
||||
<else>
|
||||
<delete>
|
||||
<filelist dir="${DST_DIR}/Tomcat 5.0/bin">
|
||||
<file name="FIT4TC_MI_Tomcat_service.bat"/>
|
||||
<file name="install_fit4tc.bat"/>
|
||||
<file name="remove_fit4tc.bat"/>
|
||||
<file name="setenv_fit4tc.bat"/>
|
||||
<file name="setenv_fit4tc.sh"/>
|
||||
</filelist>
|
||||
</delete>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="copy">
|
||||
<echo message="Copy files for Apache Tomcat"/>
|
||||
<copy todir="${DST_DIR}/Tomcat 5.0" verbose="true" >
|
||||
<fileset dir="${TEMP_DIR}/Tomcat 5.0">
|
||||
<exclude name="**/*.java"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<echo message="Copy files for MI Server"/>
|
||||
<copy todir="${DST_DIR}/webapps" verbose="true" >
|
||||
<fileset dir="${TEMP_DIR}/webapps">
|
||||
</fileset>
|
||||
</copy>
|
||||
<echo message="Copy bin files"/>
|
||||
<copy todir="${DST_DIR}/bin" verbose="true">
|
||||
<fileset dir="${TEMP_DIR}/bin">
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" file="${TEMP_DIR}/version.txt" tofile="${DST_DIR}/version.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/tomcat-version.txt" tofile="${DST_DIR}/tomcat-version.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/ChangeLog_de.txt" tofile="${DST_DIR}/ChangeLog_de.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/ChangeLog_en.txt" tofile="${DST_DIR}/ChangeLog_en.txt" />
|
||||
<mkdir dir="${DST_DIR}/Tomcat 5.0/temp" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="prep_configFiles" >
|
||||
<echo message="Prepare configuration files..." />
|
||||
|
||||
<!-- Logback.xml vorhanden? -->
|
||||
<available file="${DST_DIR}/webapps/wut/WEB-INF/conf/logback.xml" property="av_log4j" />
|
||||
<if>
|
||||
<not><equals arg1="${av_log4j}" arg2="true" /></not>
|
||||
<then>
|
||||
<echo message="logback.xml doesn't exist. Create..." />
|
||||
<copy file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.${INST_SYS}" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/logback.xml" />
|
||||
|
||||
</then>
|
||||
<else>
|
||||
<echo message="logback.xml already exist! Please compare with the new one!" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" /> <!-- <equals arg1="${os.name}" arg2="Linux"/> -->
|
||||
<then>
|
||||
<!-- setenv.sh -->
|
||||
<echo message="Create setenv.sh" />
|
||||
<copy file="${DST_DIR}/Tomcat 5.0/bin/setenv_${INST_SYS}.sh" tofile="${DST_DIR}/Tomcat 5.0/bin/setenv.sh" />
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/bin/setenv.sh" token="${JAVA_HOME}" value="${j.home}"/>
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/bin/setenv.sh" token="@@TCFITDIR@@" value="${BASE_DIR}"/>
|
||||
|
||||
<!-- chmod ausführen -->
|
||||
<chmod dir="${DST_DIR}/Tomcat 5.0/bin" perm="u+x" includes="**/*.sh"/>
|
||||
<chmod dir="${DST_DIR}/bin/init.d_scripts/Linux" perm="u+x" includes="**/*.sh"/>
|
||||
|
||||
<copy verbose="true" file="${DST_DIR}/bin/init.d_scripts/Linux/SFC_MTCServer.sh" tofile="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh"/>
|
||||
<copy verbose="true" file="${DST_DIR}/bin/init.d_scripts/Linux/systemd/SFC_MTCServer.service" tofile="${BASE_DIR}/etc/systemd/SFC_MTCServer.service"/>
|
||||
|
||||
<replace file="${BASE_DIR}/etc/systemd/SFC_MTCServer.service" token="@@TCFITDIR@@" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/etc/systemd/SFC_MTCServer.service" token="@@OSUSERNAME@@" value="${user.name}"/>
|
||||
<replace file="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh" token="@@TCFITDIR@@" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh" token="@@OSUSERNAME@@" value="${user.name}"/>
|
||||
|
||||
<chmod dir="${BASE_DIR}/etc/init.d" perm="u+x" includes="**/*.sh"/>
|
||||
<chmod dir="${BASE_DIR}/etc/systemd" perm="u+x" includes="**/*.sh **/*.service"/>
|
||||
|
||||
<echo message="Register systemd service..." if:true="${sfcMtcRegisterAsService}"/>
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<if>
|
||||
<equals arg1="${sfcMtcServiceName}" arg2="SFCMTCService" />
|
||||
<then>
|
||||
<property name="SystemdServiceFile" value="${BASE_DIR}/etc/systemd/SFC_MTCServer.service"/>
|
||||
<property name="SystemdServiceFileName" value="SFC_MTCServer.service"/>
|
||||
</then>
|
||||
<else>
|
||||
<copy verbose="true" file="${BASE_DIR}/etc/systemd/SFC_MTCServer.service" tofile="${BASE_DIR}/etc/systemd/SFC_MTCServer.${sfcMtcServiceName}.service"/>
|
||||
<property name="SystemdServiceFile" value="${BASE_DIR}/etc/systemd/SFC_MTCServer.${sfcMtcServiceName}.service"/>
|
||||
<property name="SystemdServiceFileName" value="SFC_MTCServer.${sfcMtcServiceName}.service"/>
|
||||
</else>
|
||||
</if>
|
||||
<echo message=" Using sudo to register systemd service description..." />
|
||||
<shellscript shell="sh" dir="${BASE_DIR}/etc/systemd" osfamily="unix">
|
||||
if [ "${sfcMtcServiceUserPassword}" = "" ]
|
||||
then sudo cp ${SystemdServiceFile} /etc/systemd/system
|
||||
else echo "${sfcMtcServiceUserPassword}" | sudo -S cp ${SystemdServiceFile} /etc/systemd/system
|
||||
fi
|
||||
sudo systemctl daemon-reload
|
||||
if [ "${sfcMtcServiceStartupType}" = "auto" ]
|
||||
then sudo systemctl enable ${SystemdServiceFileName}
|
||||
fi
|
||||
</shellscript>
|
||||
</then>
|
||||
<else>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</then>
|
||||
<else>
|
||||
<if>
|
||||
<equals arg1="${os.arch}" arg2="x86" />
|
||||
<then>
|
||||
<echo message="Install 32bit Tomcat Service Wrapper..." />
|
||||
<copy overwrite="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_32.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}.exe" />
|
||||
<copy overwrite="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_64.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}_64.exe" />
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Install 64bit Tomcat Service Wrapper..." />
|
||||
<copy overwrite="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_32.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}_32.exe" />
|
||||
<copy overwrite="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_64.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}.exe" />
|
||||
</else>
|
||||
</if>
|
||||
<copy overwrite="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8w_32.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}w.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_32.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_64.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8w_32.exe" />
|
||||
|
||||
<!-- setenv.sh -->
|
||||
<echo message="Create setenv.bat" />
|
||||
<copy file="${DST_DIR}/Tomcat 5.0/bin/setenv_${INST_SYS}.bat" tofile="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" />
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" token="%TCFITDIR%" value="${BASE_DIR}"/>
|
||||
|
||||
<!-- instal_...bat ausführen -->
|
||||
<echo message="Register Windows service..." if:true="${sfcMtcRegisterAsService}"/>
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<exec executable="SFC_MTC_Tomcat_service.bat" dir="${DST_DIR}/Tomcat 5.0/bin" resolveexecutable="true" if:true="${sfcMtcRegisterAsService}">
|
||||
<env key="TCFITDIR" value="${BASE_DIR}"/>
|
||||
<arg value="install"/>
|
||||
<arg value="${sfcMtcServiceName}"/>
|
||||
<arg value="${sfcMtcServiceStartupType}" />
|
||||
<arg value="${sfcMtcServiceUserName}" if:set="sfcMtcServiceUserName"/>
|
||||
<arg value="${sfcMtcServiceUserPassword}" if:set="sfcMtcServiceUserPassword"/>
|
||||
</exec>
|
||||
</then>
|
||||
<else>
|
||||
<exec executable="install_${INST_SYS}.bat" dir="${DST_DIR}/Tomcat 5.0/bin" resolveexecutable="true" if:true="${sfcMtcRegisterAsService}">
|
||||
<env key="TCFITDIR" value="${BASE_DIR}"/>
|
||||
<env key="FITDIR" value="${BASE_DIR}"/>
|
||||
</exec>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${isStandAlone}" arg2="true" />
|
||||
<then>
|
||||
<echo message="Create selfsigned TLS certificates..." />
|
||||
|
||||
<exec dir="${BASE_DIR}${file.separator}bin" executable="cmd" osfamily="windows">
|
||||
<arg value="/c" />
|
||||
<arg value="gen_ssl_cert.bat" />
|
||||
<arg value="${NAME}" />
|
||||
</exec>
|
||||
|
||||
<exec dir="${BASE_DIR}${file.separator}bin" executable="/bin/sh" osfamily="unix">
|
||||
<arg value="gen_ssl_cert.sh" />
|
||||
<arg value="${NAME}" />
|
||||
</exec>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<replace file="${BASE_DIR}/saveLogFile.sh" token="${TCFITDIR}" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/saveLogFile.bat" token="Tomcat 5.0\lib\" value="FIT-MI_Server/webapps/wut/WEB-INF/lib/"/>
|
||||
</then>
|
||||
<else>
|
||||
<replace file="${BASE_DIR}/saveLogFile.bat" token="%TCFITDIR%" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/saveLogFile.bat" token="Tomcat 5.0\lib\" value="FIT-MI_Server\webapps\wut\WEB-INF\lib\"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<copy overwrite="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.SFC" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini" />
|
||||
|
||||
<if>
|
||||
<equals arg1="${sfcUseSecureCommunication}" arg2="true" />
|
||||
<then>
|
||||
<replace file="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini">
|
||||
<replacefilter token="fsw_ip = localhost" value="fsw_ip = ${sfcHost}"/>
|
||||
<replacefilter token="fsw_port = 8888/tcdnc/services" value="fsw_port = ${sfcPort}/tcdnc/services"/>
|
||||
<replacefilter token="fsw_protocol = http" value="fsw_protocol = https"/>
|
||||
<replacefilter token="local_port = 8090" value="local_port = ${sfcMtcPortHttps}"/>
|
||||
<replacefilter token="local_ip = localhost" value="local_ip = ${sfcMtcHostName}"/>
|
||||
</replace>
|
||||
</then>
|
||||
<else>
|
||||
<replace file="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini">
|
||||
<replacefilter token="fsw_ip = localhost" value="fsw_ip = ${sfcHost}"/>
|
||||
<replacefilter token="fsw_port = 8888/tcdnc/services" value="fsw_port = ${sfcPort}/tcdnc/services"/>
|
||||
<replacefilter token="local_port = 8090" value="local_port = ${sfcMtcPortHttp}"/>
|
||||
<replacefilter token="local_ip = localhost" value="local_ip = ${sfcMtcHostName}"/>
|
||||
</replace>
|
||||
</else>
|
||||
</if>
|
||||
<if>
|
||||
<equals arg1="${os.name}" arg2="Linux"/>
|
||||
<then>
|
||||
<copy verbose="true" file="${DST_DIR}/bin/init.d_scripts/Linux/SFC_MTCServer.sh" tofile="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh"/>
|
||||
<copy verbose="true" file="${DST_DIR}/bin/init.d_scripts/Linux/systemd/SFC_MTCServer.service" tofile="${BASE_DIR}/etc/systemd/SFC_MTCServer.service"/>
|
||||
|
||||
<replace file="${BASE_DIR}/etc/systemd/SFC_MTCServer.service" token="@@TCFITDIR@@" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/etc/systemd/SFC_MTCServer.service" token="@@OSUSERNAME@@" value="${user.name}"/>
|
||||
<replace file="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh" token="@@TCFITDIR@@" value="${BASE_DIR}"/>
|
||||
<replace file="${BASE_DIR}/etc/init.d/SFC_MTCServer.sh" token="@@OSUSERNAME@@" value="${user.name}"/>
|
||||
|
||||
<chmod dir="${BASE_DIR}/etc/init.d" perm="u+x" includes="**/*.sh"/>
|
||||
<chmod dir="${BASE_DIR}/etc/systemd" perm="u+x" includes="**/*.sh **/*.service"/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Prepare HTTPS -->
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<replacefilter token="@@CERTKEYALIAS@@" value="SFC_Server"/>
|
||||
<replacefilter token="@@CERTKEYSTOREFILE@@" value="../../conf/mykeystore.ks"/>
|
||||
<replacefilter token="@@CERTKEYSTOREPWD@@" value="aplusbpwd"/>
|
||||
<replacefilter token="@@CERTKEYPWD@@" value="aplusbpwd"/>
|
||||
</replace>
|
||||
|
||||
<!-- Delete FIT related configuration files -->
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/machine1.properties" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/opcua1.properties" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/sinrpc_db_config.ini.default" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/genius-upload.templ.default" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit" />
|
||||
<move failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit4tc" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.default" />
|
||||
</then>
|
||||
<else>
|
||||
<copy overwrite="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.FIT" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini" />
|
||||
|
||||
<!-- Bug 4409: Use new Java directory -->
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" token="@@JAVA_HOME@@" value="${j.home}"/>
|
||||
|
||||
<!-- Prepare HTTPS -->
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<replacefilter token="@@CERTKEYALIAS@@" value="tomcat"/>
|
||||
<replacefilter token="@@CERTKEYSTOREFILE@@" value="${FITDIR}/run/bin/Tomcat 5.0/conf/ABkeystore.ks"/>
|
||||
<replacefilter token="@@CERTKEYSTOREPWD@@" value="AplusBpwd2015"/>
|
||||
<replacefilter token="@@CERTKEYPWD@@" value="AplusBpwd2015"/>
|
||||
</replace>
|
||||
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit4tc" />
|
||||
<move failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.default" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<replacefilter token="@@SHUTDOWNPORT@@" value="${sfcMtcPortShutdown}"/>
|
||||
<replacefilter token="@@HTTPPORT@@" value="${sfcMtcPortHttp}"/>
|
||||
<replacefilter token="@@HTTPSPORT@@" value="${sfcMtcPortHttps}"/>
|
||||
</replace>
|
||||
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.SFC" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.FIT" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,830 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project default="update" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
|
||||
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
|
||||
<taskdef resource="com/sardak/antform/taskdefs.properties"/>
|
||||
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>
|
||||
<taskdef name="RequireConfirmOverwrite" classname="com.aplusb.utils.AntSetupTaks.RequireConfirmOverwrite"/>
|
||||
|
||||
<macrodef name="serviceStop">
|
||||
<sequential>
|
||||
<echo message="Stop running service using shutdown script..." />
|
||||
<exec executable="shutdown.bat" dir="${DST_DIR}\Tomcat 5.0\bin" resolveexecutable="true" osfamily="windows" discardError="true"/>
|
||||
<exec executable="shutdown.sh" dir="${DST_DIR}/Tomcat 5.0/bin" resolveexecutable="true" osfamily="unix" discardError="true"/>
|
||||
|
||||
<echo message="Wait 10 seconds for service shutdown complete..." />
|
||||
<sleep seconds="10" />
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<tstamp/>
|
||||
|
||||
|
||||
<loadfile property="VERSION" srcFile="${INST_DIR}/version.txt">
|
||||
<filterchain>
|
||||
<striplinebreaks/>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="msw" />
|
||||
<then>
|
||||
<property name="isMsWin" value="true" />
|
||||
<property name="isUnix" value="false" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="isUnix" value="true" />
|
||||
<property name="isMsWin" value="false" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<target name="onCancel">
|
||||
<fail message="Update canceled!"/>
|
||||
</target>
|
||||
|
||||
<target name="doUpdateStandAlone">
|
||||
|
||||
<if>
|
||||
<isset property="sfcMtcInstallationPath"></isset>
|
||||
<then>
|
||||
<echo message="Received installation path via command line: ${sfcMtcInstallationPath}"/>
|
||||
</then>
|
||||
<else>
|
||||
<fail message="Missing '-DsfcMtcInstallationPath' and silent installation mode enabled! Can't start update!" if:true="${silent}" />
|
||||
|
||||
<antform title="Select installation directory" image="install/siemens_ab_logo_trans_klein.png">
|
||||
<label>Please select the base directory to update SFC MTC Service.</label>
|
||||
<label>A subdirectory named "ShopFloorConnect" is inside this directory.</label>
|
||||
<separator/>
|
||||
<fileSelectionProperty label="Base directory: "
|
||||
property="sfcMtcInstallationPath"
|
||||
directoryChooser="true" Required="true"/>
|
||||
<controlbar>
|
||||
<button label="OK" type="ok"></button>
|
||||
<button label="Reset values" type="reset"></button>
|
||||
<button label="Cancel" type="cancel" target="onCancel"></button>
|
||||
</controlbar>
|
||||
</antform>
|
||||
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<matches string="${sfcMtcInstallationPath}" pattern="^.+ShopFloorConnect$"/>
|
||||
<then>
|
||||
<property name="BASE_DIR" value="${sfcMtcInstallationPath}" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="BASE_DIR" value="${sfcMtcInstallationPath}${file.separator}ShopFloorConnect" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<fail message="Installation path '${BASE_DIR}' doesn't exists!">
|
||||
<condition>
|
||||
<not><available file="${BASE_DIR}" type="dir" /></not>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
<if>
|
||||
<available file="${BASE_DIR}${file.separator}webapps" type="dir" />
|
||||
<then>
|
||||
<property name="isStandAlone" value="false" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="isStandAlone" value="true" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- Set logfile. BASE_DIR points to (TC)FITDIR -->
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<property name="update.log.filename" value="${BASE_DIR}/log/update_MTC_${DSTAMP}${TSTAMP}.log"/>
|
||||
</then>
|
||||
<else>
|
||||
<property name="update.log.filename" value="${BASE_DIR}/run/log/update_MIServer_${DSTAMP}${TSTAMP}.log"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<record name="${update.log.filename}"
|
||||
loglevel="info" append="true"/>
|
||||
|
||||
<echo message="===================================================================="/>
|
||||
<echo message="Update Shop Floor Connect Machine Tool Client Service to ${VERSION}"/>
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<echo message="Installaton path: ${BASE_DIR}"/>
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<!-- Find server dir which contains SFC_base.jar.xz -->
|
||||
<last id="first">
|
||||
<sort id="src.files">
|
||||
<dirset id="dist.contents" dir="${INST_DIR}${file.separator}.." includes="Server*"/>
|
||||
<date />
|
||||
</sort>
|
||||
</last>
|
||||
<property name="prop.dist.contents" refid="dist.contents"/>
|
||||
<property name="BASE_JAR_DIR" value="${toString:first}"></property>
|
||||
|
||||
<echo message="Base package dir: ${BASE_JAR_DIR}"/>
|
||||
<echo message="===================================================================="/>
|
||||
|
||||
<if>
|
||||
<contains string="${BASE_JAR_DIR}" substring="server" casesensitive="false"/>
|
||||
<then>
|
||||
</then>
|
||||
<else>
|
||||
<fail message="No Server directory found in '${INST_DIR}${file.separator}..' to extract base package SFC_Base" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<input message="Press enter to continue" unless:true="${silent}"/>
|
||||
|
||||
<property name="DST_DIR" value="${BASE_DIR}${file.separator}FIT-MI_Server"></property>
|
||||
<antcall target="update" />
|
||||
</target>
|
||||
|
||||
<target name="update" >
|
||||
|
||||
<property name="TEMP_DIR" value="${BASE_DIR}/update_temp" />
|
||||
<!-- Set logfile. BASE_DIR points to (TC)FITDIR -->
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<property name="update.log.filename" value="${BASE_DIR}/log/update_MTC_${DSTAMP}${TSTAMP}.log"/>
|
||||
</then>
|
||||
<else>
|
||||
<property name="update.log.filename" value="${BASE_DIR}/run/log/update_MIServer_${DSTAMP}${TSTAMP}.log"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<record name="${update.log.filename}"
|
||||
loglevel="info" append="true"/>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<echo message="Update Machine Tool Client Service"/>
|
||||
<echo message=" for Shop Floor Connect for Teamcenter"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Update Fit-MI_Server"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<available file="${DST_DIR}/Version.txt" property="ov" />
|
||||
<if>
|
||||
<equals arg1="${ov}" arg2="true" />
|
||||
<then>
|
||||
<move file="${DST_DIR}/Version.txt" tofile="${DST_DIR}/version.txt" />
|
||||
</then>
|
||||
</if>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<loadfile property="OLDVERSION" srcFile="${DST_DIR}/version.txt">
|
||||
<filterchain>
|
||||
<striplinebreaks/>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
|
||||
<echo message="================================"/>
|
||||
<echo message="Update of directory: ${DST_DIR}"/>
|
||||
<echo message="Update to Version: ${VERSION}" />
|
||||
<echo message="Installed Version is: ${OLDVERSION}" />
|
||||
|
||||
<if unless:true="${silent}">
|
||||
<matches string="${VERSION}" pattern="^.*\(testBuild\)$"/>
|
||||
<then>
|
||||
<echo message="Install a test build, skip version checks..." />
|
||||
<property name="confirmOverwrite" value="false"/>
|
||||
</then>
|
||||
<else>
|
||||
<if>
|
||||
<matches string="${OLDVERSION}" pattern="^.*\(testBuild\)$"/>
|
||||
<then>
|
||||
<echo message="Update a test build, skip version checks..." />
|
||||
<property name="confirmOverwrite" value="false"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Check for downgrade..." />
|
||||
<!--Check old and new build number... -->
|
||||
<RequireConfirmOverwrite oldVersion="${OLDVERSION}" newVersion="${VERSION}" property="confirmOverwrite"/>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${confirmOverwrite}" arg2="true" />
|
||||
<then>
|
||||
<input message="Overwrite installed version '${OLDVERSION}' with version '${VERSION}'?" validargs="y,n" addproperty="ask.overwrite"/>
|
||||
<if>
|
||||
<equals arg1="${ask.overwrite}" arg2="n" />
|
||||
<then>
|
||||
<echo message="Update aborted by user, existing version '${OLDVERSION}' should not be overwritten with '${VERSION}'!" />
|
||||
<fail>Update aborted by user, existing version should not be overwritten!</fail>
|
||||
</then>
|
||||
</if>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<serviceStop />
|
||||
|
||||
<if>
|
||||
<isset property="isStandAlone" />
|
||||
<then>
|
||||
<echo message="Skip Java version check for standalone update, Java will be updated!" />
|
||||
<antcall target="doupdate"/>
|
||||
</then>
|
||||
<else>
|
||||
<antcall target="check_java" />
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="check_java" >
|
||||
<echo message="Check installed java version..." />
|
||||
<echo message="Needed version is: 11" />
|
||||
<echo message="Installed version is: ${java.specification.version}" />
|
||||
<if>
|
||||
<or>
|
||||
<equals arg1="${java.specification.version}" arg2="11"/>
|
||||
<equals arg1="${java.specification.version}" arg2="12"/>
|
||||
<equals arg1="${java.specification.version}" arg2="17"/>
|
||||
</or>
|
||||
<then>
|
||||
<echo message="Java version is ok!" />
|
||||
<antcall target="doupdate"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Update of Java needed. Please first update java!" />
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="doupdate">
|
||||
<antcall target="backup"/>
|
||||
<antcall target="extract"/>
|
||||
<antcall target="update_java" />
|
||||
<antcall target="update_tomcat"/>
|
||||
<antcall target="update_wut"/>
|
||||
<antcall target="check"/>
|
||||
<antcall target="cleanup"/>
|
||||
</target>
|
||||
|
||||
<target name="backup">
|
||||
<tstamp/>
|
||||
|
||||
<echo message="Remove old update fragments..." />
|
||||
<delete failonerror="false" dir="${TEMP_DIR}" />
|
||||
|
||||
<echo message="Create Backup archive" />
|
||||
<if>
|
||||
<isset property="isStandAlone" />
|
||||
<then>
|
||||
<mkdir dir="${BASE_DIR}\backup" />
|
||||
<mkdir dir="${BASE_DIR}\dummy" />
|
||||
<zip destfile="${BASE_DIR}\backup\SFC_${OLDVERSION}_backup_${DSTAMP}${TSTAMP}.jar" level="9">
|
||||
<zipfileset dir="${BASE_DIR}" excludes="logsave* dummy/** log/** backup/** "/>
|
||||
<zipfileset dir="${BASE_DIR}/dummy" fullpath="log"/>
|
||||
</zip>
|
||||
<delete dir="${BASE_DIR}/dummy" />
|
||||
</then>
|
||||
<else>
|
||||
<mkdir dir="${DST_DIR}/../backup" />
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<jar destfile="${DST_DIR}/../backup/SFC_MTCService_${OLDVERSION}_backup_${DSTAMP}${TSTAMP}.jar">
|
||||
<fileset dir="${DST_DIR}/../FIT-MI_Server"/>
|
||||
</jar>
|
||||
</then>
|
||||
<else>
|
||||
<jar destfile="${DST_DIR}/../backup/FIT_MI-Server_${OLDVERSION}_backup_${DSTAMP}${TSTAMP}.jar">
|
||||
<fileset dir="${DST_DIR}/../FIT-MI_Server"/>
|
||||
</jar>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="extract">
|
||||
<mkdir dir="${TEMP_DIR}" />
|
||||
<echo message="Extract mi_server.jar into ${TEMP_DIR}"/>
|
||||
<unjar src="${INST_DIR}/mi_server.jar" dest="${TEMP_DIR}">
|
||||
</unjar>
|
||||
</target>
|
||||
|
||||
<target name="cleanup">
|
||||
<echo message="Cleanup directory ${TEMP_DIR}"/>
|
||||
<delete dir="${TEMP_DIR}" />
|
||||
|
||||
<!-- Delete obsolete files and dirs -->
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/src" quiet="true"/>
|
||||
<delete file="${DST_DIR}/02_03_Update_FIT-MIServer_eng.pdf" quiet="true"/>
|
||||
<delete file="${DST_DIR}/02_03_Update_FIT-MIServer_ger.pdf" quiet="true"/>
|
||||
<delete file="${DST_DIR}/ACHTUNG_UPDATE.txt" quiet="true"/>
|
||||
<delete file="${DST_DIR}/install.bat" quiet="true"/>
|
||||
<delete file="${DST_DIR}/update_files.bat" quiet="true"/>
|
||||
<delete file="${DST_DIR}/readme.txt" quiet="true"/>
|
||||
<delete file="${DST_DIR}/ChangeLog.txt" quiet="true"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/WuT_Filter.jar" quiet="true"/>
|
||||
<delete file="${DST_DIR}/Tomcat 5.0/lib/log4j.properties.fit" quiet="true"/>
|
||||
<delete file="${DST_DIR}/Tomcat 5.0/lib/log4j.properties.fit4tc" quiet="true"/>
|
||||
<delete file="${DST_DIR}/Tomcat 5.0/lib/log4j.properties" quiet="true"/>
|
||||
<delete file="${DST_DIR}/Tomcat 5.0/bin/FIT4TC_MI_Tomcat_service.bat" quiet="true"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/log4j.properties" quiet="true"/>
|
||||
|
||||
<!-- Remove not required UNIX or WIN files -->
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<!-- chmod ausführen -->
|
||||
<chmod dir="${DST_DIR}/Tomcat 5.0/bin" perm="u+x" includes="**/*.sh"/>
|
||||
<!-- Windows batch löschen -->
|
||||
<delete>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.bat"/>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.dll"/>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.exe"/>
|
||||
</delete>
|
||||
</then>
|
||||
<else>
|
||||
<!-- Unix scripte löschen -->
|
||||
<delete>
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/bin" includes="**/*.sh"/>
|
||||
</delete>
|
||||
<delete dir="${DST_DIR}/bin/init.d_scripts" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- Remove not required scripts -->
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<delete>
|
||||
<filelist dir="${DST_DIR}/Tomcat 5.0/bin">
|
||||
<file name="FIT_MI_Tomcat_service.bat"/>
|
||||
<file name="FIT_MI-Configure.bat"/>
|
||||
<file name="FIT_MI-Monitor.bat"/>
|
||||
<file name="install_fit.bat"/>
|
||||
<file name="remove_fit.bat"/>
|
||||
<file name="setenv_fit.bat"/>
|
||||
<file name="setenv_fit.sh"/>
|
||||
</filelist>
|
||||
</delete>
|
||||
<delete failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/machine1.properties" />
|
||||
<delete failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/opcua1.properties" />
|
||||
<delete failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/sinrpc_db_config.ini.default" />
|
||||
<delete failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/genius-upload.templ.default" />
|
||||
<delete failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit" />
|
||||
<move failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit4tc" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.default" />
|
||||
</then>
|
||||
<else>
|
||||
<delete>
|
||||
<filelist dir="${DST_DIR}/Tomcat 5.0/bin">
|
||||
<file name="FIT4TC_MI_Tomcat_service.bat"/>
|
||||
<file name="install_fit4tc.bat"/>
|
||||
<file name="remove_fit4tc.bat"/>
|
||||
<file name="setenv_fit4tc.bat"/>
|
||||
<file name="setenv_fit4tc.sh"/>
|
||||
</filelist>
|
||||
</delete>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit4tc" />
|
||||
<move failonerror="false" file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.fit" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.default" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- copy überschreibt nur die Dateien, die vom Setup-Medium mit einem neueren Datum kommen! -->
|
||||
|
||||
<target name="update_tomcat">
|
||||
<echo message="Update Tomcat..."/>
|
||||
|
||||
<echo message="Remove obsolete files..."/>
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/Uninstall.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/commons-launcher.jar" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/commons-logging-api.jar" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/jmx.jar" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/launcher.properties" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/LauncherBootstrap.class" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/shutdown-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/shutdown-using-launcher.bat" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/startup-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/startup-using-launcher.bat" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tool-wrapper-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tool-wrapper-using-launcher.bat" />
|
||||
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/conf/Catalina/localhost/admin.xml" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/conf/Catalina/localhost/manager.xml" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/conf/Catalina/localhost/wut.xml.fit" />
|
||||
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/server" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/shared" />
|
||||
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/webapps/ROOT/WEB-INF/classes" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/webapps/ROOT/WEB-INF/lib" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/webapps/tomcat-docs" />
|
||||
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/work/Catalina/localhost/tomcat-docs" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/work/Catalina/localhost/manager" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/work/Catalina/localhost/balancer" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/work/Catalina/localhost/admin" />
|
||||
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/lib" />
|
||||
|
||||
<echo message="Copy files for Apache Tomcat"/>
|
||||
|
||||
<!-- Bug 2909: bootstrap.jar wird nicht immer überschrieben -->
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/bootstrap.jar" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat-juli.jar" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat-native.tar.gz" />
|
||||
|
||||
<copy todir="${DST_DIR}/Tomcat 5.0/bin" verbose="true" >
|
||||
<fileset dir="${TEMP_DIR}/Tomcat 5.0/bin">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="msw" />
|
||||
<then>
|
||||
<copy overwrite="false" file="${TEMP_DIR}/Tomcat 5.0/bin/tomcat8_32.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}.exe" />
|
||||
<copy overwrite="false" file="${TEMP_DIR}/Tomcat 5.0/bin/tomcat8_64.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}_64.exe" />
|
||||
<copy overwrite="false" file="${TEMP_DIR}/Tomcat 5.0/bin/tomcat8w_32.exe" tofile="${DST_DIR}/Tomcat 5.0/bin/${SERVICENAME}w.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_32.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8_64.exe" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tomcat8w_32.exe" />
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Copy configuration files -->
|
||||
<copy failonerror="false" todir="${DST_DIR}/Tomcat 5.0/lib" verbose="true" >
|
||||
<fileset dir="${DST_DIR}/Tomcat 5.0/common/classes">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<delete dir="${DST_DIR}/Tomcat 5.0/common" />
|
||||
|
||||
<copy todir="${DST_DIR}/Tomcat 5.0/lib" verbose="true" overwrite="true">
|
||||
<fileset dir="${TEMP_DIR}/Tomcat 5.0/lib">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/conf/catalina.policy" tofile="${DST_DIR}/Tomcat 5.0/conf/catalina.policy" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/conf/catalina.properties" tofile="${DST_DIR}/Tomcat 5.0/conf/catalina.properties" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/conf/context.xml" tofile="${DST_DIR}/Tomcat 5.0/conf/context.xml" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/conf/logging.properties" tofile="${DST_DIR}/Tomcat 5.0/conf/logging.properties" />
|
||||
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/LICENSE" tofile="${DST_DIR}/Tomcat 5.0/LICENSE" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/NOTICE" tofile="${DST_DIR}/Tomcat 5.0/NOTICE" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/RELEASE-NOTES" tofile="${DST_DIR}/Tomcat 5.0/RELEASE-NOTES" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/Tomcat 5.0/RUNNING.txt" tofile="${DST_DIR}/Tomcat 5.0/RUNNING.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/tomcat-version.txt" tofile="${DST_DIR}/tomcat-version.txt" />
|
||||
|
||||
<mkdir dir="${DST_DIR}/Tomcat 5.0/temp" />
|
||||
|
||||
<!-- Bug 2402: docs und ROOT-Webapp entfernen -->
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/webapps/tomcat-docs" />
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/webapps/ROOT" />
|
||||
<copy todir="${DST_DIR}/Tomcat 5.0/webapps" verbose="false" >
|
||||
<fileset dir="${TEMP_DIR}/Tomcat 5.0/webapps">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- Unnoetige Dateien entfernen... -->
|
||||
<delete failonerror="false" dir="${DST_DIR}/Tomcat 5.0/bin/contrib" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/catalina.xml" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/launcher.properties" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/LauncherBootstrap.class" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/shutdown-using-launcher.bat" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/shutdown-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/startup-using-launcher.bat" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/startup-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tool-wrapper-using-launcher.bat" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tool-wrapper-using-launcher.sh" />
|
||||
<delete failonerror="false" file="${DST_DIR}/Tomcat 5.0/bin/tcnative-1.dll" />
|
||||
|
||||
<!-- Server.xml anpassen wenn nötig -->
|
||||
<echo message="Check server.xml ..."/>
|
||||
|
||||
<delete file="${DST_DIR}/Tomcat 5.0/conf/server_org.xml" failonerror="false" />
|
||||
<move file="${DST_DIR}/Tomcat 5.0/conf/server.xml" tofile="${DST_DIR}/Tomcat 5.0/conf/server_org.xml" />
|
||||
|
||||
<xmltask outputter="simple" source="${DST_DIR}/Tomcat 5.0/conf/server_org.xml" dest="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<remove path="Server/Listener[@className='org.apache.catalina.core.AprLifecycleListener']" />
|
||||
<remove path="Server/Listener[@className='org.apache.catalina.mbeans.ServerLifecycleListener']" />
|
||||
|
||||
<!-- Check for old user database definition -->
|
||||
<call path="Server/GlobalNamingResources/ResourceParams[@name='UserDatabase']">
|
||||
<param name="update.reqd" value="true"/>
|
||||
<actions>
|
||||
<echo>Found old user database, converting</echo>
|
||||
<property name="update.reqd" value="true"/>
|
||||
</actions>
|
||||
|
||||
|
||||
</call>
|
||||
|
||||
<remove if="update.reqd" path="Server/GlobalNamingResources/ResourceParams[@name='UserDatabase']" />
|
||||
<replace if="update.reqd" path="Server/GlobalNamingResources/Resource[@name='UserDatabase']">
|
||||
<![CDATA[
|
||||
<Resource name="UserDatabase" auth="Container"
|
||||
type="org.apache.catalina.UserDatabase"
|
||||
description="User database that can be updated and saved"
|
||||
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
|
||||
pathname="conf/tomcat-users.xml" />
|
||||
]]>
|
||||
</replace>
|
||||
|
||||
<insert if="update.reqd" path="Server/GlobalNamingResources" position="before">
|
||||
<![CDATA[
|
||||
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
|
||||
<Listener className="org.apache.catalina.core.JasperListener" />
|
||||
|
||||
]]>
|
||||
</insert>
|
||||
|
||||
<!-- Check for GlobalResourcesLifecycleListener -->
|
||||
<call path="Server/Listener[@className='org.apache.catalina.mbeans.GlobalResourcesLifecycleListener']">
|
||||
<actions>
|
||||
<echo>GlobalResourcesLifecycleListener already registered...</echo>
|
||||
<property name="GlobalResourcesLifecycleListener.set" value="true"/>
|
||||
</actions>
|
||||
</call>
|
||||
<insert unless="GlobalResourcesLifecycleListener.set" path="Server/GlobalNamingResources" position="before">
|
||||
<![CDATA[
|
||||
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
|
||||
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
|
||||
|
||||
]]>
|
||||
</insert>
|
||||
|
||||
<!-- Bug 2956: Since 7.0.63 maxPostSize 0 disables POST requests. Change to -1 -->
|
||||
<attr path="Server/Service/Connector[@maxPostSize='0']" attr="maxPostSize" value="-1"/>
|
||||
|
||||
<!-- Bug 3163: Update to 8.5.15 and remove obsolete attributes and elements -->
|
||||
<attr path="Server" attr="debug" remove="true"/>
|
||||
<attr path="Server/Listener" attr="debug" remove="true"/>
|
||||
<attr path="Server/Service/Connector" attr="debug" remove="true"/>
|
||||
<attr path="Server/Service/Connector" attr="maxSpareThreads" remove="true"/>
|
||||
<attr path="Server/Service/Engine" attr="debug" remove="true"/>
|
||||
<attr path="Server/Service/Engine/Host" attr="debug" remove="true"/>
|
||||
<attr path="Server/Service/Engine/Host" attr="xmlNamespaceAware" remove="true"/>
|
||||
<attr path="Server/Service/Engine/Host" attr="xmlValidation" remove="true"/>
|
||||
<remove path="Server/Listener[@className='org.apache.catalina.core.JasperListener']"/>
|
||||
|
||||
<!-- Bug 3416: Check for HTTPS-Connector -->
|
||||
<call path="Server/Service/Connector[@SSLEnabled='true']">
|
||||
<param name="https.present" value="true"/>
|
||||
<actions>
|
||||
<property name="https.present" value="true"/>
|
||||
</actions>
|
||||
</call>
|
||||
<insert unless="https.present" path="Server/Service/Connector" position="after">
|
||||
<![CDATA[
|
||||
<Connector SSLEnabled="true" acceptCount="100" disableUploadTimeout="true" enableLookups="true" port="8493" scheme="https" secure="true">
|
||||
<SSLHostConfig sslProtocol="TLS">
|
||||
<Certificate certificateKeyAlias="@@CERTKEYALIAS@@" certificateKeystoreFile="@@CERTKEYSTOREFILE@@" certificateKeystorePassword="@@CERTKEYSTOREPWD@@" certificateKeyPassword="@@CERTKEYPWD@@">
|
||||
</Certificate>
|
||||
</SSLHostConfig>
|
||||
</Connector>
|
||||
|
||||
]]>
|
||||
</insert>
|
||||
<attr unless="https.present" path="Server/Service/Connector[@port='8090']" attr="redirectPort" value="8493"/>
|
||||
|
||||
<!-- Bug 5864: Hide tomcat version information from error pages -->
|
||||
<call path="Server/Service/Engine/Host/Valve[@className='org.apache.catalina.valves.ErrorReportValve']">
|
||||
<actions>
|
||||
<echo>ErrorReportValve already configured...</echo>
|
||||
<property name="ErrorReportValve.set" value="true"/>
|
||||
</actions>
|
||||
</call>
|
||||
<insert unless="ErrorReportValve.set" path="Server/Service/Engine/Host" position="under">
|
||||
<![CDATA[
|
||||
<Valve className="org.apache.catalina.valves.ErrorReportValve" showServerInfo="false" />
|
||||
|
||||
]]>
|
||||
</insert>
|
||||
|
||||
</xmltask>
|
||||
|
||||
<!-- Bug 3416: Check for HTTPS-Connector -->
|
||||
<if>
|
||||
<isset property="https.present"/>
|
||||
<then>
|
||||
<echo message="HTTPS Connector already configured! Configuration not changed!"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Insert new HTTPS connector with default configuration!"/>
|
||||
<echo message=" -> New HTTPS port is: 8493"/>
|
||||
<echo message=" => Please check this configuration to match your CA!"/>
|
||||
<if>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<then>
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<replacefilter token="@@CERTKEYALIAS@@" value="SFC_Server"/>
|
||||
<replacefilter token="@@CERTKEYSTOREFILE@@" value="../../conf/mykeystore.ks"/>
|
||||
<replacefilter token="@@CERTKEYSTOREPWD@@" value="aplusbpwd"/>
|
||||
<replacefilter token="@@CERTKEYPWD@@" value="aplusbpwd"/>
|
||||
</replace>
|
||||
</then>
|
||||
<else>
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/conf/server.xml">
|
||||
<replacefilter token="@@CERTKEYALIAS@@" value="tomcat"/>
|
||||
<replacefilter token="@@CERTKEYSTOREFILE@@" value="${FITDIR}/run/bin/Tomcat 5.0/conf/ABkeystore.ks"/>
|
||||
<replacefilter token="@@CERTKEYSTOREPWD@@" value="AplusBpwd2015"/>
|
||||
<replacefilter token="@@CERTKEYPWD@@" value="AplusBpwd2015"/>
|
||||
</replace>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- Bug 3711: Update service configuration -->
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<shellscript shell="bash">
|
||||
if grep -q CLASSPATH.*wut/WEB-INF/conf ${DST_DIR}/Tomcat\ 5.0/bin/setenv.sh; then
|
||||
echo CLASSPATH is ok
|
||||
else
|
||||
echo CLASSPATH needs to be modified
|
||||
echo "# Add conf directory to classpath - required to find log4j.properties and other configuration files..." >> ${DST_DIR}/Tomcat\ 5.0/bin/setenv.sh
|
||||
echo "CLASSPATH=\${CATALINA_HOME}/../webapps/wut/WEB-INF/conf" >> ${DST_DIR}/Tomcat\ 5.0/bin/setenv.sh
|
||||
fi
|
||||
</shellscript>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="Check windows service configuration..."/>
|
||||
<exec executable="${INST_DIR}\\install\\MTCServiceConfigUpdater.exe"/>
|
||||
|
||||
<!-- check setenv.bat (SFC) -->
|
||||
<if>
|
||||
<and>
|
||||
<equals arg1="${INST_SYS}" arg2="fit4tc" />
|
||||
<resourcecontains resource="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" substring="set JAVA_HOME=%TCFITDIR%\Java\j2sdk\jre" />
|
||||
</and>
|
||||
<then>
|
||||
<echo message="setenv.bat contains correct JAVA_HOME setting." />
|
||||
</then>
|
||||
<else>
|
||||
<echo message="setenv.bat may not contain correct JAVA_HOME value, check this..." />
|
||||
<if>
|
||||
<resourcecontains resource="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" substring="set JAVA_HOME=%TCFITDIR%\Java\j2sdk" />
|
||||
<then>
|
||||
<echo message=" Change JAVA_HOME from %TCFITDIR%\Java\j2sdk to %TCFITDIR%\Java\j2sdk\jre" />
|
||||
<replace file="${DST_DIR}/Tomcat 5.0/bin/setenv.bat" token="set JAVA_HOME=%TCFITDIR%\Java\j2sdk" value="set JAVA_HOME=%TCFITDIR%\Java\j2sdk\jre"/>
|
||||
</then>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="update_wut">
|
||||
|
||||
<!-- Remove old properties files -->
|
||||
<delete>
|
||||
<fileset dir="${DST_DIR}/webapps/wut/WEB-INF/classes" includes="**/*.properties"/>
|
||||
</delete>
|
||||
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/lib" failonerror="false">
|
||||
<exclude name="**/amd64/AGLink*"/>
|
||||
<exclude name="**/x86/AGLink*"/>
|
||||
<exclude name="**/MI_AGLink-*.jar"/>
|
||||
<exclude name="**/aglink-java-wrapper.jar"/>
|
||||
</delete>
|
||||
|
||||
<!-- delete dir="${DST_DIR}/webapps/wut/WEB-INF/lib" failonerror="false" / -->
|
||||
|
||||
<echo message="Copy files for WuT Webapp"/>
|
||||
<copy todir="${DST_DIR}/webapps\wut" verbose="true" overwrite="true">
|
||||
<fileset dir="${TEMP_DIR}/webapps\wut">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<echo message="Copy bin files"/>
|
||||
<copy todir="${DST_DIR}/bin" verbose="true" overwrite="true">
|
||||
<fileset dir="${TEMP_DIR}/bin">
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<delete file="${DST_DIR}/bin/MCISServiceCall.exe" failonerror="false" />
|
||||
|
||||
<!-- Alten internen FTP-Client löschen, wenn noch vorhanden -->
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/ftp" failonerror="false" />
|
||||
|
||||
<!-- Alte unvollständige COM-Server Implementierungen löschen -->
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/mi/comservers/bbelec" failonerror="false" />
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/mi/comservers/moxa" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/webadapter/com/Moxa.class" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/webadapter/com/VlinxBBElec.class" failonerror="false" />
|
||||
|
||||
<!-- Alte Dateien löschen -->
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/fsw_pkg.jar" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/win32com.dll" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/ReadmeJavaCommAPI.html" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/javax.comm.properties" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/lib/comm.jar" failonerror="false" />
|
||||
<delete dir="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/mi/JUnitTest" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/users.lst" failonerror="false" />
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/classes/com/aplusb/webadapter/servlet/WutInitServlet.class" failonerror="false" />
|
||||
|
||||
<copy overwrite="true" file="${TEMP_DIR}/version.txt" tofile="${DST_DIR}/version.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/ChangeLog_de.txt" tofile="${DST_DIR}/ChangeLog_de.txt" />
|
||||
<copy overwrite="true" file="${TEMP_DIR}/ChangeLog_en.txt" tofile="${DST_DIR}/ChangeLog_en.txt" />
|
||||
|
||||
<!-- logback.xml vorhanden? -->
|
||||
<available file="${DST_DIR}/webapps/wut/WEB-INF/conf/logback.xml" property="av_log4j" />
|
||||
<if>
|
||||
<not><equals arg1="${av_log4j}" arg2="true" /></not>
|
||||
<then>
|
||||
<echo message="logback.xml doesn't exist. Create based on default file..." />
|
||||
<copy file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/logback.xml.${INST_SYS}" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/logback.xml" />
|
||||
</then>
|
||||
<else>
|
||||
<echo message="logback.xml already exist!" />
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.SFCfTC" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.SFC" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/mi_server.ini.FIT" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini.SFCfTC" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini.FIT" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini.default" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/log4j.properties.fit" failonerror="false"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/defaults/log4j.properties.fit4tc" failonerror="false"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="update_java">
|
||||
|
||||
<if>
|
||||
<and>
|
||||
<isset property="isStandAlone" />
|
||||
<equals arg1="${isMsWin}" arg2="true" />
|
||||
</and>
|
||||
<then>
|
||||
<echo message="Save cacerts..."/>
|
||||
<copy failonerror="false" file="${BASE_DIR}/Java/j2sdk/jre/lib/security/cacerts" tofile="${BASE_DIR}/cacerts.user"/>
|
||||
|
||||
<echo message="Update internal java version..."/>
|
||||
<delete dir="${BASE_DIR}/Java/j2sdk" />
|
||||
|
||||
<echo message="Unkompress ${BASE_JAR_DIR}${file.separator}SFC_Base.jar.xz"/>
|
||||
<unxz src="${BASE_JAR_DIR}${file.separator}SFC_Base.jar.xz" dest="${TEMP_DIR}${file.separator}SFC_Base.jar"/>
|
||||
<unjar src="${TEMP_DIR}${file.separator}SFC_Base.jar" dest="${BASE_DIR}">
|
||||
<patternset>
|
||||
<include name="Java/"/>
|
||||
</patternset>
|
||||
</unjar>
|
||||
|
||||
<delete failonerror="false" file="${TEMP_DIR}${file.separator}SFC_Base.jar" />
|
||||
<delete failonerror="false" file="${BASE_DIR}${file.separator}Java${file.separator}JavaService.exe" />
|
||||
|
||||
<echo message="Replace cacerts with old file..."/>
|
||||
<copy failonerror="false" file="${BASE_DIR}/Java/j2sdk/jre/lib/security/cacerts" tofile="${BASE_DIR}/Java/j2sdk/jre/lib/security/cacerts.org" />
|
||||
<move failonerror="false" file="${BASE_DIR}/cacerts.user" tofile="${BASE_DIR}/Java/j2sdk/jre/lib/security/cacerts" />
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="check">
|
||||
<echo message="Check old configuration style"/>
|
||||
<delete file="${DST_DIR}/webapps/wut/WEB-INF/conf/webadapter.ini.default" quiet="true" />
|
||||
|
||||
<available file="${DST_DIR}/webapps/wut/WEB-INF/conf/webadapter.ini" property="wini" />
|
||||
<if>
|
||||
<equals arg1="${wini}" arg2="true" />
|
||||
<then>
|
||||
<echo message="Rename webadapter.ini to mi_server.ini" />
|
||||
<move file="${DST_DIR}/webapps/wut/WEB-INF/conf/webadapter.ini" tofile="${DST_DIR}/webapps/wut/WEB-INF/conf/mi_server.ini" />
|
||||
</then>
|
||||
<else>
|
||||
<echo message="webadapter.ini already renamed to mi_server.ini" />
|
||||
</else>
|
||||
</if>
|
||||
<if>
|
||||
<equals arg1="${INST_OS}" arg2="unix" />
|
||||
<then>
|
||||
<!-- chmod ausführen -->
|
||||
<chmod dir="${DST_DIR}/Tomcat 5.0/bin" perm="u+x" includes="**/*.sh"/>
|
||||
<chmod dir="${DST_DIR}/bin/init.d_scripts/Linux" perm="u+x" includes="**/*.sh"/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user