From 01f4993fad5f9ab30826e10c6dac5896e8534955 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Mon, 12 Dec 2022 22:09:21 +0100 Subject: [PATCH] Modify em-Client script to add license automatically #43 --- optional/install-emclient.cmd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/optional/install-emclient.cmd b/optional/install-emclient.cmd index 67597a2..79913ce 100644 --- a/optional/install-emclient.cmd +++ b/optional/install-emclient.cmd @@ -5,6 +5,8 @@ if %ERRORLEVEL% neq 0 exit /b set OPT=..\optional set SOFTWARE=..\software set MSI=emclient-setup.msi +set SETTINGS=..\company\settings.cmd +set emclient_license=0 set EMSERVERIP=168.62.48.183 if NOT EXIST %SOFTWARE%\%MSI% ( @@ -12,6 +14,18 @@ if NOT EXIST %SOFTWARE%\%MSI% ( exit /b ) +rem =================== +rem CONFIGFILE CHECK +rem =================== + +if NOT EXIST %SETTINGS% ( + echo. + echo WARNING: %SETTINGS% NOT FOUND + echo. +) else ( + call %SETTINGS% +) + echo ####### %0 ####### echo installing em-Client ... @@ -40,6 +54,14 @@ netsh advfirewall firewall add rule name="block_emclient_updates" ^ dir=out action=block protocol=tcp localip=any remoteip=%EMSERVERIP% ^ remoteport=80,443 program="%ProgramFiles(x86)%\eM Client\MailClient.exe" +if emclient_license == 0 ( + echo no em Client license found! +) else ( + echo adding em Client license ... + "%ProgramFiles(x86)%\eM Client\MailClient.exe" /deactivate + "%ProgramFiles(x86)%\eM Client\MailClient.exe" /activate %emclient_license% +) + echo ####### %0 ####### pause