set ProductName=Norton Internet Security
set ProductVersion=2007

if not defined log set log=c:\hp\bin\logs
if not exist %log% md %log%

echo NIS block start %date% %time%>>%log%\NIS.txt
set>>%log%\NIS.txt

REM *** Check and Save ReadOnly State ***
rem set pfreadonly=0
rem dir /adr \ | find /i "program files" && set pfreadonly=1
rem echo Preinstall PF readonly is %pfreadonly%>>%log%\NIS.txt

REM *******Preinstall***************
:Preinstall
echo Preinstalling %date% %time%>>%log%\NIS.txt

REM START THE INSTALLATION OF NIS 2007
src\SYMSETUP.EXE /qn /count:2 /noreboot
echo Install exited %date% %time%>>%log%\NIS.txt

if not exist %BIN%\isrunning.exe goto NOTRUNNG
:LOOP
start /wait %BIN%\sleep 10
%BIN%\isrunning.exe "symsetup.EXE"
IF %ERRORLEVEL% EQU 0 GOTO NOTRUNNG
GOTO LOOP
:NOTRUNNG
echo Verified Install not running %date% %time%>>%log%\NIS.txt
rem dir /adr \ | find /i "program files" && echo Post install PF is readonly>>%log%\NIS.txt

:END
REM ****************Publish Path*******************
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v ProdName /d "%ProductName% %ProductVersion%" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v SecurityStatusPath /d "%COMMONFILESDIR%\Symantec Shared\NPC\uiStub.exe" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v SecurityStatusParameter /d "{68C3356A-34AB-4e1a-B12B-10E8D777C232}" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v ISUIPath /d "%COMMONFILESDIR%\Symantec Shared\NPC\uiStub.exe" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v ISUIParameter /d "{68175F05-68E7-47e7-A1F2-4CE1DEE316EE}" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v AVUIPath /d "%COMMONFILESDIR%\Symantec Shared\NPC\uiStub.exe" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v AVUIParameter /d "{68175F05-68E7-47e7-A1F2-4CE1DEE316EE}" /f
REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v AVScanNow /d "%COMMON APPDATA%\Symantec\Norton AntiVirus\Tasks\mycomp.sca" /f

echo NIS block done %date% %time%>>%log%\NIS.txt

REM **** Change Readonly state back to previous ****
rem if %pfreadonly%==1 attrib +R "%programfiles%" && echo Re-setting PF Read Only>>%log%\NIS.txt

REG ADD HKLM\SOFTWARE\Hewlett-Packard\CPC\LocalApps\IS /v Sub /d 60day /f
