@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b

set CONFIG=config\install-ntlite.txt
set EXE=..\software\ntlite-setup.exe
set SETTINGS=..\company\ntlite-settings.xml
set LICENSE=..\company\ntlite-license.dat
set STARTMENU=%PROGRAMDATA%\"Microsoft\Windows\Start Menu\Programs"
set STARTMENU_USER=%APPDATA%\"Microsoft\Windows\Start Menu\Programs"

if NOT EXIST %EXE% (
  echo ERROR: %EXE% not found!
  exit /b
)

echo ####### %0 #######

echo installing NTLite ...
start /wait %EXE% /LOADINF=%CONFIG% /NORESTART /NOCANCEL /SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS

echo moving NTLite startmenu shortcut ...
mkdir %STARTMENU%\Tools 2>nul
move /Y %STARTMENU%\"NTLite\NTLite.lnk" %STARTMENU%\Tools 2>nul

echo cleanup ...
rd /S /Q %STARTMENU%\"NTLite" 2>nul

if EXIST %LICENSE% (
  echo installing license ...
  copy /Y %LICENSE% "%PROGRAMFILES%\NTLite\license.dat"
)

if EXIST %SETTINGS% (
  echo copying settings ...
  copy /Y %SETTINGS% "%PROGRAMFILES%\NTLite\settings.xml"
)

rem refresh desktop (W10 style)
ie4uinit.exe -show

echo ####### %0 #######
pause

