mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 06:50:09 +00:00
Remove-Edge (#3913)
* Update tweaks.json * Create Invoke-WinUtilRemoveEdge.ps1 * Update and rename EdgeUninstall.md to RemoveEdge.md * Update Invoke-WinUtilRemoveEdge.ps1 * Update RemoveEdge.md * Update Invoke-WinUtilRemoveEdge.ps1 * Update RemoveEdge.md * Update Invoke-WinUtilRemoveEdge.ps1 * Update RemoveEdge.md * Update Invoke-WinUtilRemoveEdge.ps1 * Update RemoveEdge.md * Update Invoke-WinUtilRemoveEdge.ps1 * Update Invoke-WinUtilRemoveEdge.ps1 * Update RemoveEdge.md
This commit is contained in:
@@ -1591,67 +1591,19 @@
|
|||||||
],
|
],
|
||||||
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/tele"
|
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/tele"
|
||||||
},
|
},
|
||||||
"WPFTweaksDisableEdge": {
|
"WPFTweaksRemoveEdge": {
|
||||||
"Content": "Disable Edge",
|
"Content": "Remove Microsoft Edge",
|
||||||
"Description": "Prevent msedge.exe from running with explorer policies.",
|
"Description": "Unblocks Microsoft Edge uninstaller restrictions than uses that uninstaller to remove Microsoft Edge",
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a023_",
|
"Order": "a028_",
|
||||||
"registry": [
|
|
||||||
{
|
|
||||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowRun",
|
|
||||||
"Name": "DisableEdge",
|
|
||||||
"Type": "String",
|
|
||||||
"Value": "msedge.exe",
|
|
||||||
"OriginalValue": "<RemoveEntry>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
|
||||||
"Name": "DisallowRun",
|
|
||||||
"Type": "DWord",
|
|
||||||
"Value": "1",
|
|
||||||
"OriginalValue": "<RemoveEntry>"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"link": ""
|
|
||||||
},
|
|
||||||
"WPFTweaksMakeEdgeUninstallable": {
|
|
||||||
"Content": "Make Edge Uninstallable via settings",
|
|
||||||
"Description": "Makes it so you can uninstall edge via settings > installed apps",
|
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
|
||||||
"panel": "1",
|
|
||||||
"Order": "a026_",
|
|
||||||
"registry": [
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Microsoft Edge",
|
|
||||||
"Name": "NoRemove",
|
|
||||||
"Type": "Dword",
|
|
||||||
"Value": "0",
|
|
||||||
"OriginalValue": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"Invoke-WinUtilRemoveEdge"
|
||||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
|
||||||
|
|
||||||
takeown /f $File
|
|
||||||
icacls $File /grant \"Administrators:(F)\"
|
|
||||||
|
|
||||||
$FileContent = Get-Content $File
|
|
||||||
$FileContent[7] = $FileContent[7] -replace \"disabled\", \"enabled\"
|
|
||||||
Set-Content $File $FileContent
|
|
||||||
"
|
|
||||||
],
|
],
|
||||||
"UndoScript": [
|
"UndoScript": [
|
||||||
"
|
"
|
||||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
Write-Host 'Installing Microsoft Edge...'
|
||||||
|
winget install Microsoft.Edge --source winget
|
||||||
takeown /f $File
|
|
||||||
icacls $File /grant \"Administrators:(F)\"
|
|
||||||
|
|
||||||
$FileContent = Get-Content $File
|
|
||||||
$FileContent[7] = $FileContent[7] -replace \"enabled\", \"disabled\"
|
|
||||||
Set-Content $File $FileContent
|
|
||||||
"
|
"
|
||||||
],
|
],
|
||||||
"link": ""
|
"link": ""
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
# Remove Microsoft Edge
|
|
||||||
|
|
||||||
```json
|
|
||||||
"WPFTweaksMakeEdgeUninstallable": {
|
|
||||||
"Content": "Make Edge Uninstallable via settings",
|
|
||||||
"Description": "Makes it so you can uninstall edge via settings > installed apps",
|
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
|
||||||
"panel": "1",
|
|
||||||
"Order": "a026_",
|
|
||||||
"registry": [
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Microsoft Edge",
|
|
||||||
"Name": "NoRemove",
|
|
||||||
"Type": "Dword",
|
|
||||||
"Value": "0",
|
|
||||||
"OriginalValue": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"InvokeScript": [
|
|
||||||
"
|
|
||||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
|
||||||
|
|
||||||
takeown /f $File
|
|
||||||
icacls $File /grant \"Administrators:(F)\"
|
|
||||||
|
|
||||||
$FileContent = Get-Content $File
|
|
||||||
$FileContent[7] = $FileContent[7] -replace \"disabled\", \"enabled\"
|
|
||||||
Set-Content $File $FileContent
|
|
||||||
"
|
|
||||||
],
|
|
||||||
"UndoScript": [
|
|
||||||
"
|
|
||||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
|
||||||
|
|
||||||
takeown /f $File
|
|
||||||
icacls $File /grant \"Administrators:(F)\"
|
|
||||||
|
|
||||||
$FileContent = Get-Content $File
|
|
||||||
$FileContent[7] = $FileContent[7] -replace \"enabled\", \"disabled\"
|
|
||||||
Set-Content $File $FileContent
|
|
||||||
"
|
|
||||||
],
|
|
||||||
```
|
|
||||||
|
|
||||||
## Registry Changes
|
|
||||||
Applications and System Components store and retrieve configuration data to modify windows settings, so we can use the registry to change many settings in one place.
|
|
||||||
|
|
||||||
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Remove Microsoft Edge
|
||||||
|
|
||||||
|
# Json File
|
||||||
|
```json
|
||||||
|
"WPFTweaksRemoveEdge": {
|
||||||
|
"Content": "Remove Microsoft Edge",
|
||||||
|
"Description": "Unblocks Microsoft Edge uninstaller restrictions than uses that uninstaller to remove Microsoft Edge",
|
||||||
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
|
"panel": "1",
|
||||||
|
"Order": "a028_",
|
||||||
|
"InvokeScript": [
|
||||||
|
"Invoke-WinUtilRemoveEdge"
|
||||||
|
],
|
||||||
|
"UndoScript": [
|
||||||
|
"
|
||||||
|
Write-Host 'Installing Microsoft Edge...'
|
||||||
|
winget install Microsoft.Edge --source winget
|
||||||
|
"
|
||||||
|
],
|
||||||
|
```
|
||||||
|
# Function
|
||||||
|
```json
|
||||||
|
function Invoke-WinUtilRemoveEdge {
|
||||||
|
Write-Host "Unlocking The Offical Edge Uninstaller And Removing Microsoft Edge..."
|
||||||
|
|
||||||
|
$Path = (Get-ChildItem "C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe")[0].FullName
|
||||||
|
New-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe" -Force
|
||||||
|
Start-Process $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile'
|
||||||
|
}
|
||||||
|
```
|
||||||
7
functions/public/Invoke-WinUtilRemoveEdge.ps1
Normal file
7
functions/public/Invoke-WinUtilRemoveEdge.ps1
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
function Invoke-WinUtilRemoveEdge {
|
||||||
|
Write-Host "Unlocking The Offical Edge Uninstaller And Removing Microsoft Edge..."
|
||||||
|
|
||||||
|
$Path = (Get-ChildItem "C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe")[0].FullName
|
||||||
|
New-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe" -Force
|
||||||
|
Start-Process $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile'
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user