some fixes

This commit is contained in:
Michael H.G. Schmidt 2022-12-13 16:29:35 +01:00
parent 01f4993fad
commit 6aa581a222
4 changed files with 71 additions and 37 deletions

View File

@ -11,19 +11,21 @@ rem ===================
rem CONFIGFILE CHECK rem CONFIGFILE CHECK
rem =================== rem ===================
rem GLOBAL settings ... echo searching for SCRIPT settings ...
if EXIST %SCRIPT_SETTINGS% ( if NOT EXIST %SCRIPT_SETTINGS% (
call %SCRIPT_SETTINGS% echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
) else (
set LANG=en-US set LANG=en-US
) else (
echo OK. Loading SCRIPT settings ...
call %SCRIPT_SETTINGS%
) )
echo LANG=%LANG% echo LANG=%LANG%
rem COMPANY settings ...
set support_user= set support_user=
set support_password= set support_password=
echo searching for COMPANY settings ...
if NOT EXIST %COMPANY_SETTINGS% ( if NOT EXIST %COMPANY_SETTINGS% (
echo INFO: COMPANY %COMPANY_SETTINGS% NOT FOUND echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
) else ( ) else (
echo OK. Loading COMPANY settings ... echo OK. Loading COMPANY settings ...
call %COMPANY_SETTINGS% call %COMPANY_SETTINGS%

View File

@ -5,8 +5,6 @@ if %ERRORLEVEL% neq 0 exit /b
set OPT=..\optional set OPT=..\optional
set SOFTWARE=..\software set SOFTWARE=..\software
set MSI=emclient-setup.msi set MSI=emclient-setup.msi
set SETTINGS=..\company\settings.cmd
set emclient_license=0
set EMSERVERIP=168.62.48.183 set EMSERVERIP=168.62.48.183
if NOT EXIST %SOFTWARE%\%MSI% ( if NOT EXIST %SOFTWARE%\%MSI% (
@ -14,18 +12,6 @@ if NOT EXIST %SOFTWARE%\%MSI% (
exit /b exit /b
) )
rem ===================
rem CONFIGFILE CHECK
rem ===================
if NOT EXIST %SETTINGS% (
echo.
echo WARNING: %SETTINGS% NOT FOUND
echo.
) else (
call %SETTINGS%
)
echo ####### %0 ####### echo ####### %0 #######
echo installing em-Client ... echo installing em-Client ...
@ -53,14 +39,7 @@ netsh advfirewall firewall delete rule name="block_emclient_updates" 2>nul
netsh advfirewall firewall add rule name="block_emclient_updates" ^ netsh advfirewall firewall add rule name="block_emclient_updates" ^
dir=out action=block protocol=tcp localip=any remoteip=%EMSERVERIP% ^ dir=out action=block protocol=tcp localip=any remoteip=%EMSERVERIP% ^
remoteport=80,443 program="%ProgramFiles(x86)%\eM Client\MailClient.exe" remoteport=80,443 program="%ProgramFiles(x86)%\eM Client\MailClient.exe"
echo.
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 ####### echo ####### %0 #######
pause pause

View File

@ -41,7 +41,7 @@ Get-ChildItem $topViews | % {
} }
write-host 'restarting explorer ...' write-host 'restarting explorer ...'
Get-Process Explorer | Stop-Process Get-Process Explorer | ? {$_.SI -eq (Get-Process -PID $PID).SessionId} | Stop-Process
write-host '#######',(split-path $PSCommandPath -Leaf),'#######' write-host '#######',(split-path $PSCommandPath -Leaf),'#######'

View File

@ -1,7 +1,9 @@
@echo off @echo off
set TOOLS=c:\tools set TOOLS=c:\tools
set SETTINGS=%TOOLS%\scripts\settings.cmd set SCRIPT_SETTINGS=%TOOLS%\scripts\settings.cmd
set STATUSFILE=%LOCALAPPDATA%\.user_settings_done set COMPANY_SETTINGS=%TOOLS%\company\settings.cmd
set USERCONFIG_DONE=%LOCALAPPDATA%\.user_settings_done
set EMLICENSE_DONE=%LOCALAPPDATA%\.emlicense_done
set STARTMENU=%APPDATA%\"Microsoft\Windows\Start Menu\Programs" set STARTMENU=%APPDATA%\"Microsoft\Windows\Start Menu\Programs"
set STARTMENU_PUBLIC=%PROGRAMDATA%\"Microsoft\Windows\Start Menu\Programs" set STARTMENU_PUBLIC=%PROGRAMDATA%\"Microsoft\Windows\Start Menu\Programs"
@ -15,10 +17,31 @@ set bgcol_R=0
set bgcol_G=0 set bgcol_G=0
set bgcol_B=0 set bgcol_B=0
if EXIST %SETTINGS% ( rem ===================
echo loading settings ... rem CONFIGFILE CHECK
call %SETTINGS% rem ===================
echo searching for SCRIPT settings ...
if NOT EXIST %SCRIPT_SETTINGS% (
echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
set LANG=en-US
) else (
echo OK. Loading SCRIPT settings ...
call %SCRIPT_SETTINGS%
) )
echo LANG=%LANG%
set support_user=
set support_password=
set emclient_license=0
echo searching for COMPANY settings ...
if NOT EXIST %COMPANY_SETTINGS% (
echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
) else (
echo OK. Loading COMPANY settings ...
call %COMPANY_SETTINGS%
)
echo setting desktop colour (RGB) ... echo setting desktop colour (RGB) ...
%TOOLS%\setbgcol %bgcol_R% %bgcol_G% %bgcol_B% %TOOLS%\setbgcol %bgcol_R% %bgcol_G% %bgcol_B%
@ -93,7 +116,33 @@ if EXIST %USERPROFILE%\Seafile (
attrib -S %USERPROFILE%\Seafile /S /D attrib -S %USERPROFILE%\Seafile /S /D
) )
if EXIST %STATUSFILE% GOTO END
rem licensing already done ?
if EXIST %EMLICENSE_DONE% GOTO :USERCONFIG
echo.
echo #####
echo ##### LICENSING
echo #####
echo.
if %emclient_license% == 0 (
echo no em Client license found!
) else (
echo
echo adding em Client license ...
"%ProgramFiles(x86)%\eM Client\MailClient.exe" /activate %emclient_license%
echo.
)
rem create a statusfile (this block must be executed only once) ...
echo 1 >%EMLICENSE_DONE%
:USERCONFIG
rem already done ?
if EXIST %USERCONFIG_DONE% GOTO END
if EXIST %TOOLS%\personal ( if EXIST %TOOLS%\personal (
echo. echo.
@ -199,17 +248,19 @@ powershell -command %TOOLS%\scripts\disable-networkfeatures.ps1
echo cleaning START menu tiles ... echo cleaning START menu tiles ...
powershell -command %TOOLS%\scripts\cleanup-tiles.ps1 powershell -command %TOOLS%\scripts\cleanup-tiles.ps1
rem create statusfile (this block must be executed only once) ... rem create a statusfile (this block must be executed only once) ...
echo 1 >%STATUSFILE% echo 1 >%USERCONFIG_DONE%
:END :END
echo. echo.
echo ##### echo #####
echo ##### CLEANING ... echo ##### CLEANING ...
echo ##### echo #####
echo. echo.
echo Reorganizing start menu and desktop ... echo Reorganizing start menu and desktop ...
echo ######################################## echo ########################################
echo. echo.
@ -260,6 +311,7 @@ rem WARNING!
rem DO NOT remove the "PICTURES" folder! rem DO NOT remove the "PICTURES" folder!
rem this is used by the snipping tool! rem this is used by the snipping tool!
echo Cleaning users home directory ... echo Cleaning users home directory ...
echo ######################################## echo ########################################
echo. echo.
@ -305,6 +357,7 @@ net config workstation
echo ####### %0 ####### echo ####### %0 #######
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo # unknown ERROR! # echo # unknown ERROR! #
echo ####### %0 ####### echo ####### %0 #######