:: Ultimate RLM floating license server installer
:: Developed by Ahad Mohebbi
@echo Off
if [%1] == [] goto helprlm
if [%1] == [--help] goto helprlm
if [%1] == [--add] goto setuprlm
if [%1] == [--remove] goto removerlm
REM extract license files...
REM setup License environments...
echo.

:helprlm
echo RLM License Manager for Client[s]...
echo developed by Ahad Mohebbi
echo. 
echo Usage: rlm_client.cmd [ARGUMENT] [OPTION]
echo Add and Remove License environment for client[s]
echo.
echo [ARGUMENTS]
echo --add          add license environment to the client[s].
echo --remove       remove license environment to the client[s].
echo --help         display how to use this script.
echo.
echo [OPTION]
echo YOUR_SERVER_HOST_NAME   [OR]   YOUR_SERVER_IP 
echo.
echo Examples:
echo add license environment...
echo 	sudo rlm_client.cmd --add VFX_SERVER
echo 	sudo rlm_client.cmd -add 192.168.1.50
echo.
echo remove license environment...
echo 	sudo rlm_client.cmd --remove
echo.
exit /b


:setuprlm
if [%2]==[] goto :helprlm
setx fabricinc_LICENSE 5053@%2
setx foundry_LICENSE 5053@%2
setx genarts_LICENSE 5053@%2
setx golaem_LICENSE 5053@%2
setx innobright_LICENSE 5053@%2
setx mootzoid_LICENSE 5053@%2
setx nextlimit_LICENSE 5053@%2
setx peregrinel_LICENSE 5053@%2
setx redshift_LICENSE 5053@%2
setx solidangle_LICENSE 5053@%2
setx SFX_LICENSE_SERVER 5053@%2
echo.
echo RLM License Manager successfully on your client[s].
exit /b



:removerlm
REG delete HKCU\Environment /F /V fabricinc_LICENSE
REG delete HKCU\Environment /F /V foundry_LICENSE
REG delete HKCU\Environment /F /V genarts_LICENSE
REG delete HKCU\Environment /F /V golaem_LICENSE
REG delete HKCU\Environment /F /V innobright_LICENSE
REG delete HKCU\Environment /F /V mootzoid_LICENSE
REG delete HKCU\Environment /F /V nextlimit_LICENSE
REG delete HKCU\Environment /F /V peregrinel_LICENSE
REG delete HKCU\Environment /F /V redshift_LICENSE
REG delete HKCU\Environment /F /V solidangle_LICENSE
REG delete HKCU\Environment /F /V SFX_LICENSE_SERVER
echo.
echo RLM License removed successfully on your client[s].
exit /b