This commit is contained in:
Michael H.G. Schmidt 2022-12-18 16:10:09 +01:00
parent aa16f35422
commit b459cbd77c
3 changed files with 134 additions and 118 deletions

View File

@ -21,6 +21,14 @@ msiexec /i %MSI% /qn
@echo off
cd %OPT%
echo remapping Desktop folder to standard location ...
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" ^
/v Desktop /t REG_EXPAND_SZ /d "%USERPROFILE%\Desktop" /f 1>nul
echo restarting explorer ...
taskkill /f /im explorer.exe 1>nul 2>nul
start explorer.exe
echo removing SeaFile Desktop icon ...
del /F "%Public%\Desktop\SeaFile.lnk" 2>nul

View File

@ -1,39 +1,44 @@
@echo off
rem ===================
rem GLOBAL VARS
rem ===================
set TOOLS=c:\tools
set SCRIPT_SETTINGS=%TOOLS%\scripts\settings.cmd
set COMPANY_SETTINGS=%TOOLS%\company\settings.cmd
set USERCONFIG_DONE=%LOCALAPPDATA%\.user_settings_done
set USERCONFIG_DONE=%LOCALAPPDATA%\.userconfig_done
set EMLICENSE_DONE=%LOCALAPPDATA%\.emlicense_done
set STARTMENU=%APPDATA%\"Microsoft\Windows\Start Menu\Programs"
set STARTMENU_PUBLIC=%PROGRAMDATA%\"Microsoft\Windows\Start Menu\Programs"
echo ####### %0 #######
echo removing wallpaper ...
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper /t REG_SZ /d " " /f 1>nul
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
rem ===================
rem DEFAULTS
rem ===================
set bgcol_R=0
set bgcol_G=0
set bgcol_B=0
set LANG=en-US
set support_user=
set support_password=
set emclient_license=0
echo ####### %0 #######
rem ===================
rem CONFIGFILE CHECK
rem CONFIGFILE CHECKS
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%
)
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
@ -42,6 +47,39 @@ if NOT EXIST %COMPANY_SETTINGS% (
call %COMPANY_SETTINGS%
)
rem ===================
rem EMCLIENT LICENSING
rem ===================
rem licensing for emClient already done ?
if EXIST %EMLICENSE_DONE% GOTO EMCLIENT_END
if %emclient_license% == 0 (
echo no em Client license found!
) else (
echo.
if EXIST "%ProgramFiles(x86)%\eM Client\MailClient.exe" (
echo adding em Client license ...
"%ProgramFiles(x86)%\eM Client\MailClient.exe" /activate %emclient_license%
rem create a statusfile (this codeblock must be executed only once per use) ...
echo 1 >%EMLICENSE_DONE%
) else (
echo em Client is NOT installed!
)
echo.
)
:EMCLIENT_END
rem ================================================
rem GENERIC SETTINGS FOR THE USER (this runs always)
rem ================================================
echo removing wallpaper ...
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper /t REG_SZ /d " " /f 1>nul
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
echo setting desktop colour (RGB) ...
%TOOLS%\setbgcol %bgcol_R% %bgcol_G% %bgcol_B%
@ -52,122 +90,43 @@ echo starting BGInfo ...
echo setting RECYCLE BIN limits ...
powershell -command %TOOLS%\scripts\set-recyclebin.ps1
echo.
echo #####
echo ##### USER CONFIG FILES
echo #####
echo.
echo remapping Desktop folder to standard location ...
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" ^
/v Desktop /t REG_EXPAND_SZ /d "%USERPROFILE%\Desktop" /f 1>nul
rem ================================================
rem USER TWEAKS AND CONFIG FILES (this runs always)
rem ================================================
rem User tweaks already done ?
if EXIST %USERCONFIG_DONE% GOTO USERTWEAKS_DONE
rem WORKSPACE folder
echo creating folder %USERPROFILE%\workspace ...
mkdir %USERPROFILE%\workspace 1>nul 2>nul
rem SSH
mkdir %USERPROFILE%\workspace 1>nul 2>nul
echo setting up ssh client ...
mkdir %USERPROFILE%\.ssh 1>nul 2>nul
if NOT EXIST %USERPROFILE%\.ssh\config (
echo setup for SSH ...
copy /Y %TOOLS%\scripts\config\ssh-config.txt %USERPROFILE%\.ssh\config
)
rem GIT
if NOT EXIST %USERPROFILE%\.gitconfig (
if EXIST %TOOLS%\personal\gitconfig (
echo setup for GIT ...
copy /Y %TOOLS%\personal\gitconfig %USERPROFILE%\.gitconfig
)
)
copy /Y %TOOLS%\scripts\config\ssh-config.txt %USERPROFILE%\.ssh\config
rem VIM
if NOT EXIST %USERPROFILE%\.vimrc (
echo setup for VIM ...
copy /Y %TOOLS%\scripts\config\vimrc.txt ^
%USERPROFILE%\.vimrc
)
rem TOTALCOMMANDER
if NOT EXIST %APPDATA%\GHISLER\WINCMD.ini (
echo copying ini file for TOTALCOMMANDER ...
mkdir %APPDATA%\GHISLER 1>nul 2>nul
rem ini file ...
if EXIST %TOOLS%\personal\WINCMD.ini (
copy /Y %TOOLS%\personal\WINCMD.ini %APPDATA%\GHISLER
) else (
copy /Y %TOOLS%\optional\config\WINCMD.ini %APPDATA%\GHISLER
)
rem ftp config file ...
if EXIST %TOOLS%\personal\wcx_ftp.ini (
copy /Y %TOOLS%\personal\wcx_ftp.ini %APPDATA%\GHISLER
) else (
copy /Y %TOOLS%\optional\config\wcx_ftp.ini %APPDATA%\GHISLER
)
)
echo copying vimrc ...
copy /Y %TOOLS%\scripts\config\vimrc.txt %USERPROFILE%\.vimrc
rem WINDOWS TERMINAL
echo seting up WINDOWS TERMINAL ...
set LOCALSTATE=%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
if NOT EXIST %LOCALSTATE%\settings.json (
echo setup for WINDOWS TERMINAL
mkdir %LOCALSTATE% 1>nul 2>nul
copy /Y %TOOLS%\scripts\config\wt-settings.json ^
%LOCALSTATE%\settings.json
)
mkdir %LOCALSTATE% 1>nul 2>nul
copy /Y %TOOLS%\scripts\config\wt-settings.json %LOCALSTATE%\settings.json
rem SEAFILE
rem fix for broken SEAFILE folder access rights ...
if EXIST %USERPROFILE%\Seafile (
echo removing SEAFILE system attributes ...
attrib -S %USERPROFILE%\Seafile /S /D
)
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.
if EXIST "%ProgramFiles(x86)%\eM Client\MailClient.exe" (
echo adding em Client license ...
"%ProgramFiles(x86)%\eM Client\MailClient.exe" /activate %emclient_license%
rem create a statusfile (this block must be executed only once) ...
echo 1 >%EMLICENSE_DONE%
) else (
echo em Client is NOT installed!
)
echo.
)
rem ###
rem ### USERCONFIG (this part must be excuted only ONCE PER USER)
rem ###
:USERCONFIG
rem already done ?
if EXIST %USERCONFIG_DONE% GOTO END
if EXIST %TOOLS%\personal (
echo.
echo #####
echo ##### SSH KEYS
echo #####
echo.
copy /Y %TOOLS%\personal\id*.* %USERPROFILE%\.ssh 2>nul
)
echo.
echo #####
echo ##### USER TWEAKS
echo #####
echo.
echo Adding "This PC" icon for current user on desktop Windows 10 ...
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" ^
/v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 0 /f 1>nul
@ -257,11 +216,14 @@ powershell -command %TOOLS%\scripts\disable-networkfeatures.ps1
echo cleaning START menu tiles ...
powershell -command %TOOLS%\scripts\cleanup-tiles.ps1
rem create a statusfile (this block must be executed only once) ...
rem create a statusfile (this codeblock must be executed only once per user) ...
echo 1 >%USERCONFIG_DONE%
:END
:USERTWEAKS_DONE
rem ========================================
rem ACCOUNT CLEANUP AND FIXES (runs always)
rem ========================================
echo.
echo #####
@ -269,7 +231,6 @@ echo ##### CLEANING ...
echo #####
echo.
echo Reorganizing start menu and desktop ...
echo ########################################
echo.
@ -366,7 +327,6 @@ net config workstation
echo ####### %0 #######
if %ERRORLEVEL% NEQ 0 (
echo # unknown ERROR! #
echo ####### %0 #######

48
tools/personalfiles.cmd Normal file
View File

@ -0,0 +1,48 @@
@echo off
rem ===================
rem GLOBAL VARS
rem ===================
set TOOLS=c:\tools
set PERSONALFILES_DONE=%LOCALAPPDATA%\.personalfiles_done
rem already done ?
if EXIST %PERSONALFILES_DONE% GOTO END
echo ####### %0 #######
rem TOTALCOMMANDER config ...
mkdir %APPDATA%\GHISLER 1>nul 2>nul
echo copying ini files for TOTALCOMMANDER ...
if EXIST %TOOLS%\personal\WINCMD.ini (
copy /Y %TOOLS%\personal\WINCMD.ini %APPDATA%\GHISLER
) else (
copy /Y %TOOLS%\optional\config\WINCMD.ini %APPDATA%\GHISLER
)
rem ftp config file ...
if EXIST %TOOLS%\personal\wcx_ftp.ini (
copy /Y %TOOLS%\personal\wcx_ftp.ini %APPDATA%\GHISLER
) else (
copy /Y %TOOLS%\optional\config\wcx_ftp.ini %APPDATA%\GHISLER
)
rem SSH keys ...
if EXIST %TOOLS%\personal (
echo copying personal SSH keys ...
copy /Y %TOOLS%\personal\id*.* %USERPROFILE%\.ssh 2>nul
)
rem GIT
if EXIST %TOOLS%\personal\gitconfig (
echo copying gitconfig ...
copy /Y %TOOLS%\personal\gitconfig %USERPROFILE%\.gitconfig
)
rem create a statusfile (this codeblock must be executed only once per user) ...
echo 1 >%PERSONALFILES_DONE%
:END
echo ####### %0 #######