@echo off
SET lang=de
SET myapp=""
SET regkey=KEY_LOCAL_MACHINE\SOFTWARE\EA Sports\FIFA 10
SET keyname=Install Dir
call .\skripts\updater.bat
call .\daten\version.bat
call .\skripts\readConfig.bat myDocPath
::**********************************************************************************************
::
::   F I F A   P F A D   e r m i t t e l n
::
::**********************************************************************************************

::create Tempdir
rd /S /Q %temp%\nortmp
if not exist %temp%\nortmp md %temp%\nortmp
::Create Registry Key (required if key does not exist)
> "%temp%\nortmp\tmp0.reg" ECHO REGEDIT4
>>"%temp%\nortmp\tmp0.reg" ECHO.
>>"%temp%\nortmp\tmp0.reg" ECHO [%regkey%]
START /WAIT REGEDIT /S "%temp%\nortmp\tmp0.reg"
Del %temp%\nortmp\tmp0.reg
::Read and filter Registry Key
start /wait %windir%\regedit /e "%temp%\nortmp\tmp1.reg" "HKEY_LOCAL_MACHINE\SOFTWARE\EA Sports\Fifa 10"
IF EXIST %temp%\nortmp\tmp1.reg Find "%keyname%" < "%temp%\nortmp\tmp1.reg" | Find /V "" >"%temp%\nortmp\nvcpath.txt"
IF EXIST %temp%\nortmp\nvcpath.txt FOR /F "tokens=* delims==" %%A IN ('TYPE %temp%\nortmp\nvcpath.txt') DO SET rootkey=%%A
IF EXIST %temp%\nortmp\nvcpath.txt FOR /F "eol=;tokens=* delims==" %%A IN ('ECHO.%rootkey%') DO CALL :Parse01 %%A %%B
:Parse01
:: %1 is keyname and %2 is value
SET myapp="%2"

:: Remove quotes and replace \\
IF NOT "%myapp%"=="" SET myapp=%myapp:"=%
IF NOT "%myapp%"=="" SET myapp=%myapp:\\=\%

:: Prüfen, ob Registry korrekt ausgelesen werden konnte
if "%myapp%"=="" call .\skripts\readConfig.bat fifaPath
::
::******************************************************************************************
::
::   M A S K E 
::
call .\skripts\maske.bat
::
::
::
::******************************************************************************************
::
::  V D F B   D A T EN   E I N S P I E L E N
::
call .\skripts\grafiken.bat
call .\skripts\daten_einspielen.bat
::
::
::******************************************************************************************
echo.
cls.
echo.
::call .\Multitool\multitool.bat
echo.
cls.
echo.
::pause
cls.
echo.
echo.
echo Fifa 2010 (%version%) wird nun gestartet...........
call "%myapp%\fifa10.exe"
::call .\Multitool\multitool_kill.bat
::******************************************************************************************
::
::  D A T EN   Z U R U E C K S I C H E R N
::
call .\skripts\daten_ruecksichern.bat
call .\skripts\grafiken_ruecksichern.bat
::
::
::******************************************************************************************
pause.
exit
:end
