From 37a2b18ef06d1d70f64c3c6c0458c8a02211543d Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Wed, 27 Dec 2023 11:12:41 +0100 Subject: [PATCH] emclient settings integrated in logon script --- optional/install-emclient.cmd | 4 -- .../config/emclient-defaults.xml | 0 tools/logon.cmd | 45 +++++++++++++++---- 3 files changed, 36 insertions(+), 13 deletions(-) rename {optional => scripts}/config/emclient-defaults.xml (100%) diff --git a/optional/install-emclient.cmd b/optional/install-emclient.cmd index 0ed220d..8f42af6 100644 --- a/optional/install-emclient.cmd +++ b/optional/install-emclient.cmd @@ -5,7 +5,6 @@ if %ERRORLEVEL% neq 0 exit /b set OPT=..\optional set SOFTWARE=..\software set MSI=emclient-setup.msi -set CONFIG=config\emclient-defaults.xml set EMSERVERIP=104.22.21.185,172.67.15.154,104.22.20.185 if NOT EXIST %SOFTWARE%\%MSI% ( @@ -47,9 +46,6 @@ netsh advfirewall firewall add rule name="block_emclient_updates" ^ rem show new rule ... netsh advfirewall firewall show rule name="block_emclient_updates" -echo setting defaults for emclient ... -"%ProgramFiles(x86)%\eM Client\MailClient.exe" /importsettings -s %CONFIG% - echo ####### %0 ####### rem set filetypes ... diff --git a/optional/config/emclient-defaults.xml b/scripts/config/emclient-defaults.xml similarity index 100% rename from optional/config/emclient-defaults.xml rename to scripts/config/emclient-defaults.xml diff --git a/tools/logon.cmd b/tools/logon.cmd index 72fd79d..5c39b93 100644 --- a/tools/logon.cmd +++ b/tools/logon.cmd @@ -10,6 +10,8 @@ set COMPANY_SETTINGS=%TOOLS%\company\settings.cmd set CUSTOM_SCRIPT=%TOOLS%\company\custom.cmd set USERCONFIG_DONE="%LOCALAPPDATA%"\.userconfig_done set EMLICENSE_DONE="%LOCALAPPDATA%"\.emlicense_done +set EMSETTINGS_DONE="%LOCALAPPDATA%"\.emsettings_done +set EMCLIENT_CONFIG=%TOOLS%\scripts\config\emclient-defaults.xml set STARTMENU=%APPDATA%\Microsoft\Windows\Start Menu\Programs set STARTMENU_PUBLIC=%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs @@ -17,9 +19,9 @@ rem =================== rem DEFAULTS rem =================== -set bgcol_R=0 -set bgcol_G=0 -set bgcol_B=0 +set bgcol_R=3 +set bgcol_G=131 +set bgcol_B=135 set LANG=en-US set localadmin=localadmin set emclient_license=0 @@ -98,15 +100,15 @@ if EXIST "%USERPROFILE%"\Seafile ( attrib -S "%USERPROFILE%"\Seafile /S /D 1>nul 2>nul ) -rem =================== +rem ================== rem EMCLIENT LICENSING -rem =================== +rem ================== rem licensing for emClient already done ? -if EXIST %EMLICENSE_DONE% GOTO EMCLIENT_DONE +if EXIST %EMLICENSE_DONE% GOTO EMCLIENT_DONE_1 rem no emClient for the Admin! -if "%USERNAME%" == "%localadmin%" GOTO EMCLIENT_DONE +if "%USERNAME%" == "%localadmin%" GOTO EMCLIENT_DONE_1 if %emclient_license% == 0 ( echo no emClient license found! @@ -120,12 +122,37 @@ if %emclient_license% == 0 ( echo 1 >%EMLICENSE_DONE% ) else ( - echo emClient is NOT installed! + echo emClient is NOT installed! [License] ) echo. ) -:EMCLIENT_DONE +:EMCLIENT_DONE_1 + + +rem ================= +rem EMCLIENT SETTINGS +rem ================= + +rem licensing for emClient already done ? +if EXIST %EMSETTINGS_DONE% GOTO EMCLIENT_DONE_2 + +rem no emClient for the Admin! +if "%USERNAME%" == "%localadmin%" GOTO EMCLIENT_DONE_2 + +if EXIST "%ProgramFiles(x86)%\eM Client\MailClient.exe" ( + echo setting defaults for emclient ... + "%ProgramFiles(x86)%\eM Client\MailClient.exe" /importsettings -s %EMCLIENT_CONFIG% + + rem create a statusfile (this codeblock must be executed only once per use) ... + echo 1 >%EMSETTINGS_DONE% + +) else ( + echo emClient is NOT installed! [Settings] +) +echo. + +:EMCLIENT_DONE_2 rem ===================================================== rem ACCOUNT TWEAKS AND CONFIG FILES (this runs only once)