fix rdpwrap_force_uninstall

This commit is contained in:
asmtron 2022-01-01 14:40:12 +00:00 committed by GitHub
parent 807e30973f
commit 9c8d0f1893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ setlocal EnableDelayedExpansion
:: \_||_|\____|\___\___/ \____| ||_/ \____|\_||_|\___\____(_|____/ \_||_|\___) :: \_||_|\____|\___\___/ \____| ||_/ \____|\_||_|\___\____(_|____/ \_||_|\___)
:: |_| :: |_|
:: ::
:: Automatic RDP Wrapper installer and updater asmtron (2021-12-16) :: Automatic RDP Wrapper installer and updater asmtron (2022-01-01)
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: Options: :: Options:
:: -log = redirect display output to the file autoupdate.log :: -log = redirect display output to the file autoupdate.log
@ -150,9 +150,9 @@ reg query "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters" /f "rd
call :install call :install
) )
) )
:: ------------------------------------- :: -----------------------------------
:: 4) check if rdpwrap.dll file exists :: 4) check if rdpwrap.dll file exists
:: ------------------------------------- :: -----------------------------------
if exist %rdpwrap_dll% ( if exist %rdpwrap_dll% (
echo [+] Found file: %rdpwrap_dll% echo [+] Found file: %rdpwrap_dll%
) else ( ) else (
@ -172,9 +172,9 @@ if exist %rdpwrap_ini% (
call :install call :install
) )
) )
:: --------------------------------------------------------------- :: ----------------------------------------------------
:: 6) get file version of %windir%\System32\termsrv.dll :: 6) get file version of %windir%\System32\termsrv.dll
:: --------------------------------------------------------------- :: ----------------------------------------------------
for /f "tokens=* usebackq" %%a in ( for /f "tokens=* usebackq" %%a in (
`cscript //nologo "%~f0?.wsf" //job:fileVersion "%windir%\System32\termsrv.dll"` `cscript //nologo "%~f0?.wsf" //job:fileVersion "%windir%\System32\termsrv.dll"`
) do ( ) do (
@ -237,8 +237,8 @@ goto :finish
echo. echo.
echo [*] Uninstall and reinstall RDP Wrapper... echo [*] Uninstall and reinstall RDP Wrapper...
echo. echo.
if exist %rdpwrap_dll% set rdpwrap_force_uninstall="1" if exist %rdpwrap_dll% set rdpwrap_force_uninstall=1
if exist %rdpwrap_ini% set rdpwrap_force_uninstall="1" if exist %rdpwrap_ini% set rdpwrap_force_uninstall=1
if "%rdpwrap_force_uninstall%"=="1" ( if "%rdpwrap_force_uninstall%"=="1" (
echo [*] Set windows registry entry for "rdpwrap.dll" to force uninstall... echo [*] Set windows registry entry for "rdpwrap.dll" to force uninstall...
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters" /f /v ServiceDll /t REG_EXPAND_SZ /d %rdpwrap_dll% reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters" /f /v ServiceDll /t REG_EXPAND_SZ /d %rdpwrap_dll%