@echo off

rem ********************************************************************************
rem *
rem * diragent.bat
rem *
rem * This file, which is copied to and run from the destination sever, 
rem * performs the actual installation of IBM Director Agent during the
rem * final phase of the OS installation.
rem *
rem * This batch file is called by from GUIRunOnce .
rem *
rem ********************************************************************************

@echo Installing IBM Director Agent. Please wait...

rem * Check to see if source files are from "Package for the Web" or Director CD
@if exist \apps\diragent\ibmdir~1.msi goto CD_INST

rem * Use installation files whose source was "Package for the Web"
rem * Rename the files that were truncated by the DOS XCopy process
@ren \apps\diragent\IBMDir~1.exe IBMDirectorAgent4x.exe
@ren \apps\diragent\dirage~1 diragent_windows.xml

rem * Perform the actual "silent" installation
@\apps\diragent\IBMDirectorAgent4x.exe -a UNATTENDED rsp="\apps\diragent\diragent.rsp" waitforme
@goto FINISH

:CD_INST
rem * Use installation files whose source was the Director CD
rem * Rename the files that were truncated by the DOS XCopy process
@ren \apps\diragent\ibmdir~1.msi "IBM Director Agent.msi"

rem * Perform the actual "silent" installation
@\apps\diragent\ibmsetup.exe UNATTENDED rsp="\apps\diragent\diragent.rsp" waitforme

:FINISH