@Echo Off
cls
echo    Installing the RLM License Server on Microsoft Windows   
echo ============================================================
echo.
echo.
echo.

unzip ./rlm.zip -x -d "%ProgramFiles%"

echo.
echo.
echo.

cd "%ProgramFiles%\rlm"
rlm.exe -install_service -service_name RLM_License_Server -dlog +"%ProgramFiles%\rlm\rlm_lic.dlog" -c "%ProgramFiles%\rlm\solidangle.lic"
start /B rlm.exe -dlog +"%ProgramFiles%\rlm\rlm_lic.dlog"
net start RLM_License_Server
echo.
echo.
echo.

REM foundry License File

if not exist "%ProgramData%\The Foundry\RLM" mkdir "%ProgramData%\The Foundry\RLM"
if not exist "%ProgramData%\The Foundry\FLEXlm" mkdir "%ProgramData%\The Foundry\FLEXlm"
if not exist "%ProgramData%\The Foundry\RLM\log" mkdir "%ProgramData%\The Foundry\RLM\log"
if not exist "%ProgramData%\The Foundry\FLEXlm\log" mkdir "%ProgramData%\The Foundry\FLEXlm\log"
COPY "foundry.lic"  "%ProgramData%\The Foundry\RLM"
COPY "foundry.set"  "%ProgramData%\The Foundry\RLM"

echo.
echo.
echo.


REM PeregrineLabs License File

if not exist "%ProgramData%\PeregrineLabs/rlm/" mkdir "%ProgramData%\PeregrineLabs/rlm/"
COPY "peregrinel.lic"  "%ProgramData%\PeregrineLabs/rlm/"
COPY "peregrinel.set"  "%ProgramData%\PeregrineLabs/rlm/"

echo.
echo.
echo.


REM GenArts License Server

if not exist "%ProgramData%\GenArts\rlm" mkdir "%ProgramData%\GenArts\rlm"
del /Q "%ProgramData%\GenArts\rlm\*.*"
COPY "genarts.lic"  "%ProgramData%\GenArts\rlm"
COPY "genarts.set"  "%ProgramData%\GenArts\rlm"

echo.
echo.
echo.
echo The RLM License Server Successfully Installed.
CD %HOMEPATH%

pause
Exit /B 5



