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,
This commit is contained in:
parent
97cc58a998
commit
faa0e0b72c
|
@ -7,7 +7,7 @@ REM -------------------------------------------------------------------
|
||||||
REM
|
REM
|
||||||
REM autoupdate.bat
|
REM autoupdate.bat
|
||||||
REM
|
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 -------------------------------------------------------------------
|
||||||
REM Options:
|
REM Options:
|
||||||
REM -log = redirect display output to the file autoupdate.log
|
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_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"
|
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_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_bat="%~dp0autoupdate.bat"
|
||||||
set autoupdate_log="%~dp0autoupdate.log"
|
set autoupdate_log="%~dp0autoupdate.log"
|
||||||
|
@ -79,9 +79,13 @@ if not exist %RDPWInst_exe% goto :error_install
|
||||||
goto :start_check
|
goto :start_check
|
||||||
|
|
||||||
:not_admin
|
: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 ^<Please use 'right click' on this batch file and select "Run As Administrator"^>
|
echo ^<Please use 'right click' on this batch file and select "Run As Administrator"^>
|
||||||
echo.
|
echo.
|
||||||
|
pause
|
||||||
goto :finish
|
goto :finish
|
||||||
:error_install
|
:error_install
|
||||||
echo [-] RDP Wrapper installer executable (RDPWInst.exe) not found^^!
|
echo [-] RDP Wrapper installer executable (RDPWInst.exe) not found^^!
|
||||||
|
@ -225,30 +229,23 @@ REM -------------------
|
||||||
REM Restart RDP Wrapper
|
REM Restart RDP Wrapper
|
||||||
REM -------------------
|
REM -------------------
|
||||||
:restart
|
:restart
|
||||||
if %rdpwrap_installed%=="0" (
|
echo.
|
||||||
call :install
|
echo [*] Restart RDP Wrapper with new ini (unistall and reistall)...
|
||||||
)
|
echo.
|
||||||
REM NOTE - normal copy of the file "rdpwrap_new.ini" to "rdpwrap.ini" will not work (file locked)
|
%RDPWInst_exe% -u
|
||||||
REM we need to stream the data from "rdpwrap_new.ini" to "rdpwrap.ini"
|
|
||||||
if exist %rdpwrap_new_ini% (
|
if exist %rdpwrap_new_ini% (
|
||||||
echo [*] Start streaming %rdpwrap_new_ini% to %rdpwrap_ini%...
|
echo.
|
||||||
(
|
echo [*] Use latest downloaded rdpwrap.ini from GitHub...
|
||||||
for /f "usebackq delims=" %%a in (
|
echo -^> %rdpwrap_ini_url%
|
||||||
`findstr /n "^" %rdpwrap_new_ini%`
|
echo -^> %rdpwrap_new_ini%
|
||||||
) do (
|
echo -^> %rdpwrap_ini%
|
||||||
if "!%%a!"=="" (
|
echo [+] copy %rdpwrap_new_ini% to %rdpwrap_ini%...
|
||||||
echo.
|
copy %rdpwrap_new_ini% %rdpwrap_ini%
|
||||||
) else (
|
echo.
|
||||||
echo !%%a!
|
) else (
|
||||||
)
|
echo [x] ERROR - File %rdpwrap_new_ini% is missing ^^!
|
||||||
)
|
|
||||||
)>%rdpwrap_ini%
|
|
||||||
echo [+] Update of %rdpwrap_ini% finished successfully.
|
|
||||||
)
|
)
|
||||||
echo.
|
%RDPWInst_exe% -i
|
||||||
echo [*] Restart RDP Wrapper...
|
|
||||||
echo.
|
|
||||||
%RDPWInst_exe% -r
|
|
||||||
call :setNLA
|
call :setNLA
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue