# WU ESU Patcher

* Circumvent Windows Update engine to detect ESU updates for Windows 7 Client or Windows Embedded 7

______________________________

## Available Options

* For Windows 7 x64:  
[1] Patch as Windows Embedded 7 category  
[2] Patch as Windows Server 2008 R2 category  
[3] Patch as Windows Server 2008 R2 category + Windows 7 category

* For Windows 7 x86:  
[1] Patch as Windows Embedded 7 category

* For Windows Embedded 7 x64/x86:  
[1] Install for Windows Embedded 7 category

______________________________

## Important Notes

* The following updates must be already installed:

> KB4490628: Servicing Stack Update

> KB4474419: SHA-2 code signing support update

> ESU Licensing Preparation Package:  
>> for Windows Embedded 7 category    : KB4575903  
>> for Windows Server 2008 R2 category: KB4575903 and KB5016892

> Updated wuaueng.dll, at least KB3138612 (7.6.7601.19161)

> Latest Extended Servicing Stack Update (KB5017397 or later)

* Make sure that "Windows Management Instrumentation (winmgmt)" service is not disabled

* Extract the 7z pack contents to a folder with simple path

* Temporarily turn off Antivirus protection (if any), or exclude the extracted folder

* If "WSUS Proxy" project is being used, remove it first via Remove_wsus.cmd

* This project is universal (but temporary) replacement for "WU ESU Patcher" from "BypassESU" project

"ESU Suppressor" and ".NET 4 ESU Bypass" are still required to successfully install ESU updates

* System Restart is required (or maybe recommended) after first patching

* Windows Server 2008 R2 category is recommended for Windows 7 x64

* Whenever you switch between category options for Windows 7 x64, or run option [1] for Windows x86,  
WU will need to rescan for changed metadata and detection rules, and repopulate its database

______________________________

### Option [3]

*[3] Patch as Windows Server 2008 R2 category + Windows 7 category*

* allow to receive applicable updates from both categories together  
however, ESU updates will be available only from Server 2008 R2 category

* caveats:  
non installed applicable updates will be shown twice  
updates metadata are duplicated too, which will increase the size of WU DataStore.edb

* pros:  
offer some other products and their updates (via Microsoft Update option), like MS Security Essentials

______________________________

## DataStore.edb size reduction

* Patching, switching categories, and repopulating WU metadata without reset,  
will increase the database size (can exceed 5 GB),  
because previous category(s) metadata is discarded, but not removed from the database file itself

* To reduce the file size without reset, you need to defragment it using esentutl.exe tool

* To do so, run **Defragment-DataStore.edb.cmd** script

* If you prefer manual steps:

temporary change Windows Update settings to "Never check for updates"

open Command Prompt as administrator, and execute the following commands:  
```
net stop wuauserv /y
cd /d %SystemRoot%\SoftwareDistribution\DataStore
esentutl /d DataStore.edb
```

change Windows Update settings back to your desired choice

______________________________

## Disclaimer

* This is a prototype project, it is not tested extensively for all scenarios

* The patch for Windows Embedded 7 category could affect other programs that query SPP Licensing WMI provider

______________________________

## Credits

* @whatever127 / original redirected dlls code  
* M2-Team / NSudoLC.exe  
