Skip to content

Disable ads and product placement in new Outlook for Windows app

License

Notifications You must be signed in to change notification settings

valinet/NewOutlookPatcher

 
 

Repository files navigation

NewOutlookPatcher

Join on Discord

Disable ads and product placement in new Outlook for Windows app.

Tested on:

  • Windows 10 Version 21H2 (OS Build 19044.4046)
  • Windows 11 Version 23H2 (OS Build 22621.3296)

Donate

PayPal donations

Features

  • Disable ad as first item in e-mails list
  • Disable lower left corner OneDrive banner
  • Disable Word, Excel, PowerPoint, To Do, OneDrive, More apps icons
  • Enable F12 Developer Tools
Product image

How to?

  1. Download the latest release.
  2. Run NewOutlookPatcher. Outlook will also open automatically in the background.
  3. Customize the configuration by checking/unchecking individual items.
  4. Press Install. The application will elevate itself, close Outlook, apply your setttings and restart Outlook for you.

Why is elevation required?

The patcher requires administrative access in order to perform the following operations:
  • Installing the patcher (NewOutlookPatcher.dll) in C:\Windows\System32\ which is write-protected for regular users.
  • Configuring New Outlook for Windows to load the patcher when it starts up using the registry (in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\olk.exe).

Uninstalling

Run NewOutlookPatcher and press the Uninstall button. Done.

Known issues

How it works?

  • Everything is packed together in a tiny .NET 8-based executable. Required resources are extracted to a temporary folder at runtime.
  • New Outlook (olk.exe) is patched using a DLL that is injected in its process. The DLL is loaded using the AppVerifier infrastructure. The project contains a very clean C++ implementation of this technique. This works because the process is not protected, thus being able to load unsigned code.
  • The actual patching is done by hooking WebView2 methods, in order to execute scripts that alter the CSS once the main interface loads.

Solution structure

The Visual Studio solution is divided in 5 projects:

  • gui: Contains user interface and unpacker logic, C# .NET 8.
  • worker: Module that gets loaded by Outlook which injects custom JavaScript and CSS in the user interface.

Successful compilation is only possible for x64 at the moment. Files packed in the final executable are always grabbed from the Release folder, beware when building in Debug.