@echo off 
rem ********************************************************************************
rem *
rem * dafix.bat
rem *
rem * This file, which is copied to and run from the destination server, 
rem * fixes the DOS 8.3 filename truncation of all the IBM Director Agent files.
rem *
rem * This batch file is called by from diragent.bat.
rem *
rem ********************************************************************************

cd \APPS\diragent\FILES

rem ****************************************
rem * Determine the director agent version
rem ****************************************

if exist DIR520~1.EXE goto DA52
if exist DIR510~1.EXE goto DA51

goto END


:DA52
rem ****************************************
rem * Rename the files under the FILES directory
rem ****************************************
echo Restoring full filename for IBM Director Agent executable...
ren DIR520~1.EXE dir5_agent_windows.exe                           > nul

rem ****************************************
rem * Rename the files under the META-INF directory 
rem ****************************************
echo Restoring full filenames for IBM Director Agent xml files...
cd \APPS\diragent\META-INF

ren DIR520~1.XML dir5.20_agent_windows.xml                        > nul
ren DIR520~2.XML dir5.20_agent_windows_de.xml                     > nul
ren DIR520~3.XML dir5.20_agent_windows_es.xml                     > nul
ren DIR520~4.XML dir5.20_agent_windows_fr.xml                     > nul
ren DIDB9C~1.XML dir5.20_agent_windows_installArtifact.xml        > nul
ren DI7EFB~1.XML dir5.20_agent_windows_ja_JP.xml                  > nul
ren DIAD36~1.XML dir5.20_agent_windows_ko.xml                     > nul
ren DI2E28~1.XML dir5.20_agent_windows_packagedIU.xml             > nul
ren DI6603~1.XML dir5.20_agent_windows_zh_CN.xml                  > nul
ren DI8A21~1.XML dir5.20_agent_windows_zh_TW.xml                  > nul

rem ****************************************
rem * Rename the resources directory
rem ****************************************
ren  RESOUR~1 resources                                           > nul

rem ****************************************
rem * Rename the files under the resources directory 
rem ****************************************
echo Restoring full filenames for IBM Director Agent properties files...
cd \APPS\diragent\META-INF\resources

ren CSDIRI~1.PRO csdirinstall_de.properties                       > nul
ren CSDIRI~2.PRO csdirinstall_en.properties                       > nul
ren CSDIRI~3.PRO csdirinstall_es.properties                       > nul
ren CSDIRI~4.PRO csdirinstall_fr.properties                       > nul
ren CSA69F~1.PRO csdirinstall_ja_JP.properties                    > nul
ren CS497C~1.PRO csdirinstall_ko.properties                       > nul
ren CSC517~1.PRO csdirinstall_zh_CN.properties                    > nul
ren CS1A5C~1.PRO csdirinstall_zh_TW.properties                    > nul

cd \

goto END

:DA52_E


:DA51
rem ****************************************
rem * Rename the director agent file
rem ****************************************
echo Restoring full filename for IBM Director Agent executable...
ren DIR510~1.EXE dir5_agent_windows.exe                           > nul

rem ****************************************
rem * Rename the files under the META-INF directory 
rem ****************************************
echo Restoring full filenames for IBM Director Agent xml files...

cd \APPS\diragent\META-INF

ren DIR510~1.XML dir5.10_agent_windows.xml                        > nul
ren DIR510~2.XML dir5.10_agent_windows_de.xml                     > nul
ren DIR510~3.XML dir5.10_agent_windows_es.xml                     > nul
ren DIR510~4.XML dir5.10_agent_windows_fr.xml                     > nul
ren DIEC98~1.XML dir5.10_agent_windows_installArtifact.xml        > nul
ren DIF02C~1.XML dir5.10_agent_windows_ja_JP.xml                  > nul
ren DIA7C6~1.XML dir5.10_agent_windows_ko.xml                     > nul
ren DIC638~1.XML dir5.10_agent_windows_packagedIU.xml             > nul
ren DIE823~1.XML dir5.10_agent_windows_zh_CN.xml                  > nul
ren DI0D41~1.XML dir5.10_agent_windows_zh_TW.xml                  > nul

rem ****************************************
rem * Rename the resources directory
rem ****************************************

ren  RESOUR~1 resources                                           > nul

rem ****************************************
rem * Rename the files under the resources directory 
rem ****************************************
echo Restoring full filenames for IBM Director Agent properties files...
cd \APPS\diragent\META-INF\resources

ren CSDIRI~1.PRO csdirinstall_de.properties                       > nul
ren CSDIRI~2.PRO csdirinstall_en.properties                       > nul
ren CSDIRI~3.PRO csdirinstall_es.properties                       > nul
ren CSDIRI~4.PRO csdirinstall_fr.properties                       > nul
ren CSA69F~1.PRO csdirinstall_ja_JP.properties                    > nul
ren CS497C~1.PRO csdirinstall_ko.properties                       > nul
ren CSC517~1.PRO csdirinstall_zh_CN.properties                    > nul
ren CS1A5C~1.PRO csdirinstall_zh_TW.properties                    > nul

cd \

goto END

:DA51_E

:END
