Edge Removal Fix

This commit is contained in:
Chris Titus 2024-08-06 15:50:36 -05:00
parent 04c84dce45
commit f38f534850
20 changed files with 67 additions and 67 deletions

View File

@ -14,7 +14,7 @@ jobs:
- name: Check if PR was merged
if: github.event.pull_request.merged == true
run: echo "PR was merged"
- name: Extract Discussion Number & Close If any Were Found
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -23,7 +23,7 @@ jobs:
run: |
pr_body="${{ github.event.pull_request.body }}"
discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+')
if [ -z "$discussion_ids" ]; then
echo "No discussion IDs found."
exit 0
@ -34,7 +34,7 @@ jobs:
response=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
-d '{"state": "closed"}' \
"https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id")
if [ "$response" -ne 200 ]; then
echo "Failed to close discussion #$discussion_id. HTTP status code: $response"
exit 1

View File

@ -45,4 +45,4 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Compile Winutil
if: success()
if: success()

View File

@ -114,4 +114,4 @@ jobs:
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/changelog.md
git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push)
git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push)

View File

@ -2,7 +2,7 @@ name: GitHub Pages Deploy
on:
release:
types: [published, prereleased]
workflow_dispatch:
workflow_dispatch:
permissions:
contents: write
jobs:

View File

@ -53,4 +53,4 @@ jobs:
prerelease: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -2549,7 +2549,7 @@
"UndoScript": [
"
Write-Host \"Install Microsoft Edge\"
Start-Process -FilePath winget -ArgumentList \"install -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait
Start-Process -FilePath winget -ArgumentList \"install --force -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait
"
]
},

View File

@ -8,7 +8,7 @@
```ps1
irm christitus.com/windev | iex
```
   
!!! bug "Keep in mind"
This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production!

View File

@ -23,7 +23,7 @@ function Uninstall-Process {
# Set Nation to 84 (France) temporarily
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
# credits to he3als for the Acl commands
$fileName = "IntegratedServicesRegionPolicySet.json"
$pathISRPS = [Environment]::SystemDirectory + "\" + $fileName
@ -33,19 +33,19 @@ function Uninstall-Process {
if (Test-Path -Path $pathISRPS) {
try {
$admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value
$aclISRPS.SetOwner($admin)
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow')
$aclISRPS.AddAccessRule($rule)
Set-Acl -Path $pathISRPS -AclObject $aclISRPS
Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force
}
catch {
Write-Error "[$Mode] Failed to set owner for $pathISRPS"
}
}
}
$baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
$registryPath = $baseKey + '\ClientState\' + $Key
@ -84,16 +84,16 @@ function Uninstall-Process {
if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) {
Write-Host "[$Mode] Edge Stable has been successfully uninstalled"
}
}
}
function Uninstall-Edge {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null
Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
@( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
"$env:PUBLIC\Desktop",
"$env:USERPROFILE\Desktop" ) | ForEach-Object {
@ -108,7 +108,7 @@ function Uninstall-Edge {
function Uninstall-WebView {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
# Force to use system-wide WebView2
# Force to use system-wide WebView2
# [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView")
Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
@ -135,4 +135,4 @@ function Uninstall-EdgeUpdate {
Uninstall-Edge
# "WebView" { Uninstall-WebView }
# "EdgeUpdate" { Uninstall-EdgeUpdate }
# "EdgeUpdate" { Uninstall-EdgeUpdate }

View File

@ -4,7 +4,7 @@ Function Invoke-WinUtilDetailedBSoD {
.SYNOPSIS
Enables/Disables Detailed BSoD
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
#>
Param($Enabled)

View File

@ -16,7 +16,7 @@ Function Invoke-WinUtilWingetProgram {
param(
[Parameter(Mandatory, Position=0)]$Programs,
[Parameter(Mandatory, Position=1)]
[ValidateSet("Install", "Uninstall")]
[String]$Action
@ -35,7 +35,7 @@ Function Invoke-WinUtilWingetProgram {
.PARAMETER credential
The PSCredential Object of the user that should be used to run winget
.NOTES
Invoke Winget uses the public variable $Action defined outside the function to determine if a Program should be installed or removed
#>
@ -47,7 +47,7 @@ Function Invoke-WinUtilWingetProgram {
$commonArguments = "--id $wingetId --silent"
$arguments = if ($Action -eq "Install") {
"install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})"
"install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})"
} else {
"uninstall $commonArguments"
}
@ -63,15 +63,15 @@ Function Invoke-WinUtilWingetProgram {
if ($credential) {
$processParams.credential = $credential
}
return (Start-Process @processParams).ExitCode
return (Start-Process @processParams).ExitCode
}
Function Invoke-Install {
<#
.SYNOPSIS
Contains the Install Logic and return code handling from winget
.PARAMETER Program
The Winget ID of the Program that should be installed
#>
@ -117,14 +117,14 @@ Function Invoke-WinUtilWingetProgram {
<#
.SYNOPSIS
Contains the Uninstall Logic and return code handling from winget
.PARAMETER Program
The Winget ID of the Program that should be uninstalled
#>
param (
[psobject]$Program
)
try {
$status = Invoke-Winget -wingetId $Program
if ($status -eq 0) {
@ -142,21 +142,21 @@ Function Invoke-WinUtilWingetProgram {
$count = $Programs.Count
$failedPackages = @()
Write-Host "==========================================="
Write-Host "-- Configuring winget packages ---"
Write-Host "==========================================="
for ($i = 0; $i -lt $count; $i++) {
$Program = $Programs[$i]
$result = $false
Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($i / $count * 100)
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i / $count)})
$result = switch ($Action) {
"Install" {Invoke-Install -Program $Program}
"Uninstall" {Invoke-Uninstall -Program $Program}
default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"}
default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"}
}
if (-not $result) {

View File

@ -1,12 +1,12 @@
function Set-WinUtilProgressbar{
<#
.SYNOPSIS
This function is used to Update the Progress Bar displayed in the winutil GUI.
It will be automatically hidden if the user clicks something and no process is running
This function is used to Update the Progress Bar displayed in the winutil GUI.
It will be automatically hidden if the user clicks something and no process is running
.PARAMETER Label
The Text to be overlayed onto the Progress Bar
.PARAMETER PERCENT
The percentage of the Progress Bar that should be filled (0-100)
The percentage of the Progress Bar that should be filled (0-100)
.PARAMETER Hide
If provided, the Progress Bar and the label will be hidden
#>
@ -17,14 +17,14 @@ function Set-WinUtilProgressbar{
$Hide
)
if ($hide) {
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"})
} else {
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"})
}
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label})
$sync.form.Dispatcher.Invoke([action]{ $sync.ProgressBar.Value = $percent})
}

View File

@ -221,7 +221,7 @@ $cttLogoPath = @"
$hyperlink.Inlines.Add($match.Groups[2].Value)
$hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline
$hyperlink.Foreground = $sync.configs.themes.$ctttheme.LinkForegroundColor
$hyperlink.Add_Click({
param($sender, $args)
Start-Process $sender.NavigateUri.AbsoluteUri

View File

@ -32,7 +32,7 @@ function Uninstall-Process {
# Set Nation to 84 (France) temporarily
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
# credits to he3als for the Acl commands
$fileName = "IntegratedServicesRegionPolicySet.json"
$pathISRPS = [Environment]::SystemDirectory + "\" + $fileName
@ -42,19 +42,19 @@ function Uninstall-Process {
if (Test-Path -Path $pathISRPS) {
try {
$admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value
$aclISRPS.SetOwner($admin)
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow')
$aclISRPS.AddAccessRule($rule)
Set-Acl -Path $pathISRPS -AclObject $aclISRPS
Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force
}
catch {
Write-Error "[$Mode] Failed to set owner for $pathISRPS"
}
}
}
$baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
$registryPath = $baseKey + '\ClientState\' + $Key
@ -93,16 +93,16 @@ function Uninstall-Process {
if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) {
Write-Host "[$Mode] Edge Stable has been successfully uninstalled"
}
}
}
function Uninstall-Edge {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null
Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
@( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs",
"$env:PUBLIC\Desktop",
"$env:USERPROFILE\Desktop" ) | ForEach-Object {
@ -117,7 +117,7 @@ function Uninstall-Edge {
function Uninstall-WebView {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
# Force to use system-wide WebView2
# Force to use system-wide WebView2
# [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView")
Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
@ -149,4 +149,4 @@ Uninstall-Edge
}
}

View File

@ -17,9 +17,9 @@ function Invoke-WPFButton {
if (-not $sync.ProcessRunning) {
Set-WinUtilProgressBar -label "" -percent 0 -hide $true
}
Switch -Wildcard ($Button) {
"WPFTab?BT" {Invoke-WPFTab $Button}
"WPFinstall" {Invoke-WPFInstall}
"WPFuninstall" {Invoke-WPFUnInstall}

View File

@ -48,7 +48,7 @@ function Invoke-WPFInstall {
$errorPackages = @()
if($packagesWinget.Count -gt 0) {
Install-WinUtilWinget
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
$errorPackages| ForEach-Object {if($_.choco -ne "na") {$packagesChoco += $_}}
}
if($packagesChoco.Count -gt 0) {

View File

@ -416,11 +416,11 @@ public class PowerManagement {
}
Write-Host "[INFO] Using oscdimg.exe from: $oscdimgPath"
$oscdimgProc = Start-Process -FilePath "$oscdimgPath" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin `"$mountDir`" `"$($SaveDialog.FileName)`"" -Wait -PassThru -NoNewWindow
$LASTEXITCODE = $oscdimgProc.ExitCode
Write-Host "OSCDIMG Error Level : $($oscdimgProc.ExitCode)"
if ($copyToUSB) {

View File

@ -36,7 +36,7 @@ function Invoke-WPFtweaksbutton {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
}
# Execute other selected tweaks
for ($i = 0; $i -lt $Tweaks.Count; $i++) {
Set-WinUtilProgressBar -Label "Applying $($tweaks[$i])" -Percent ($i / $Tweaks.Count * 100)
Invoke-WinUtilTweaks $tweaks[$i]$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$Tweaks.Count) })

View File

@ -29,7 +29,7 @@ function Invoke-WPFundoall {
} else {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
}
for ($i = 0; $i -lt $tweaks.Count; $i++) {
Set-WinUtilProgressBar -Label "Undoing $($tweaks[$i])" -Percent ($i / $tweaks.Count * 100)
@ -39,7 +39,7 @@ function Invoke-WPFundoall {
Set-WinUtilProgressBar -Label "Undo Tweaks Finished" -Percent 100
$sync.ProcessRunning = $false
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
Write-Host "=================================="
Write-Host "--- Undo Tweaks are Finished ---"
Write-Host "=================================="

View File

@ -34,7 +34,7 @@ theme:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
scheme: default
toggle:

View File

@ -683,7 +683,7 @@
Maximum="100"
Width="250"
Height="{SearchBarHeight}"
Foreground="{ProgressBarForegroundColor}" Background="{ProgressBarBackgroundColor}" BorderBrush="{ProgressBarForegroundColor}"
Foreground="{ProgressBarForegroundColor}" Background="{ProgressBarBackgroundColor}" BorderBrush="{ProgressBarForegroundColor}"
Visibility="Collapsed"
VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="2,0,0,0" BorderThickness="1" Padding="6,2,2,2"
@ -699,13 +699,13 @@
Visibility="Collapsed"
Margin="2,0,0,0" BorderThickness="0" Padding="6,2,2,2"
Name="ProgressBarLabel">
<TextBlock
TextTrimming="CharacterEllipsis"
<TextBlock
TextTrimming="CharacterEllipsis"
Background="Transparent"
Foreground="{ProgressBarTextColor}">
</TextBlock>
</Label>
<Button Name="SettingsButton"
Style="{StaticResource HoverButtonStyle}"
Grid.Column="2" BorderBrush="Transparent"