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

set CONFIG=config\install-keepass2.txt
set EXE=..\software\keepass2-setup.exe

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

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

echo killing KeePass 2 process ...
taskkill /F /IM KeePass.exe 2>nul

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

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

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

