1

I have a severe hate for Microsoft Edge WebView2. No other program has forced installation like this.

Occasionally, I install it manually via a downloaded package.

https://developer.microsoft.com/en-us/microsoft-edge/webview2/

All the links online talk about uninstalling via the following, but I noticed it only works when Microsoft installs it without my consent.

cd "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\1*\Installer\"

setup.exe --uninstall --msedgewebview --system-level --verbose-logging --force-uninstall

When I install via the Packaged version, I have to uninstall via "Remove Apps/Programs" under settings UI.

How can I uninstall via CLI?

Note: This is similar to How to uninstall Microsoft Edge WebView2 but I'm specifically talking about the version installed offline and uninstalling via CLI.

Update:

MicrosoftEdgeWebView2RuntimeInstallerX64.exe /silent /uninstall

Has Error: enter image description here

Further Update:

  • This issue is compounded by the fact that when I install offline, MS will still update/install via setup.exe found in the normal "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\1*\Installer\" location. If the installation is upgraded, I think I need to use the setup.exe.

I'm basically looking for a script that will do both, try and look/use setup.exe and look for offline installer. Ironically, it seems that the setup.exe is deleted after I uninstall.

I need to be able to basically install and uninstall at will because I'm getting CORs issues and different results based on install status. The trouble is I can't control installation/updates.

FreeSoftwareServers
  • 1,317
  • 5
  • 23
  • 46
  • I saw this, which might work, but required downloading a another tool library I think and had tons of extra features, but perhaps can be trimmed down? https://silentinstallhq.com/microsoft-edge-webview2-runtime-install-and-uninstall-powershell/ – FreeSoftwareServers May 23 '23 at 18:03
  • Try that ( from "Downloads" folder ): MicrosoftEdgeWebView2RuntimeInstallerX64.exe /silent /uninstall – Netan May 23 '23 at 20:07
  • @Netan I updated w/ error I get. – FreeSoftwareServers May 23 '23 at 20:40
  • 1
    Does flyby downvoter care to explain what needs more explanation? – FreeSoftwareServers May 23 '23 at 22:08
  • Not me man. What other way is there to install, aside the exe file? You can probably run Powershell command to install it from the store, if it exists there. Edit: Oh I see you've added a comment. Do you mean it was resolved? – Netan May 25 '23 at 12:44
  • 1
    @Netan Its installed by Microsoft automatically and can be installed via offline exe installer. Yeah I figured it out! Thanks! – FreeSoftwareServers May 25 '23 at 15:00

1 Answers1

2

When installing manually, it installs to %LocalAppData%.

I had to also remove the --system-level flag. Note: If I didn't remove this flag, I got no error, but it also didn't work.

Here is my batch script as it stands:

@ECHO OFF
cls

::MS Persistent Installation
cd "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\1*\Installer\"
setup.exe --uninstall --msedgewebview --system-level --verbose-logging --force-uninstall

::Manual/Offline Insallation ::NOTE: No "--system-level"
cd "%LocalAppData%\Microsoft\EdgeWebView\Application\1*\Installer"
setup.exe --uninstall --msedgewebview --verbose-logging --force-uninstall

pause
FreeSoftwareServers
  • 1,317
  • 5
  • 23
  • 46