update batch setup and merge installer&uninstaller
This commit is contained in:
@@ -1,153 +0,0 @@
|
|||||||
@echo off
|
|
||||||
title wufuc installer
|
|
||||||
:: Copyright (C) 2017 zeffy
|
|
||||||
|
|
||||||
:: This program is free software: you can redistribute it and/or modify
|
|
||||||
:: it under the terms of the GNU General Public License as published by
|
|
||||||
:: the Free Software Foundation, either version 3 of the License, or
|
|
||||||
:: (at your option) any later version.
|
|
||||||
|
|
||||||
:: This program is distributed in the hope that it will be useful,
|
|
||||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
:: GNU General Public License for more details.
|
|
||||||
|
|
||||||
:: You should have received a copy of the GNU General Public License
|
|
||||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
echo Copyright ^(C^) 2017 zeffy
|
|
||||||
echo This program comes with ABSOLUTELY NO WARRANTY.
|
|
||||||
echo This is free software, and you are welcome to redistribute it
|
|
||||||
echo under certain conditions; see COPYING.txt for details.
|
|
||||||
echo.
|
|
||||||
|
|
||||||
fltmc >nul 2>&1 || (
|
|
||||||
echo This batch script requires administrator privileges. Right-click on
|
|
||||||
echo %~nx0 and select "Run as administrator".
|
|
||||||
goto :die
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Checking system requirements...
|
|
||||||
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
) else (
|
|
||||||
if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
)
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|
||||||
goto :is_x86
|
|
||||||
)
|
|
||||||
)
|
|
||||||
goto :unsupported_os
|
|
||||||
|
|
||||||
:is_x86
|
|
||||||
set "WINDOWS_ARCHITECTURE=x86"
|
|
||||||
set "wufuc_dll=wufuc32.dll"
|
|
||||||
goto :dll_exists
|
|
||||||
|
|
||||||
:is_x64
|
|
||||||
set "WINDOWS_ARCHITECTURE=x64"
|
|
||||||
set "wufuc_dll=wufuc64.dll"
|
|
||||||
|
|
||||||
:dll_exists
|
|
||||||
set "wufuc_dll_fullpath=%~dp0%wufuc_dll%"
|
|
||||||
if exist "%wufuc_dll_fullpath%" (
|
|
||||||
goto :get_ver
|
|
||||||
)
|
|
||||||
echo ERROR - Could not find %wufuc_dll_fullpath%!
|
|
||||||
echo.
|
|
||||||
echo This most likely means you tried to clone the repository.
|
|
||||||
echo Please download wufuc from here: https://github.com/zeffy/wufuc/releases
|
|
||||||
echo.
|
|
||||||
echo If you are using an unstable AppVeyor build, it could also mean you
|
|
||||||
echo downloaded the wrong build of wufuc for your operating system. If this
|
|
||||||
echo is the case, you need to download the %WINDOWS_ARCHITECTURE% build instead.
|
|
||||||
echo.
|
|
||||||
echo AVG ^(and possibly other AV^) users:
|
|
||||||
echo This error could also mean that your anti-virus deleted or quarantined wufuc
|
|
||||||
echo in which case, you will need to make an exception and restore it.
|
|
||||||
goto :die
|
|
||||||
|
|
||||||
:get_ver
|
|
||||||
call :get_filever "%wufuc_dll_fullpath%"
|
|
||||||
title wufuc installer - v%Version%
|
|
||||||
|
|
||||||
:check_winver
|
|
||||||
ver | findstr " 6\.1\." >nul && (
|
|
||||||
echo Detected supported operating system: Windows 7 %WINDOWS_ARCHITECTURE%
|
|
||||||
goto :check_unattended
|
|
||||||
)
|
|
||||||
ver | findstr " 6\.3\." >nul && (
|
|
||||||
echo Detected supported operating system: Windows 8.1 %WINDOWS_ARCHITECTURE%
|
|
||||||
goto :check_unattended
|
|
||||||
)
|
|
||||||
|
|
||||||
:unsupported_os
|
|
||||||
echo WARNING - Detected that you are using an unsupported operating system.
|
|
||||||
echo.
|
|
||||||
echo The ver command says that you are using:
|
|
||||||
ver
|
|
||||||
echo.
|
|
||||||
echo This patch only works on the following versions of Windows:
|
|
||||||
echo.
|
|
||||||
echo - Windows 7 ^(x64 / x86^) [6.1.xxxx]
|
|
||||||
echo - Windows Server 2008 R2 [6.1.xxxx]
|
|
||||||
echo - Windows 8.1 ^(x64 / x86^) [6.3.xxxx]
|
|
||||||
echo - Windows Server 2012 R2 [6.3.xxxx]
|
|
||||||
echo.
|
|
||||||
echo If you're absolutely certain that you are using a supported operating system,
|
|
||||||
echo and that this warning is a mistake, you may continue with the patching process
|
|
||||||
echo at your own peril.
|
|
||||||
goto :confirmation
|
|
||||||
|
|
||||||
:check_unattended
|
|
||||||
if [%1]==[] goto :confirmation
|
|
||||||
if /I "%1"=="/UNATTENDED" goto :uninstall
|
|
||||||
shift
|
|
||||||
goto :check_unattended
|
|
||||||
|
|
||||||
:confirmation
|
|
||||||
echo.
|
|
||||||
echo wufuc disables the "Unsupported Hardware" message in Windows Update,
|
|
||||||
echo and allows you to continue installing updates on Windows 7 and 8.1
|
|
||||||
echo systems with Intel Kaby Lake, AMD Ryzen, or other unsupported processors.
|
|
||||||
echo.
|
|
||||||
echo Please be absolutely sure you really need wufuc before proceeding.
|
|
||||||
echo.
|
|
||||||
set /p CONTINUE=Enter 'Y' if you want to install wufuc:
|
|
||||||
if /I not "%CONTINUE%"=="Y" goto :cancel
|
|
||||||
|
|
||||||
:install
|
|
||||||
sfc /SCANFILE="%systemroot%\System32\wuaueng.dll"
|
|
||||||
|
|
||||||
set "regkey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\svchost.exe"
|
|
||||||
copy /Y "%wufuc_dll_fullpath%" "%systemroot%\System32\"
|
|
||||||
reg add "%regkey%" /v GlobalFlag /t REG_DWORD /d 0x00000100 /f
|
|
||||||
reg add "%regkey%" /v VerifierDlls /t REG_SZ /d "%wufuc_dll%" /f
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo wufuc has been successfully installed!
|
|
||||||
echo.
|
|
||||||
echo You must restart your computer to activate wufuc.
|
|
||||||
echo.
|
|
||||||
set /p RESTART_NOW=Enter 'Y' if you would like to restart now:
|
|
||||||
if /I not "%RESTART_NOW%"=="Y" goto :die
|
|
||||||
shutdown /r /t 5
|
|
||||||
|
|
||||||
:die
|
|
||||||
echo.
|
|
||||||
echo Press any key to exit...
|
|
||||||
pause >nul
|
|
||||||
exit
|
|
||||||
|
|
||||||
:cancel
|
|
||||||
echo.
|
|
||||||
echo Canceled by user, press any key to exit...
|
|
||||||
pause >nul
|
|
||||||
exit
|
|
||||||
|
|
||||||
:get_filever file
|
|
||||||
set "file=%~1"
|
|
||||||
for /f "tokens=*" %%i in ('wmic /output:stdout datafile where "name='%file:\=\\%'" get Version /value ^| find "="') do set "%%i"
|
|
||||||
exit /b
|
|
249
setup-batch/setup_wufuc.bat
Normal file
249
setup-batch/setup_wufuc.bat
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
@echo off
|
||||||
|
title wufuc installer
|
||||||
|
:: Copyright (C) 2017 zeffy
|
||||||
|
|
||||||
|
:: This program is free software: you can redistribute it and/or modify
|
||||||
|
:: it under the terms of the GNU General Public License as published by
|
||||||
|
:: the Free Software Foundation, either version 3 of the License, or
|
||||||
|
:: (at your option) any later version.
|
||||||
|
|
||||||
|
:: This program is distributed in the hope that it will be useful,
|
||||||
|
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
:: GNU General Public License for more details.
|
||||||
|
|
||||||
|
:: You should have received a copy of the GNU General Public License
|
||||||
|
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
echo Copyright ^(C^) 2017 zeffy
|
||||||
|
echo This program comes with ABSOLUTELY NO WARRANTY.
|
||||||
|
echo This is free software, and you are welcome to redistribute it
|
||||||
|
echo under certain conditions; see COPYING.txt for details.
|
||||||
|
echo.
|
||||||
|
|
||||||
|
fltmc >nul 2>&1 || (
|
||||||
|
echo This batch script requires administrator privileges. Right-click on
|
||||||
|
echo %~nx0 and select "Run as administrator".
|
||||||
|
goto :die
|
||||||
|
)
|
||||||
|
call :set_uninstall 0
|
||||||
|
call :set_unattended 0
|
||||||
|
call :set_norestart 0
|
||||||
|
|
||||||
|
:loop_args
|
||||||
|
if [%1]==[] goto :check_requirements
|
||||||
|
if /I "%1"=="/UNATTENDED" call :set_unattended 1
|
||||||
|
if /I "%1"=="/UNINSTALL" call :set_uninstall 1
|
||||||
|
if /I "%1"=="/NORESTART" call :set_norestart 1
|
||||||
|
shift
|
||||||
|
goto :loop_args
|
||||||
|
|
||||||
|
:check_requirements
|
||||||
|
echo Checking system requirements...
|
||||||
|
|
||||||
|
set "systemfolder=%systemroot%\System32"
|
||||||
|
|
||||||
|
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
||||||
|
goto :is_x64
|
||||||
|
) else (
|
||||||
|
if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
|
||||||
|
goto :is_wow64
|
||||||
|
)
|
||||||
|
if /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
||||||
|
goto :is_x86
|
||||||
|
)
|
||||||
|
)
|
||||||
|
goto :unsupported
|
||||||
|
|
||||||
|
:is_x86
|
||||||
|
set "WINDOWS_ARCHITECTURE=x86"
|
||||||
|
set "wufuc_dll=wufuc32.dll"
|
||||||
|
goto :dll_exists
|
||||||
|
|
||||||
|
:is_wow64
|
||||||
|
set "systemfolder=%systemroot%\Sysnative"
|
||||||
|
|
||||||
|
:is_x64
|
||||||
|
set "WINDOWS_ARCHITECTURE=x64"
|
||||||
|
set "wufuc_dll=wufuc64.dll"
|
||||||
|
|
||||||
|
:dll_exists
|
||||||
|
set "wufuc_dll_fullpath=%~dp0%wufuc_dll%"
|
||||||
|
if exist "%wufuc_dll_fullpath%" (
|
||||||
|
goto :get_ver
|
||||||
|
)
|
||||||
|
echo ERROR - Could not find %wufuc_dll_fullpath%!
|
||||||
|
echo.
|
||||||
|
echo This most likely means you tried to clone the repository.
|
||||||
|
echo Please download wufuc from here: https://github.com/zeffy/wufuc/releases/latest
|
||||||
|
echo.
|
||||||
|
echo If you are using an unstable AppVeyor build, it could also mean you
|
||||||
|
echo downloaded the wrong build of wufuc for your operating system. If this
|
||||||
|
echo is the case, you need to download the %WINDOWS_ARCHITECTURE% build instead.
|
||||||
|
echo.
|
||||||
|
echo AVG ^(and possibly other anti-virus^) users:
|
||||||
|
echo This error could also mean that your anti-virus deleted or quarantined %wufuc_dll%
|
||||||
|
echo in which case, you will need to make an exception and restore it.
|
||||||
|
goto :die
|
||||||
|
|
||||||
|
:get_ver
|
||||||
|
call :get_filever "%wufuc_dll_fullpath%"
|
||||||
|
if "%UNINSTALL%"=="1" (
|
||||||
|
title wufuc uninstaller - v%Version%
|
||||||
|
) else (
|
||||||
|
title wufuc installer - v%Version%
|
||||||
|
)
|
||||||
|
|
||||||
|
ver | findstr " 6\.1\." >nul && (
|
||||||
|
echo Detected supported operating system: Windows 7 %WINDOWS_ARCHITECTURE%
|
||||||
|
goto :check_mode
|
||||||
|
)
|
||||||
|
ver | findstr " 6\.3\." >nul && (
|
||||||
|
echo Detected supported operating system: Windows 8.1 %WINDOWS_ARCHITECTURE%
|
||||||
|
goto :check_mode
|
||||||
|
)
|
||||||
|
|
||||||
|
:unsupported
|
||||||
|
echo ERROR - Detected that you are using an unsupported operating system.
|
||||||
|
echo.
|
||||||
|
echo This patch only works on the following versions of Windows:
|
||||||
|
echo.
|
||||||
|
echo - Windows 7 ^(x64 / x86^) ^& Windows Server 2008 R2 [6.1.xxxx]
|
||||||
|
echo - Windows 8.1 ^(x64 / x86^) ^& Windows Server 2012 R2 [6.3.xxxx]
|
||||||
|
echo.
|
||||||
|
goto :die
|
||||||
|
|
||||||
|
:check_mode
|
||||||
|
set "regkey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\svchost.exe"
|
||||||
|
set "wufuc_dll_target=%systemfolder%\%wufuc_dll%"
|
||||||
|
|
||||||
|
if "%UNINSTALL%"=="1" goto :confirm_uninstall
|
||||||
|
if "%UNATTENDED%"=="1" goto :install
|
||||||
|
|
||||||
|
:pick_mode
|
||||||
|
echo.
|
||||||
|
echo Please enter one of the following numbers:
|
||||||
|
echo.
|
||||||
|
echo 1 - Install
|
||||||
|
echo 2 - Uninstall
|
||||||
|
echo.
|
||||||
|
set /p INSTALL_MODE=Would you like to install or uninstall wufuc?
|
||||||
|
|
||||||
|
if "%INSTALL_MODE%"=="1" (
|
||||||
|
goto :confirm_install
|
||||||
|
)
|
||||||
|
if "%INSTALL_MODE%"=="2" (
|
||||||
|
call :set_uninstall 1
|
||||||
|
goto :confirm_uninstall
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
echo Invalid choice, please enter 1 for install or 2 for uninstall.
|
||||||
|
goto :pick_mode
|
||||||
|
|
||||||
|
:: BEGIN INSTALL MODE
|
||||||
|
:confirm_install
|
||||||
|
if "%UNATTENDED%"=="1" goto :install
|
||||||
|
echo.
|
||||||
|
echo wufuc disables the "Unsupported Hardware" message in Windows Update,
|
||||||
|
echo and allows you to continue installing updates on Windows 7 and 8.1
|
||||||
|
echo systems with Intel Kaby Lake, AMD Ryzen, or other unsupported processors.
|
||||||
|
echo.
|
||||||
|
echo Please be absolutely sure you really need wufuc before proceeding.
|
||||||
|
echo.
|
||||||
|
set /p CONTINUE_INSTALL=Enter 'Y' if you want to install wufuc:
|
||||||
|
if /I "%CONTINUE_INSTALL%"=="Y" goto :install
|
||||||
|
goto :cancel
|
||||||
|
|
||||||
|
:install
|
||||||
|
call :uninstall
|
||||||
|
copy /Y "%wufuc_dll_fullpath%" "%wufuc_dll_target%" && (
|
||||||
|
reg add "%regkey%" /v GlobalFlag /t REG_DWORD /d 0x00000100 /f
|
||||||
|
reg add "%regkey%" /v VerifierDlls /t REG_SZ /d "%wufuc_dll%" /f
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
echo wufuc has been successfully installed!
|
||||||
|
echo You will need to restart your PC to finish installing wufuc.
|
||||||
|
goto :confirm_restart
|
||||||
|
:: END INSTALL MODE
|
||||||
|
|
||||||
|
:: BEGIN UNINSTALL MODE
|
||||||
|
:confirm_uninstall
|
||||||
|
if "%UNATTENDED%"=="1" goto :uninstall_stub
|
||||||
|
echo.
|
||||||
|
set /p CONTINUE_UNINSTALL=Enter 'Y' if you want to uninstall wufuc:
|
||||||
|
if /I "%CONTINUE_UNINSTALL%"=="Y" goto :uninstall_stub
|
||||||
|
goto :cancel
|
||||||
|
|
||||||
|
:uninstall_stub
|
||||||
|
call :uninstall
|
||||||
|
echo You will need to restart your PC to finish uninstalling wufuc.
|
||||||
|
goto :confirm_restart
|
||||||
|
|
||||||
|
:uninstall
|
||||||
|
call :remove_legacy
|
||||||
|
reg query "%regkey%" >nul 2>&1 || (
|
||||||
|
goto :delete_target
|
||||||
|
)
|
||||||
|
reg delete "%regkey%" /f || (
|
||||||
|
goto :skip_delete
|
||||||
|
)
|
||||||
|
:delete_target
|
||||||
|
set "del_ext=.del-%random%"
|
||||||
|
if exist "%wufuc_dll_target%" (
|
||||||
|
ren "%wufuc_dll_target%" "%wufuc_dll%%del_ext%" && (
|
||||||
|
rundll32 "%wufuc_dll_fullpath%",RUNDLL32_DeleteFile "%wufuc_dll_target%%del_ext%"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
:skip_delete
|
||||||
|
exit /b
|
||||||
|
:: END UNINSTALL MODE
|
||||||
|
|
||||||
|
:confirm_restart
|
||||||
|
if "%NORESTART%"=="1" goto :die
|
||||||
|
if "%UNATTENDED%"=="1" goto :restart
|
||||||
|
echo.
|
||||||
|
set /p CONTINUE_RESTART=Enter 'Y' if you would like to restart now:
|
||||||
|
if /I "%CONTINUE_RESTART%"=="Y" goto :restart
|
||||||
|
goto :die
|
||||||
|
|
||||||
|
:restart
|
||||||
|
shutdown /r /t 0
|
||||||
|
goto :die
|
||||||
|
|
||||||
|
:die
|
||||||
|
echo.
|
||||||
|
echo Press any key to exit...
|
||||||
|
pause >nul
|
||||||
|
exit
|
||||||
|
|
||||||
|
:cancel
|
||||||
|
echo.
|
||||||
|
echo Canceled by user, press any key to exit...
|
||||||
|
pause >nul
|
||||||
|
exit
|
||||||
|
|
||||||
|
:get_filever
|
||||||
|
set "file=%~1"
|
||||||
|
for /f "tokens=*" %%i in ('wmic /output:stdout datafile where "name='%file:\=\\%'" get Version /value ^| find "="') do set "%%i"
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:remove_legacy
|
||||||
|
sfc /SCANFILE="%systemroot%\System32\wuaueng.dll"
|
||||||
|
set "wufuc_task=wufuc.{72EEE38B-9997-42BD-85D3-2DD96DA17307}"
|
||||||
|
schtasks /Query /TN "%wufuc_task%" >nul 2>&1 && (
|
||||||
|
schtasks /Delete /TN "%wufuc_task%" /F
|
||||||
|
)
|
||||||
|
rundll32 "%wufuc_dll_fullpath%",RUNDLL32_LegacyUnload
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:set_unattended
|
||||||
|
set "UNATTENDED=%~1"
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:set_uninstall
|
||||||
|
set "UNINSTALL=%~1"
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:set_norestart
|
||||||
|
set "NORESTART=%~1"
|
||||||
|
exit /b
|
@@ -1,82 +0,0 @@
|
|||||||
@echo off
|
|
||||||
title wufuc uninstaller
|
|
||||||
:: Copyright (C) 2017 zeffy
|
|
||||||
|
|
||||||
:: This program is free software: you can redistribute it and/or modify
|
|
||||||
:: it under the terms of the GNU General Public License as published by
|
|
||||||
:: the Free Software Foundation, either version 3 of the License, or
|
|
||||||
:: (at your option) any later version.
|
|
||||||
|
|
||||||
:: This program is distributed in the hope that it will be useful,
|
|
||||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
:: GNU General Public License for more details.
|
|
||||||
|
|
||||||
:: You should have received a copy of the GNU General Public License
|
|
||||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
echo Copyright ^(C^) 2017 zeffy
|
|
||||||
echo This program comes with ABSOLUTELY NO WARRANTY.
|
|
||||||
echo This is free software, and you are welcome to redistribute it
|
|
||||||
echo under certain conditions; see COPYING.txt for details.
|
|
||||||
echo.
|
|
||||||
|
|
||||||
fltmc >nul 2>&1 || (
|
|
||||||
echo This batch script requires administrator privileges. Right-click on
|
|
||||||
echo %~nx0 and select "Run as administrator".
|
|
||||||
goto :die
|
|
||||||
)
|
|
||||||
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
) else (
|
|
||||||
if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
)
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|
||||||
goto :is_x86
|
|
||||||
)
|
|
||||||
)
|
|
||||||
goto :die
|
|
||||||
|
|
||||||
:is_x86
|
|
||||||
set "wufuc_dll=%~dp0wufuc32.dll"
|
|
||||||
goto :get_ver
|
|
||||||
|
|
||||||
:is_x64
|
|
||||||
set "wufuc_dll=%~dp0wufuc64.dll"
|
|
||||||
|
|
||||||
:get_ver
|
|
||||||
for /f "tokens=*" %%i in ('wmic /output:stdout datafile where "name='%wufuc_dll:\=\\%'" get Version /value ^| find "="') do set "%%i"
|
|
||||||
title wufuc uninstaller - v%Version%
|
|
||||||
|
|
||||||
:loop
|
|
||||||
if [%1]==[] goto :confirmation
|
|
||||||
if /I "%1"=="/UNATTENDED" goto :uninstall
|
|
||||||
shift
|
|
||||||
goto :loop
|
|
||||||
|
|
||||||
:confirmation
|
|
||||||
set /p CONTINUE=Enter 'Y' if you want to uninstall wufuc:
|
|
||||||
if /I not "%CONTINUE%"=="Y" goto :cancel
|
|
||||||
echo.
|
|
||||||
|
|
||||||
:uninstall
|
|
||||||
set "regkey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\svchost.exe"
|
|
||||||
reg del "%regkey%" /f
|
|
||||||
del /F "%systemroot%\System32\%wufuc_dll%"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Unloaded and uninstalled wufuc. :^(
|
|
||||||
|
|
||||||
:die
|
|
||||||
echo.
|
|
||||||
echo Press any key to exit...
|
|
||||||
pause >nul
|
|
||||||
exit
|
|
||||||
|
|
||||||
:cancel
|
|
||||||
echo.
|
|
||||||
echo Canceled by user, press any key to exit...
|
|
||||||
pause >nul
|
|
||||||
exit
|
|
@@ -1,61 +0,0 @@
|
|||||||
@echo off
|
|
||||||
title wufuc utility - disable task
|
|
||||||
:: Copyright (C) 2017 zeffy
|
|
||||||
|
|
||||||
:: This program is free software: you can redistribute it and/or modify
|
|
||||||
:: it under the terms of the GNU General Public License as published by
|
|
||||||
:: the Free Software Foundation, either version 3 of the License, or
|
|
||||||
:: (at your option) any later version.
|
|
||||||
|
|
||||||
:: This program is distributed in the hope that it will be useful,
|
|
||||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
:: GNU General Public License for more details.
|
|
||||||
|
|
||||||
:: You should have received a copy of the GNU General Public License
|
|
||||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
echo Copyright ^(C^) 2017 zeffy
|
|
||||||
echo This program comes with ABSOLUTELY NO WARRANTY.
|
|
||||||
echo This is free software, and you are welcome to redistribute it
|
|
||||||
echo under certain conditions; see COPYING.txt for details.
|
|
||||||
echo.
|
|
||||||
|
|
||||||
fltmc >nul 2>&1 || (
|
|
||||||
echo This batch script requires administrator privileges. Right-click on
|
|
||||||
echo %~nx0 and select "Run as administrator".
|
|
||||||
goto :die
|
|
||||||
)
|
|
||||||
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
) else (
|
|
||||||
if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
|
|
||||||
goto :is_x64
|
|
||||||
)
|
|
||||||
if /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|
||||||
goto :is_x86
|
|
||||||
)
|
|
||||||
)
|
|
||||||
goto :die
|
|
||||||
|
|
||||||
:is_x86
|
|
||||||
set "wufuc_dll=%~dp0..\wufuc32.dll"
|
|
||||||
goto :disable
|
|
||||||
|
|
||||||
:is_x64
|
|
||||||
set "wufuc_dll=%~dp0..\wufuc64.dll"
|
|
||||||
|
|
||||||
:disable
|
|
||||||
set "wufuc_task=wufuc.{72EEE38B-9997-42BD-85D3-2DD96DA17307}"
|
|
||||||
rundll32 "%wufuc_dll%",Rundll32Unload
|
|
||||||
net start Schedule
|
|
||||||
schtasks /Change /TN "%wufuc_task%" /DISABLE
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Disabled wufuc! You will still be able to check for updates until you restart.
|
|
||||||
|
|
||||||
:die
|
|
||||||
echo.
|
|
||||||
pause
|
|
||||||
exit
|
|
@@ -1,41 +0,0 @@
|
|||||||
@echo off
|
|
||||||
title wufuc utility - enable task
|
|
||||||
:: Copyright (C) 2017 zeffy
|
|
||||||
|
|
||||||
:: This program is free software: you can redistribute it and/or modify
|
|
||||||
:: it under the terms of the GNU General Public License as published by
|
|
||||||
:: the Free Software Foundation, either version 3 of the License, or
|
|
||||||
:: (at your option) any later version.
|
|
||||||
|
|
||||||
:: This program is distributed in the hope that it will be useful,
|
|
||||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
:: GNU General Public License for more details.
|
|
||||||
|
|
||||||
:: You should have received a copy of the GNU General Public License
|
|
||||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
echo Copyright ^(C^) 2017 zeffy
|
|
||||||
echo This program comes with ABSOLUTELY NO WARRANTY.
|
|
||||||
echo This is free software, and you are welcome to redistribute it
|
|
||||||
echo under certain conditions; see COPYING.txt for details.
|
|
||||||
echo.
|
|
||||||
|
|
||||||
fltmc >nul 2>&1 || (
|
|
||||||
echo This batch script requires administrator privileges. Right-click on
|
|
||||||
echo %~nx0 and select "Run as administrator".
|
|
||||||
goto :die
|
|
||||||
)
|
|
||||||
|
|
||||||
set "wufuc_task=wufuc.{72EEE38B-9997-42BD-85D3-2DD96DA17307}"
|
|
||||||
net start Schedule
|
|
||||||
schtasks /Change /TN "%wufuc_task%" /ENABLE
|
|
||||||
schtasks /Run /TN "%wufuc_task%"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Enabled and started wufuc!
|
|
||||||
|
|
||||||
:die
|
|
||||||
echo.
|
|
||||||
pause
|
|
||||||
exit
|
|
4
wufuc/exports.def
Normal file
4
wufuc/exports.def
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
LIBRARY
|
||||||
|
EXPORTS
|
||||||
|
RUNDLL32_LegacyUnloadW @1
|
||||||
|
RUNDLL32_DeleteFileW @2
|
26
wufuc/rundll32.c
Normal file
26
wufuc/rundll32.c
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#include <phnt_windows.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
|
||||||
|
void CALLBACK RUNDLL32_DeleteFileW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
|
||||||
|
{
|
||||||
|
int argc;
|
||||||
|
wchar_t **argv = CommandLineToArgvW(lpszCmdLine, &argc);
|
||||||
|
|
||||||
|
if ( argv ) {
|
||||||
|
if ( !DeleteFileW(argv[0])
|
||||||
|
&& GetLastError() == ERROR_ACCESS_DENIED )
|
||||||
|
MoveFileExW(argv[0], NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
|
||||||
|
|
||||||
|
LocalFree((HLOCAL)argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CALLBACK RUNDLL32_LegacyUnloadW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
|
||||||
|
{
|
||||||
|
HANDLE Event = OpenEventW(EVENT_MODIFY_STATE, FALSE, L"Global\\wufuc_UnloadEvent");
|
||||||
|
if ( Event ) {
|
||||||
|
SetEvent(Event);
|
||||||
|
CloseHandle(Event);
|
||||||
|
}
|
||||||
|
}
|
@@ -34,11 +34,13 @@
|
|||||||
<ClCompile Include="helpers.c" />
|
<ClCompile Include="helpers.c" />
|
||||||
<ClCompile Include="hooks.c" />
|
<ClCompile Include="hooks.c" />
|
||||||
<ClCompile Include="rtl_malloc.c" />
|
<ClCompile Include="rtl_malloc.c" />
|
||||||
|
<ClCompile Include="rundll32.c" />
|
||||||
<ClCompile Include="tracing.c" />
|
<ClCompile Include="tracing.c" />
|
||||||
<ClCompile Include="patchwua.c" />
|
<ClCompile Include="patchwua.c" />
|
||||||
<ClCompile Include="patternfind.c" />
|
<ClCompile Include="patternfind.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="exports.def" />
|
||||||
<None Include="wufuc.rch">
|
<None Include="wufuc.rch">
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
</None>
|
</None>
|
||||||
@@ -140,8 +142,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</ModuleDefinitionFile>
|
|
||||||
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
||||||
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>
|
||||||
@@ -164,8 +165,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</ModuleDefinitionFile>
|
|
||||||
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
||||||
<AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>
|
||||||
</AdditionalLibraryDirectories>
|
</AdditionalLibraryDirectories>
|
||||||
@@ -195,8 +195,7 @@
|
|||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
<ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</ModuleDefinitionFile>
|
|
||||||
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
||||||
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>
|
||||||
@@ -232,8 +231,7 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ntdll.lib;ntdllp.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>
|
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||||
</ModuleDefinitionFile>
|
|
||||||
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
<EntryPointSymbol>DllMain</EntryPointSymbol>
|
||||||
<AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>
|
||||||
</AdditionalLibraryDirectories>
|
</AdditionalLibraryDirectories>
|
||||||
|
@@ -65,6 +65,9 @@
|
|||||||
<ClCompile Include="rtl_malloc.c">
|
<ClCompile Include="rtl_malloc.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="rundll32.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="wufuc.rc">
|
<ResourceCompile Include="wufuc.rc">
|
||||||
@@ -75,5 +78,8 @@
|
|||||||
<None Include="wufuc.rch">
|
<None Include="wufuc.rch">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="exports.def">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user