Effectively remove microsoft edge (Except user data)

- Folders from Program Files (x86) related to Edge will also be wiped
- This is NOT included on apply tweaks, it's isolated on GUI
- The reason this was done is because v105 instantly crashed after opened

Reminder for those who don't want this to happen:
- DON'T open Edge right after boot, wait til' 1 min or other stuff started completely
- *The daily upgrade scripts may affect MS Edge from reinstalling
main
Plínio Larrubia 2 years ago committed by Plínio Larrubia
parent f755a6e60b
commit 5a45deab18
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -2,7 +2,7 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-dialog-window.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Main() {
$Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime."
$Ask = "Are you sure you want to remove Microsoft Edge from Windows?`nYou can reinstall it anytime.`nNote: all users logged in will remain."
switch (Show-Question -Title "Warning" -Message $Ask -BoxIcon "Warning") {
'Yes' {
@ -18,9 +18,38 @@ function Main() {
}
function Remove-MSEdge() {
Start-Process -FilePath "$env:SystemDrive\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe" -ArgumentList "--uninstall", "--system-level", "--verbose-logging", "--force-uninstall" -Wait
Start-Process -FilePath "$env:SystemDrive\Program Files (x86)\Microsoft\EdgeCore\*\Installer\setup.exe" -ArgumentList "--uninstall", "--system-level", "--verbose-logging", "--force-uninstall" -Wait
Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.MicrosoftEdge*_*" -Confirm -Recurse | Out-Host
$PathToLMEdgeUpdate = "HKLM:\SOFTWARE\Microsoft\EdgeUpdate"
If ((Test-Path -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Edge\Application") -or (Test-Path -Path "$env:SystemDrive\Program Files (x86)\Microsoft\EdgeWebView\Application")) {
ForEach ($FullName in (Get-ChildItem -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Edge*\Application\*\Installer\setup.exe").FullName) {
Write-Status -Types "@" -Status "Uninstalling MS Edge from $FullName..."
Start-Process -FilePath $FullName -ArgumentList "--uninstall", "--msedgewebview", "--system-level", "--verbose-logging", "--force-uninstall" -Wait
}
} Else {
Write-Status -Types "?" -Status "Edge/EdgeWebView folder does not exist anymore..." -Warning
}
If (Test-Path -Path "$env:SystemDrive\Program Files (x86)\Microsoft\EdgeCore") {
ForEach ($FullName in (Get-ChildItem -Path "$env:SystemDrive\Program Files (x86)\Microsoft\EdgeCore\*\Installer\setup.exe").FullName) {
Write-Status -Types "@" -Status "Uninstalling MS Edge from $FullName..."
Start-Process -FilePath $FullName -ArgumentList "--uninstall", "--system-level", "--verbose-logging", "--force-uninstall" -Wait
}
} Else {
Write-Status -Types "?" -Status "EdgeCore folder does not exist anymore..." -Warning
}
Write-Status -Types "@" -Status "Preventing Edge from reinstalling..."
If (!(Test-Path "$PathToLMEdgeUpdate")) {
New-Item -Path "$PathToLMEdgeUpdate" -Force | Out-Null
}
Set-ItemProperty -Path "$PathToLMEdgeUpdate" -Name "DoNotUpdateToEdgeWithChromium" -Type DWord -Value 1
Write-Status -Types "@" -Status "Deleting Edge appdata\local folders from current user..."
Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.MicrosoftEdge*_*" -Recurse -Force | Out-Host
Write-Status -Types "@" -Status "Deleting Edge from Program Files (x86)..."
Remove-Item -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Edge*" -Recurse -Force | Out-Host
Remove-Item -Path "$env:SystemDrive\Program Files (x86)\Microsoft\Temp" -Recurse -Force | Out-Host
}
Main
Loading…
Cancel
Save