@Echo OFF
::  #By Christain Strahl
::  #Based on the bat Files idea of =G|f|H=Joe //12 LINES
::  #Advanced Bat Files Concept by Christian Strahl ([dM]Chriss) //over 280 LINES
::  #See www.darkmatter-clan.com @ Downloads or for the orginal version visit www.gfh-clan.org
::  #Instructions: Copy This Folder with all files included in your ef2 -> c:/games/ef2/ Folder and run ef2_switcher.bat
::  #This file is freeware, as long as it is unchanged you can free share it!
::  #Removig comments or riping is illegal!
::  #Check out www.darkmatter-clan.com ~ www.chriss-home.de
:start
ver
cd "../"
:restart
CLS
if not exist ef2.exe goto wrongdir
if not exist version.inf goto filechek
:firstruncheck
if not exist ef2vSwitcher/files/patched/cgamex86.dll goto firstrun
if not exist ef2vSwitcher/files/patched/gamex86.dll goto firstrun
if not exist ef2vSwitcher/files/patched/EF2.exe goto firstrun
if not exist ef2vSwitcher/files/patched/locpak50.pk3 firstrun
if not exist ef2vSwitcher/files/patched/pak50.pk3 goto firstrun
::Continue if no probs
echo.
Echo ---------------------------------------------
Echo # Welcome to the EF2fastSwitch -Tool...
Echo # 
Echo # This version was tested under Windows XP
Echo # Build by Christian Strahl ([dM]Chriss)
Echo # Coments post in the [dM] forum at
Echo # www.darkmatter-clan.com
Echo # v. 1.0
Echo # 
Echo # Everything sems to be fine, program is ready!
Echo ---------------------------------------------
echo.
if exist version.inf goto actionunpatch
if not exist version.inf goto actionpatch
exit
:filechek
if not exist ef2vSwitcher/files/patched/version.inf goto firstruncheck
if exist ef2vSwitcher/files/patched/version.inf goto firstruncheck
:actionunpatch
cls
echo.
echo ---------------------------
echo #  Downgrade possible...  #
echo ---------------------------
echo.
echo Programm will unpatch your game and downgrade it to 1.01
goto hitkey
:actionpatch
cls
echo.
echo ---------------------------
echo #   Upgrade possible...   #
echo ---------------------------
echo.
echo Programm will patch your game and Upgrade it to 1.1
goto hitkey
:hitkey
echo.
echo ***Hit any key to continue***
pause >NUL
@Echo OFF
if exist version.inf goto unpatchit
if not exist version.inf goto patchit
:wrongdir
cls
echo.
Echo ---------------------------------------------
Echo # Sorry WORONG directory, pls put this complete
Echo # folder with all files included in the EF2
Echo # dirctory!
Echo # Example: "c:\programs\games\ef2\"
Echo # Then run this program again...
Echo ---------------------------------------------
echo.
echo. ***Hit any key to exit the program***
pause >NUL
exit
:installpatch
echo.
Echo ---------------------------------------------
Echo # Sorry no way, you need first to install the
echo # patch to get the version 1.1 of EF2!
Echo ---------------------------------------------
echo.
echo Program will now exit, install the patch then
echo run the Program again.
echo.
echo Download the patch at www.effiles.com or at
echo www.darkmatter-clan.com
echo.
echo ***Hit any key to exit now***
pause >NUL
exit
:firstrun
cls
echo.
Echo ---------------------------------------------
Echo # Welcome to the ST EF2 Version switcher...
Echo # 
Echo # This programm can patch and unpatch your
Echo # Elite Force 2, it requires a patched version
Echo # of Star Trek Elite Force 2.
Echo # 
Echo # Built by Christian Strahl ([dM]Chriss)
Echo # 
Echo # It sems that you run the first time this
Echo # Program, it will now automaticly setup.
Echo ---------------------------------------------
echo.
echo ***Hit any key to continue now***
pause >NUL
goto setup
:setup
cls
echo.
echo ------------------------
echo Runing now Setup...
echo ------------------------
echo.
if not exist base/cgamex86.dll goto missingcgamex86.dll
if not exist base/gamex86.dll goto missinggamex86.dll
if not exist EF2.exe goto missingef2.exe
if not exist base/locpak50.pk3 goto missinglocpak50.pk3
if not exist base/pak50.pk3 goto missingpak50.pk3
:filesfound
echo.
echo STATUS: All files found continue now...
echo STEP 1: Set attributes... (-r)
echo STEP 1.1: Set programm internal folder attributes...
@echo off
attrib -r -h ef2vSwitcher
attrib -r ef2vSwitcher/files
attrib -r ef2vSwitcher/files/patched
echo STEP 1.2: Set external folder attributes...
echo.
@attrib -r base
echo Attribute set -r at folder: base
@attrib -r base/cgamex86.dll
echo Attribute set -r at file: base/cgamex86.dll
@attrib -r base/gamex86.dll
echo Attribute set -r at file: base/gamex86.dll
@attrib -r base/pak50.pk3
echo Attribute set -r at file: base/pak50.pk3
@attrib -r base/locpak50.pk3
echo Attribute set -r at file: base/locpak50.pk3
@attrib -r ef2.exe
echo Attribute set -r at file: ef2.exe
@attrib -r version.inf
echo Attribute set -r at file: version.inf
echo.
echo STATUS: Attributes set.
echo STEP 2: Begin to copy required files now...
echo.
copy "ef2.exe" "ef2vSwitcher/files/patched/"
copy "version.inf" "ef2vSwitcher/files/patched/"
@echo off
cd "base/"
copy "cgamex86.dll" "../ef2vSwitcher/files/patched/"
copy "gamex86.dll" "../ef2vSwitcher/files/patched/"
copy "pak50.pk3" "../ef2vSwitcher/files/patched/"
copy "locpak50.pk3" "../ef2vSwitcher/files/patched/"
@echo off
cd "../"
echo.
echo STATUS: Files copyed...
echo STEP 3: Setup complete!!!
echo STEP 4: Starting info.txt
echo STATUS: Setup done...
echo.
echo ---------------------------------
echo CLOSE THE INFO.TXT to continue...
echo ---------------------------------
echo.
@echo off
cd "/ef2vSwitcher/files/"
info.txt
@echo off
cd "../../"
echo ***hit any key to continue and restart the program***
pause >NUL
goto restart
:missingcgamex86.dll
echo ERROR: Missing file base/cgamex86.dll
goto missingfiles
:missinggamex86.dll
echo ERROR: Missing file base/gamex86.dll
goto missingfiles
:missingEF2.exe
echo ERROR: Missing file ef2.exe
goto missingfiles
:missinglocpak50.pk3
echo ERROR: Missing file base/locpak50.pk3
goto missingfiles
:missingpak50.pk3
echo ERROR: Missing file base/pak50.pk3
goto missingfiles
:missingfiles
echo.
echo One or more files missing, programm will now exit.
echo.
echo. ***Hit any key to exit programm***
pause >NUL
exit
:unpatchit
cls
echo.
echo ---------------------------
echo Going to unpatch the Game
echo ---------------------------
echo.
echo STATUS: Version 1.1 detected...
echo STEP 1: Delete files...
echo.
del "ef2.exe"
del "version.inf"
@echo off
cd "base/"
del "locpak50.pk3"
del "pak50.pk3"
del "gamex86.dll"
del "cgamex86.dll"
@echo off
cd "../"
echo.
echo STATUS: Files deleted...
echo STEP 2: Copy Unpatched files...
@echo off
cd "ef2vSwitcher/files/default/"
copy "ef2.exe" "../../../"
copy "gamex86.dll" "../../../base/"
copy "cgamex86.dll" "../../../base/"
@echo off
cd "../../../"
echo.
echo Game is Unpatched (v 1.01) now, enjoy...
goto done
:patchit
cls
echo.
echo ---------------------------
echo Going to Patch the Game now
echo ---------------------------
echo.
echo STATUS: Version 1.01 detected...
echo STEP 1: Delete files...
del "ef2.exe"
del "version.inf"
@echo off
cd "base/"
del "locpak50.pk3"
del "pak50.pk3"
del "gamex86.dll"
del "cgamex86.dll"
@echo off
cd "../"
echo.
echo STATUS: Files deleted...
echo STEP 2: Copy Patched files...
@echo off
cd "ef2vSwitcher/files/patched/"
echo.
copy "ef2.exe" "../../../"
copy "version.inf" "../../../"
copy "gamex86.dll" "../../../base/"
copy "cgamex86.dll" "../../../base/"
copy "locpak50.pk3" "../../../base/"
copy "pak50.pk3" "../../../base/"
@echo off
cd "../../../"
echo.
echo Game is Patched (v 1.1) now, enjoy...
goto done
:done
echo.
echo ***DONE***
echo ***Hit any key to exit program***
pause >NUL
::ef2.exe
exit