@echo off
setlocal
set LOGFILE="%TEMP%\MSI_OOF-Admin.log"

rem	Notify user
rem	-----------
cls
echo.
echo Press any key to start OOF-Admin Setup with logfile.
echo This is usefull in case of setup problems.
echo.
echo Logfile: %LOGFILE%
echo.
pause
echo.
echo Setup started ...

rem	(Re)Register VBScript.dll (this seems to be a problem on certain machines)
rem	--------------------------------------------------------------------------
if exist %Systemroot%\System32\vbscript.dll start /wait %Systemroot%\System32\regsvr32.exe /s %Systemroot%\System32\vbscript.dll
if exist %Systemroot%\SysWOW64\vbscript.dll start /wait %Systemroot%\SysWOW64\regsvr32.exe /s %Systemroot%\SysWOW64\vbscript.dll

rem	Start Setup with Logfile
rem	------------------------
rem	start /wait %Systemroot%\System32\msiexec.exe /L!*vx %LOGFILE% /I "%~dp0setup.msi" TRANSFORMS=:1031
start /wait %Systemroot%\System32\msiexec.exe /L!*vx %LOGFILE% /I "%~dp0setup.msi"


rem	Show Logfile
rem	------------
if exist %LOGFILE% start explorer.exe /e, /select,%LOGFILE%
if exist %LOGFILE% start notepad.exe %LOGFILE%

echo.
echo Setup ended.
echo.
echo On error, please send logfile to support@selisoft.com
echo.
pause

endlocal
