rem dll file check

if EXIST "C:\Program Files (x86)\i-PRO\iCTPlugin\PSSCTGecModule.dll" (
    SET path_dll="C:\Program Files (x86)\i-PRO\iCTPlugin\PSSCTGecModule.dll" 
) else if EXIST "C:\Users\%USERNAME%\AppData\Local\Apps\i-PRO\iCTPlugin\PSSCTGecModule.dll" (
    SET path_dll="C:\Users\%USERNAME%\AppData\Local\Apps\i-PRO\iCTPlugin\PSSCTGecModule.dll"
) else (
    GOTO End
)


rem exe file check

if EXIST "C:\Program Files (x86)\i-PRO\iCTPlugin\Plugin.exe" (
    SET path_exe="C:\Program Files (x86)\i-PRO\iCTPlugin\Plugin.exe"
) else if EXIST "C:\Users\%USERNAME%\AppData\Local\Apps\i-PRO\iCTPlugin\Plugin.exe" (
    SET path_exe="C:\Users\%USERNAME%\AppData\Local\Apps\i-PRO\iCTPlugin\Plugin.exe"
) else (
    GOTO End
)


rem dll registar

rem 32 bits
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v ClientModule /t REG_SZ /d %path_dll% /f /reg:32
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v Enabled /t REG_SZ /d "True" /f /reg:32
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v ServerModule /t REG_SZ /d %path_dll% /f /reg:32
rem 64 bits
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v ClientModule /t REG_SZ /d %path_dll% /f /reg:64
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v Enabled /t REG_SZ /d "True" /f /reg:64
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Genetec\Security Center\Plugins\iCTPlugin" /v ServerModule /t REG_SZ /d %path_dll% /f /reg:64


rem exe registar

rem 32 bits
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\i-PRO" /v i-PROSettingPath /t REG_SZ /d %path_exe% /f /reg:32
rem 64 bits
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\i-PRO" /v i-PROSettingPath /t REG_SZ /d %path_exe% /f /reg:64


:End:
rem pause
