@echo off
CERTUTIL -f -p "" -importpfx "localhost.pfx"

netsh http add sslcert ipport=0.0.0.0:12030 certhash=f3c26347a7224962cf5e37bbe70831fedddee63b appid={00000000-0000-0000-1111-AABBCCDDEEFF}
Pause

sc stop "Integra WinNAC"
msiexec /x iWinNACSetup.msi /qn
msiexec /i iWinNACSetup.msi /qn
pause

set ProgramPath=""
for /f %%a in ('wmic os get osarchitecture ^| find /i "bit"') do set "bits=%%a"
IF %bits%==64-bit (
    set ProgramPath="C:\Program Files (x86)\Integra\iWinNAC"
)else (
    set ProgramPath="C:\Program Files\Integra\iWinNAC"
)	
echo %ProgramPath%	

copy *.bmp %ProgramPath%

SC failure "Integra WinNAC" reset=0 actions= restart/60000/restart/60000/restart/60000	

:: Fast startup disable
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t reg_dword /d 0 /f

SC START "Integra WinNAC"
Pause