Added extra check for template file ext. when replacing start menu

Changed links in README.md and Get.ps1 to use latest tagged release
This commit is contained in:
Raphire
2025-05-19 20:30:11 +02:00
parent 88f841a44b
commit 44c28bed43
3 changed files with 21 additions and 13 deletions

15
Get.ps1
View File

@@ -73,13 +73,13 @@ Write-Output "------------------------------------------------------------------
Write-Output "> Downloading Win11Debloat..." Write-Output "> Downloading Win11Debloat..."
# Download latest version of Win11Debloat from github as zip archive # Download latest version of Win11Debloat from github as zip archive
Invoke-WebRequest http://github.com/raphire/win11debloat/archive/master.zip -OutFile "$env:TEMP/win11debloat-temp.zip" Invoke-WebRequest https://github.com/Raphire/Win11Debloat/zipball/master -OutFile "$env:TEMP/win11debloat-temp.zip"
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files # Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
if (Test-Path "$env:TEMP/Win11Debloat/Win11Debloat-master") { if (Test-Path "$env:TEMP/Win11Debloat") {
Write-Output "" Write-Output ""
Write-Output "> Cleaning up old Win11Debloat folder..." Write-Output "> Cleaning up old Win11Debloat folder..."
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force Get-ChildItem -Path "$env:TEMP/Win11Debloat" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
} }
Write-Output "" Write-Output ""
@@ -91,6 +91,9 @@ Expand-Archive "$env:TEMP/win11debloat-temp.zip" "$env:TEMP/Win11Debloat"
# Remove archive # Remove archive
Remove-Item "$env:TEMP/win11debloat-temp.zip" Remove-Item "$env:TEMP/win11debloat-temp.zip"
# Move files
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Raphire-Win11Debloat-*" -Recurse | Move-Item -Destination "$env:TEMP/Win11Debloat"
# Make list of arguments to pass on to the script # Make list of arguments to pass on to the script
$arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object { $arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object {
if ($_.Value -eq $true) { if ($_.Value -eq $true) {
@@ -105,7 +108,7 @@ Write-Output ""
Write-Output "> Running Win11Debloat..." Write-Output "> Running Win11Debloat..."
# Run Win11Debloat script with the provided arguments # Run Win11Debloat script with the provided arguments
$debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat-master\Win11Debloat.ps1 $arguments" -Verb RunAs $debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
# Wait for the process to finish before continuing # Wait for the process to finish before continuing
if ($null -ne $debloatProcess) { if ($null -ne $debloatProcess) {
@@ -113,12 +116,12 @@ if ($null -ne $debloatProcess) {
} }
# Remove all remaining script files, except for CustomAppsList and SavedSettings files # Remove all remaining script files, except for CustomAppsList and SavedSettings files
if (Test-Path "$env:TEMP/Win11Debloat/Win11Debloat-master") { if (Test-Path "$env:TEMP/Win11Debloat") {
Write-Output "" Write-Output ""
Write-Output "> Cleaning up..." Write-Output "> Cleaning up..."
# Cleanup, remove Win11Debloat directory # Cleanup, remove Win11Debloat directory
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Win11Debloat-master" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force Get-ChildItem -Path "$env:TEMP/Win11Debloat" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
} }
Write-Output "" Write-Output ""

View File

@@ -19,7 +19,7 @@
Win11Debloat is a simple, easy to use and lightweight PowerShell script that allows you to quickly declutter and improve your Windows experience. It can remove pre-installed bloatware apps, disable telemetry, remove intrusive interface elements and much more. No need to painstakingly go through all the settings yourself or remove apps one by one. Win11Debloat makes the process quick and easy! Win11Debloat is a simple, easy to use and lightweight PowerShell script that allows you to quickly declutter and improve your Windows experience. It can remove pre-installed bloatware apps, disable telemetry, remove intrusive interface elements and much more. No need to painstakingly go through all the settings yourself or remove apps one by one. Win11Debloat makes the process quick and easy!
The script also includes many features that system administrators will enjoy. Such as support for Windows Audit mode, the option to make changes to other Windows users and the ability to run the script without requiring user input during runtime. The script also includes many features that system administrators will enjoy. Such as support for Windows Audit mode, the option to make changes to other Windows users and the ability to run the script without requiring user input during runtime. Please refer to our [wiki](https://github.com/Raphire/Win11Debloat/wiki/) for more details.
![Win11Debloat Menu](/Assets/menu.png) ![Win11Debloat Menu](/Assets/menu.png)
@@ -53,7 +53,7 @@ This method supports parameters to customize the behaviour of the script. Please
<details> <details>
<summary>Manually download & run the script.</summary><br/> <summary>Manually download & run the script.</summary><br/>
1. [Download the latest version of the script](https://github.com/Raphire/Win11Debloat/archive/master.zip), and extract the .ZIP file to your desired location. 1. [Download the latest version of the script](https://github.com/Raphire/Win11Debloat/zipball/master), and extract the .ZIP file to your desired location.
2. Navigate to the Win11Debloat folder 2. Navigate to the Win11Debloat folder
3. Double click the `Run.bat` file to start the script. NOTE: If the console window immediately closes and nothing happens, try the advanced method below. 3. Double click the `Run.bat` file to start the script. NOTE: If the console window immediately closes and nothing happens, try the advanced method below.
4. Accept the Windows UAC prompt to run the script as administrator, this is required for the script to function. 4. Accept the Windows UAC prompt to run the script as administrator, this is required for the script to function.
@@ -65,7 +65,7 @@ This method supports parameters to customize the behaviour of the script. Please
<details> <details>
<summary>Manually download the script & run the script via PowerShell. Recommended for advanced users.</summary><br/> <summary>Manually download the script & run the script via PowerShell. Recommended for advanced users.</summary><br/>
1. [Download the latest version of the script](https://github.com/Raphire/Win11Debloat/archive/master.zip), and extract the .ZIP file to your desired location. 1. [Download the latest version of the script](https://github.com/Raphire/Win11Debloat/zipball/master), and extract the .ZIP file to your desired location.
2. Open PowerShell or Terminal as an administrator. 2. Open PowerShell or Terminal as an administrator.
3. Temporarily enable PowerShell execution by entering the following command: 3. Temporarily enable PowerShell execution by entering the following command:
@@ -139,8 +139,8 @@ Below is an overview of the key features and functionality offered by Win11Deblo
- Turn off Enhance Pointer Precision, also known as mouse acceleration. - Turn off Enhance Pointer Precision, also known as mouse acceleration.
- Disable Fast Start-up to ensure a full shutdown. - Disable Fast Start-up to ensure a full shutdown.
- Disable the Sticky Keys keyboard shortcut. (W11 only) - Disable the Sticky Keys keyboard shortcut. (W11 only)
- Option to apply changes to a different user, instead of the currently logged in user. - Option to [apply changes to a different user](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#running-as-another-user), instead of the currently logged in user.
- Sysprep mode to apply changes to the Windows Default user profile. Afterwards, all new users will have the changes automatically applied to them. - [Sysprep mode](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#sysprep-mode) to apply changes to the Windows Default user profile. Afterwards, all new users will have the changes automatically applied to them.
### Default Settings ### Default Settings

View File

@@ -645,13 +645,18 @@ function ReplaceStartMenu {
# Check if template bin file exists, return early if it doesn't # Check if template bin file exists, return early if it doesn't
if (-not (Test-Path $startMenuTemplate)) { if (-not (Test-Path $startMenuTemplate)) {
Write-Host "Error: Unable to replace start menu, template start2.bin file not found" -ForegroundColor Red Write-Host "Error: Unable to replace start menu, template file not found" -ForegroundColor Red
return
}
if ([IO.Path]::GetExtension($startMenuTemplate) -ne ".bin" ) {
Write-Host "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red
return return
} }
# Check if bin file exists, return early if it doesn't # Check if bin file exists, return early if it doesn't
if (-not (Test-Path $startMenuBinFile)) { if (-not (Test-Path $startMenuBinFile)) {
Write-Host "Error: Unable to replace start menu for user $(GetUserName), template start2.bin file not found" -ForegroundColor Red Write-Host "Error: Unable to replace start menu for user $(GetUserName), original start2.bin file not found" -ForegroundColor Red
return return
} }