@echo off
REM change folder to current batch file location
 cd/d "%~dp0"

REM Generate current batch name for logfile
Set "LogFileName=%~dp0%~n0.log"
@echo Log Time: %date% %time%>>"%LogFileName%"
Set LogActions=^>^>"%LogFileName%"


REM check file InstallTouchUtility.exe exist in current folder
If NOT EXIST "%~dp0InstallTouchUtility.exe" (call: UnexistInstallationFile)& (goto END)

REM echo install start, not the same folder so call this exe file use silent
echo install start with silent command...%LogActions%
REM /silent(without prograss bar) or /VERYSILENT (non interrupt on screen)
InstallTouchUtility.exe/silent
echo install end...%LogActions%


echo.
If "%errorlevel%"=="0" (echo 0: command line parameter was used completed successfully.%LogActions%) & (goto END)
If "%errorlevel%"=="1" (echo 1: Setup failed to initialize.%LogActions%) &(goto END)
If "%errorlevel%"=="2" (echo 2: The user chose "No" on the opening "This will install..." message box%LogActions%) & (goto END)
If "%errorlevel%"=="3" (echo 3: A fatal error occurred while preparing to move to the next installation phase%LogActions%) & (goto END)
If "%errorlevel%"=="4" (echo 4: A fatal error occurred during the actual installation process%LogActions%) & (goto END)
If "%errorlevel%"=="5" (echo 5: The user clicked Cancel or abort during the actual installation process%LogActions%) & (goto END)
If "%errorlevel%"=="6" (echo 6: The Setup process was forcefully terminated by the debugger%LogActions%) & (goto END)
echo.
echo Install fail%LogActions%
goto END

:UnexistInstallationFile
echo.
echo InstallTouchUtility.exe is not exist%LogActions%
echo.
exit
goto :eof

:END
echo install.bat exit.%LogActions%