From faa0e0b72cc6f3f60984264b510f4dc2bad16637 Mon Sep 17 00:00:00 2001 From: asmtron <49522124+asmtron@users.noreply.github.com> Date: Sun, 13 Dec 2020 18:46:45 +0000 Subject: [PATCH] Update autoupdate.bat - changed the restart method so we can copy and not stream the new downloaded ini; hope this fixes problems with loading of the new ini file on some systems... - add no-admin warning with pause, --- bin/autoupdate.bat | 47 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/bin/autoupdate.bat b/bin/autoupdate.bat index 623ebeb..ba1db7e 100644 --- a/bin/autoupdate.bat +++ b/bin/autoupdate.bat @@ -7,7 +7,7 @@ REM ------------------------------------------------------------------- REM REM autoupdate.bat REM -REM Automatic RDP Wrapper installer and updater // asmtron (12-06-2020) +REM Automatic RDP Wrapper installer and updater // asmtron (12-12-2020) REM ------------------------------------------------------------------- REM Options: REM -log = redirect display output to the file autoupdate.log @@ -32,7 +32,7 @@ set rdpwrap_ini_update_github_2="https://raw.githubusercontent.com/affinityv/INI set rdpwrap_ini_update_github_3="https://raw.githubusercontent.com/DrDrrae/rdpwrap/master/res/rdpwrap.ini" set rdpwrap_ini_update_github_4="https://raw.githubusercontent.com/saurav-biswas/rdpwrap-1/master/res/rdpwrap.ini" REM set rdpwrap_ini_update_github_5="https://raw.githubusercontent.com/....Extra.5...." -REM set rdpwrap_ini_update_github_6="https://raw.githubusercontent.com/....Extra.5...." +REM set rdpwrap_ini_update_github_6="https://raw.githubusercontent.com/....Extra.6...." set autoupdate_bat="%~dp0autoupdate.bat" set autoupdate_log="%~dp0autoupdate.log" @@ -79,9 +79,13 @@ if not exist %RDPWInst_exe% goto :error_install goto :start_check :not_admin -echo [-] This script must be run as administrator to work properly^^! +color 0e +echo ___________________________________ +echo [x] ERROR - No Administrator Rights +echo [*] This script must be run as administrator to work properly^^! echo ^ echo. +pause goto :finish :error_install echo [-] RDP Wrapper installer executable (RDPWInst.exe) not found^^! @@ -225,30 +229,23 @@ REM ------------------- REM Restart RDP Wrapper REM ------------------- :restart -if %rdpwrap_installed%=="0" ( - call :install -) -REM NOTE - normal copy of the file "rdpwrap_new.ini" to "rdpwrap.ini" will not work (file locked) -REM we need to stream the data from "rdpwrap_new.ini" to "rdpwrap.ini" +echo. +echo [*] Restart RDP Wrapper with new ini (unistall and reistall)... +echo. +%RDPWInst_exe% -u if exist %rdpwrap_new_ini% ( - echo [*] Start streaming %rdpwrap_new_ini% to %rdpwrap_ini%... - ( - for /f "usebackq delims=" %%a in ( - `findstr /n "^" %rdpwrap_new_ini%` - ) do ( - if "!%%a!"=="" ( - echo. - ) else ( - echo !%%a! - ) - ) - )>%rdpwrap_ini% - echo [+] Update of %rdpwrap_ini% finished successfully. + echo. + echo [*] Use latest downloaded rdpwrap.ini from GitHub... + echo -^> %rdpwrap_ini_url% + echo -^> %rdpwrap_new_ini% + echo -^> %rdpwrap_ini% + echo [+] copy %rdpwrap_new_ini% to %rdpwrap_ini%... + copy %rdpwrap_new_ini% %rdpwrap_ini% + echo. +) else ( + echo [x] ERROR - File %rdpwrap_new_ini% is missing ^^! ) -echo. -echo [*] Restart RDP Wrapper... -echo. -%RDPWInst_exe% -r +%RDPWInst_exe% -i call :setNLA goto :eof