From 82be181f46fb67ee63444d291c0cbea2a7d183c1 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Fri, 30 Dec 2022 14:53:45 +0100 Subject: [PATCH] Find a better way to distribute personal files. #71 --- optional/install-openvpn.cmd | 24 -------------- scripts/settings.cmd | 2 ++ scripts/unpack-zipfiles.cmd | 5 --- software/download-from-ftp.cmd | 2 +- software/upload-to-ftp-singlefile.cmd | 2 +- software/upload-to-ftp.cmd | 2 +- tools/personalfiles.cmd | 46 +++++++++++++++++++++++++-- 7 files changed, 48 insertions(+), 35 deletions(-) diff --git a/optional/install-openvpn.cmd b/optional/install-openvpn.cmd index 8c2621c..4a7f321 100644 --- a/optional/install-openvpn.cmd +++ b/optional/install-openvpn.cmd @@ -5,28 +5,12 @@ if %ERRORLEVEL% neq 0 exit /b set OPT=..\optional set SOFTWARE=..\software set MSI=openvpn-setup.msi -set SETTINGS=..\personal\settings.cmd -set openvpn_configfile=configfile -set capicli="%ProgramFiles(x86)%\OpenVPN Technologies\OpenVPN Client\core\capicli.exe" if NOT EXIST %SOFTWARE%\%MSI% ( echo ERROR: %SOFTWARE%\%MSI% not found! 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 OpenVPN ... @@ -43,14 +27,6 @@ echo refreshing desktop (W10 style) ... ie4uinit.exe -show timeout /nobreak 5 -rem install configfile from folder personal ... -if EXIST ..\personal\%openvpn_configfile% ( - echo importing OpenVPN configfile ... - %capicli% -f ..\personal\%openvpn_configfile% ImportProfile -) else ( - echo no configfile found! -) - echo ####### %0 ####### pause diff --git a/scripts/settings.cmd b/scripts/settings.cmd index b745e54..d2745b9 100644 --- a/scripts/settings.cmd +++ b/scripts/settings.cmd @@ -7,4 +7,6 @@ set bgcol_R=3 set bgcol_G=131 set bgcol_B=135 set explorer_quick_access=1 +set gitserver=gitea.exabyte.systems +set gitrepo=personal diff --git a/scripts/unpack-zipfiles.cmd b/scripts/unpack-zipfiles.cmd index 4a4adc6..89d620e 100644 --- a/scripts/unpack-zipfiles.cmd +++ b/scripts/unpack-zipfiles.cmd @@ -3,7 +3,6 @@ set TOOLS=c:\tools set SOFTWARE=..\software set T=c:\TEMP -set WINSCPINI=..\personal\winscp.ini echo ####### %0 ####### @@ -125,10 +124,6 @@ echo. echo WinSCP move /Y %T%\winscp\*.exe %TOOLS% rd /S /Q %T%\winscp -if EXIST %WINSCPINI% ( - echo copying WinSCP ini file ... - copy /Y %WINSCPINI% %TOOLS% -) echo. echo WUB - Windows update blocker diff --git a/software/download-from-ftp.cmd b/software/download-from-ftp.cmd index 91f17c7..c5b7c19 100644 --- a/software/download-from-ftp.cmd +++ b/software/download-from-ftp.cmd @@ -1,5 +1,5 @@ @echo off -set FTPSETTINGS=..\personal\ftpsettings.cmd +set FTPSETTINGS=..\company\ftpsettings.cmd rem =================== rem CONFIGFILE CHECK diff --git a/software/upload-to-ftp-singlefile.cmd b/software/upload-to-ftp-singlefile.cmd index 63ae694..e96bbf3 100644 --- a/software/upload-to-ftp-singlefile.cmd +++ b/software/upload-to-ftp-singlefile.cmd @@ -1,5 +1,5 @@ @echo off -set FTPSETTINGS=..\personal\ftpsettings.cmd +set FTPSETTINGS=..\company\ftpsettings.cmd rem =================== rem CONFIGFILE CHECK diff --git a/software/upload-to-ftp.cmd b/software/upload-to-ftp.cmd index ff49ff8..d9f38bb 100644 --- a/software/upload-to-ftp.cmd +++ b/software/upload-to-ftp.cmd @@ -1,5 +1,5 @@ @echo off -set FTPSETTINGS=..\personal\ftpsettings.cmd +set FTPSETTINGS=..\company\ftpsettings.cmd rem =================== rem CONFIGFILE CHECK diff --git a/tools/personalfiles.cmd b/tools/personalfiles.cmd index 4a8ea4b..6ef8824 100644 --- a/tools/personalfiles.cmd +++ b/tools/personalfiles.cmd @@ -5,12 +5,52 @@ rem GLOBAL VARS rem =================== set TOOLS=c:\tools set PERSONALFILES_DONE=%LOCALAPPDATA%\.personalfiles_done +set SETTINGS=%TOOLS%\scripts\settings.cmd rem already done ? -if EXIST %PERSONALFILES_DONE% GOTO END +if EXIST %PERSONALFILES_DONE% ( + echo. + echo This was already DONE! + echo please remove the file [ %PERSONALFILES_DONE% ] to re-execute this! + GOTO END +) echo ####### %0 ####### +rem =================== +rem CONFIGFILE CHECK +rem =================== + +if NOT EXIST %SETTINGS% ( + echo. + echo WARNING: %SETTINGS% NOT FOUND + echo. +) else ( + call %SETTINGS% +) + +echo ++++++++++++++++++ +echo USERNAME=%USERNAME% +echo USERPROFILE=%USERPROFILE% +echo gitserver=%windows_updates% +echo gitrepo=%gitrepo% +echo ++++++++++++++++++ +echo. + +rem GIT folder anmd REPO ... +echo Creating folder %USERPROFILE%\workspace\git ... +mkdir %USERPROFILE%\workspace\git 1>nul 2>nul + +if NOT exist %USERPROFILE%\workspace\git ( + echo ERROR: cannot create folder [ %USERPROFILE%\workspace\git ] ! + echo ####### %0 ####### + exit /b +) + +echo cloning GIT repository ... +cd %USERPROFILE%\workspace\git +git clone https://%USERNAME%@%gitserver%/%USERNAME%/%gitrepo%.git + echo copying ini file for TOTALCOMMANDER ... if EXIST %TOOLS%\personal\WINCMD.ini ( copy /Y %TOOLS%\personal\WINCMD.ini %APPDATA%\GHISLER @@ -36,6 +76,6 @@ if EXIST %TOOLS%\personal\gitconfig ( rem create a statusfile (this codeblock must be executed only once per user) ... echo 1 >%PERSONALFILES_DONE% -:END - echo ####### %0 ####### + +:END