@echo off

if empty%1 == empty goto error_no_int_path

if NOT EXIST %1\classes\2.4\InsightManager.wvc goto error_no_int_path

if empty%2 == empty goto error_no_aws_path

if NOT EXIST %2\services\bin\resetdsm.bat goto error_no_aws_path

goto skip_error_handling

:error_no_int_path
echo ERROR: No Integration path detected in first argument, or integration path incorrect
goto end

:error_no_aws_path
echo ERROR: No AgentWorks path detected in first argument, or AgentWorks path incorrect
goto end

:skip_error_handling

echo Copying Compaq Icons

call copy %1\icons\cim*.ico %2\icons

echo Copying Compaq Policy Files

call copy %1\browser\brows*.* %2\config\abrowser\browser.insightmanager

call copy %1\policy\2.4\insi*.cnf %2\services\config\aws_nsm\dm\insightmanager.cnf

call copy %1\policy\2.4\insi*.dat %2\services\config\aws_nsm\dm\insightmanager.dat

echo Copying Class Definitions

call copy %1\classes\2.4\InsightManager.wvc %2\services\config\aws_wvgate

call awwvcfg -c %2\services\config\aws_wvgate\InsightManager.wvc

echo Copying Compaq MIBs

call copy %1\mibs\cpq*.txt %2\services\config\mibs

call copy %1\mibs\inst*.bat %2\services\bin\install_cpqmibs.bat

echo Resetting the DSM

call %2\services\bin\resetdsm

:end