我非常讨厌Microsoft Edge WebView2
。没有其他程序有这样的强制安装。
有时,我会通过下载的包手动安装它。
https://developer.microsoft.com/en-us/microsoft-edge/webview2/
所有网上的链接都谈到了通过以下方式卸载,但我注意到只有当微软在未经我同意的情况下安装它时它才有效。
cd "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\1*\Installer\"
setup.exe --uninstall --msedgewebview --system-level --verbose-logging --force-uninstall
当我通过打包版本安装时,我必须通过设置 UI 下的“删除应用程序/程序”进行卸载。
如何通过 CLI 卸载?
注意:这类似于如何卸载 Microsoft Edge WebView2但我具体谈论的是离线安装并通过 CLI 卸载的版本。
更新:
MicrosoftEdgeWebView2RuntimeInstallerX64.exe /silent /uninstall
进一步更新:
- 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 thesetup.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.
答案1
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