diff --git a/Get.ps1 b/Get.ps1 index cf357fe..f08f3d5 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -73,13 +73,13 @@ Write-Output "------------------------------------------------------------------ Write-Output "> Downloading Win11Debloat..." # 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 -if (Test-Path "$env:TEMP/Win11Debloat/Win11Debloat-master") { +if (Test-Path "$env:TEMP/Win11Debloat") { Write-Output "" 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 "" @@ -91,6 +91,9 @@ Expand-Archive "$env:TEMP/win11debloat-temp.zip" "$env:TEMP/Win11Debloat" # Remove archive 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 $arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object { if ($_.Value -eq $true) { @@ -105,7 +108,7 @@ Write-Output "" Write-Output "> Running Win11Debloat..." # 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 if ($null -ne $debloatProcess) { @@ -113,12 +116,12 @@ if ($null -ne $debloatProcess) { } # 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 "> Cleaning up..." # 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 "" diff --git a/README.md b/README.md index cba7d77..de8ec09 100644 --- a/README.md +++ b/README.md @@ -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! -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) @@ -53,7 +53,7 @@ This method supports parameters to customize the behaviour of the script. Please
Manually download & run the script.
- 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 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. @@ -65,7 +65,7 @@ This method supports parameters to customize the behaviour of the script. Please
Manually download the script & run the script via PowerShell. Recommended for advanced users.
- 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. 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. - Disable Fast Start-up to ensure a full shutdown. - Disable the Sticky Keys keyboard shortcut. (W11 only) -- Option to apply changes to a different 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. +- 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](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 diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 70e91cc..ad0b705 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -645,13 +645,18 @@ function ReplaceStartMenu { # Check if template bin file exists, return early if it doesn't 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 } # Check if bin file exists, return early if it doesn't 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 }