mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 06:50:09 +00:00
[MicroWin] 25H2 preparation (#3543)
* [Enhance] Configure all apps view in start menu To keep look consistent with older Win11 * [Enhance] Additional Start menu settings * [MicroWin] Change Write-Host to Write-Debug on debug lines. (#13) * Add a resolution to scripts being disabled (#14) * [MicroWin] Change Write-Host to Write-Debug on debug lines. * Add a resolution to scripts being disabled * Add skip first logon anim option * Unrelated: indentation fixes from compile script * Some little touches to the first-run script --------- Co-authored-by: Real-MullaC <callumjanes2007new+github@gmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@ public class PowerManagement {
|
||||
|
||||
$WPBT = $sync.MicroWinWPBT.IsChecked
|
||||
$unsupported = $sync.MicroWinUnsupported.IsChecked
|
||||
$skipFla = $sync.MicroWinNoFLA.IsChecked
|
||||
|
||||
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
|
||||
|
||||
@@ -181,6 +182,15 @@ public class PowerManagement {
|
||||
reg unload HKLM\zSYSTEM
|
||||
}
|
||||
|
||||
if ($skipFla) {
|
||||
Write-Host "Skipping first logon animation..."
|
||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /ve /t REG_SZ /d "Stop First Logon Animation Process" /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /v StubPath /t REG_EXPAND_SZ /d '""%WINDIR%\System32\cmd.exe"" /C ""taskkill /f /im firstlogonanim.exe""' /f
|
||||
reg unload HKLM\zSOFTWARE
|
||||
}
|
||||
|
||||
if ($unsupported) {
|
||||
Write-Host "Bypassing system requirements (locally)"
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||
|
||||
@@ -4,7 +4,7 @@ function Invoke-MicrowinGetIso {
|
||||
Function to get the path to Iso file for MicroWin, unpack that isom=, read basic information and populate the UI Options
|
||||
#>
|
||||
|
||||
Write-Host "Invoking WPFGetIso"
|
||||
Write-Debug "Invoking WPFGetIso"
|
||||
|
||||
if($sync.ProcessRunning) {
|
||||
$msg = "GetIso process is currently running."
|
||||
@@ -77,6 +77,7 @@ function Invoke-MicrowinGetIso {
|
||||
if (-not $?)
|
||||
{
|
||||
Write-Host "Could not download the ISO file. Look at the output of the console for more information."
|
||||
Write-Host "If you get an error about scripts is disabled on this system please close WinUtil and run - 'Set-ExecutionPolicy -ExecutionPolicy Unrestricted' and select 'A' and retry using MicroWin again."
|
||||
$msg = "The ISO file could not be downloaded"
|
||||
Invoke-MicrowinBusyInfo -action "warning" -message $msg
|
||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||
|
||||
@@ -34,7 +34,9 @@ function Microwin-NewFirstRun {
|
||||
|
||||
$taskbarPath = "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
|
||||
# Delete all files on the Taskbar
|
||||
Get-ChildItem -Path $taskbarPath -File | Remove-Item -Force
|
||||
if (Test-Path "$taskbarPath") {
|
||||
Get-ChildItem -Path $taskbarPath -File | Remove-Item -Force
|
||||
}
|
||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesRemovedChanges"
|
||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "FavoritesChanges"
|
||||
Remove-RegistryValue -RegistryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -ValueName "Favorites"
|
||||
@@ -88,6 +90,23 @@ function Microwin-NewFirstRun {
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /v Enabled /t REG_DWORD /d 0 /f
|
||||
|
||||
# This will set List view in Start menu on Win11 25H2. This will not do anything in 24H2 and older
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v AllAppsViewMode /t REG_DWORD /d 2 /f
|
||||
|
||||
# This will disable the Recommendations in 25H2. This is much simpler than the method used in 24H2 that requires the Education Environment policy
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_IrisRecommendations /t REG_DWORD /d 0 /f
|
||||
|
||||
# Other Start Menu settings
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_AccountNotifications /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowAllPinsList /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowFrequentList /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowRecentList /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackDocs /t REG_DWORD /d 0 /f
|
||||
|
||||
Clear-Host
|
||||
Write-Host "The taskbar will take around a minute to show up, but you can start using your computer now. Try pressing the Windows key to open the Start menu, or Windows + E to launch File Explorer."
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
if (Test-Path -Path "$env:HOMEDRIVE\winutil-config.json")
|
||||
{
|
||||
Write-Host "Configuration file detected. Applying..."
|
||||
|
||||
@@ -5,9 +5,9 @@ function Invoke-WPFUpdatesdefault {
|
||||
Resets Windows Update settings to default
|
||||
|
||||
#>
|
||||
|
||||
|
||||
Write-Host "Restoring Windows Update registry settings..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||
}
|
||||
@@ -25,7 +25,7 @@ function Invoke-WPFUpdatesdefault {
|
||||
|
||||
# Restore update services to their default state
|
||||
Write-Host "Restoring update services..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$services = @(
|
||||
@{Name = "BITS"; StartupType = "Manual"},
|
||||
@{Name = "wuauserv"; StartupType = "Manual"},
|
||||
@@ -40,10 +40,10 @@ function Invoke-WPFUpdatesdefault {
|
||||
$serviceObj = Get-Service -Name $service.Name -ErrorAction SilentlyContinue
|
||||
if ($serviceObj) {
|
||||
Set-Service -Name $service.Name -StartupType $service.StartupType -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Reset failure actions to default using sc command
|
||||
Start-Process -FilePath "sc.exe" -ArgumentList "failure `"$($service.Name)`" reset= 86400 actions= restart/60000/restart/60000/restart/60000" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Start the service if it should be running
|
||||
if ($service.StartupType -eq "Automatic") {
|
||||
Start-Service -Name $service.Name -ErrorAction SilentlyContinue
|
||||
@@ -57,25 +57,25 @@ function Invoke-WPFUpdatesdefault {
|
||||
|
||||
# Restore renamed DLLs if they exist
|
||||
Write-Host "Restoring renamed update service DLLs..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$dlls = @("WaaSMedicSvc", "wuaueng")
|
||||
|
||||
|
||||
foreach ($dll in $dlls) {
|
||||
$dllPath = "C:\Windows\System32\$dll.dll"
|
||||
$backupPath = "C:\Windows\System32\${dll}_BAK.dll"
|
||||
|
||||
|
||||
if ((Test-Path $backupPath) -and !(Test-Path $dllPath)) {
|
||||
try {
|
||||
# Take ownership of backup file
|
||||
Start-Process -FilePath "takeown.exe" -ArgumentList "/f `"$backupPath`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Grant full control to everyone
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /grant *S-1-1-0:F" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Rename back to original
|
||||
Rename-Item -Path $backupPath -NewName "$dll.dll" -ErrorAction SilentlyContinue
|
||||
Write-Host "Restored ${dll}_BAK.dll to $dll.dll"
|
||||
|
||||
|
||||
# Restore ownership to TrustedInstaller
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /setowner `"NT SERVICE\TrustedInstaller`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /remove *S-1-1-0" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
@@ -88,7 +88,7 @@ function Invoke-WPFUpdatesdefault {
|
||||
|
||||
# Enable update related scheduled tasks
|
||||
Write-Host "Enabling update related scheduled tasks..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$taskPaths = @(
|
||||
'\Microsoft\Windows\InstallService\*'
|
||||
'\Microsoft\Windows\UpdateOrchestrator\*'
|
||||
@@ -124,7 +124,7 @@ function Invoke-WPFUpdatesdefault {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
Write-Host "==================================================="
|
||||
Write-Host "--- Windows Update Settings Reset to Default ---"
|
||||
Write-Host "==================================================="
|
||||
@@ -148,6 +148,6 @@ function Invoke-WPFUpdatesdefault {
|
||||
Write-Host "==================================================="
|
||||
Write-Host "--- Windows Local Policies Reset to Default ---"
|
||||
Write-Host "==================================================="
|
||||
|
||||
|
||||
Write-Host "Note: A system restart may be required for all changes to take full effect." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
@@ -9,20 +9,20 @@ function Invoke-WPFUpdatesdisable {
|
||||
This function requires administrator privileges and will attempt to run as SYSTEM for certain operations.
|
||||
|
||||
#>
|
||||
|
||||
|
||||
Write-Host "Configuring registry settings..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
|
||||
|
||||
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
|
||||
|
||||
|
||||
# Additional registry settings
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" -Name "Start" -Type DWord -Value 4 -ErrorAction SilentlyContinue
|
||||
$failureActions = [byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xd4,0x01,0x00,0x00,0x00,0x00,0x00,0xe0,0x93,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
|
||||
@@ -30,7 +30,7 @@ function Invoke-WPFUpdatesdisable {
|
||||
|
||||
# Disable and stop update related services
|
||||
Write-Host "Disabling update services..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$services = @(
|
||||
"BITS"
|
||||
"wuauserv"
|
||||
@@ -46,7 +46,7 @@ function Invoke-WPFUpdatesdisable {
|
||||
if ($serviceObj) {
|
||||
Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
|
||||
Set-Service -Name $service -StartupType Disabled -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Set failure actions to nothing using sc command
|
||||
Start-Process -FilePath "sc.exe" -ArgumentList "failure `"$service`" reset= 0 actions= `"`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
}
|
||||
@@ -58,26 +58,26 @@ function Invoke-WPFUpdatesdisable {
|
||||
|
||||
# Rename critical update service DLLs (requires SYSTEM privileges)
|
||||
Write-Host "Attempting to rename critical update service DLLs..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$dlls = @("WaaSMedicSvc", "wuaueng")
|
||||
|
||||
|
||||
foreach ($dll in $dlls) {
|
||||
$dllPath = "C:\Windows\System32\$dll.dll"
|
||||
$backupPath = "C:\Windows\System32\${dll}_BAK.dll"
|
||||
|
||||
|
||||
if (Test-Path $dllPath) {
|
||||
try {
|
||||
# Take ownership
|
||||
Start-Process -FilePath "takeown.exe" -ArgumentList "/f `"$dllPath`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Grant full control to everyone
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /grant *S-1-1-0:F" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
# Rename file
|
||||
if (!(Test-Path $backupPath)) {
|
||||
Rename-Item -Path $dllPath -NewName "${dll}_BAK.dll" -ErrorAction SilentlyContinue
|
||||
Write-Host "Renamed $dll.dll to ${dll}_BAK.dll"
|
||||
|
||||
|
||||
# Restore ownership to TrustedInstaller
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /setowner `"NT SERVICE\TrustedInstaller`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /remove *S-1-1-0" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
|
||||
@@ -91,7 +91,7 @@ function Invoke-WPFUpdatesdisable {
|
||||
|
||||
# Delete downloaded update files
|
||||
Write-Host "Cleaning up downloaded update files..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
try {
|
||||
$softwareDistPath = "C:\Windows\SoftwareDistribution"
|
||||
if (Test-Path $softwareDistPath) {
|
||||
@@ -105,7 +105,7 @@ function Invoke-WPFUpdatesdisable {
|
||||
|
||||
# Disable update related scheduled tasks
|
||||
Write-Host "Disabling update related scheduled tasks..." -ForegroundColor Yellow
|
||||
|
||||
|
||||
$taskPaths = @(
|
||||
'\Microsoft\Windows\InstallService\*'
|
||||
'\Microsoft\Windows\UpdateOrchestrator\*'
|
||||
@@ -129,7 +129,7 @@ function Invoke-WPFUpdatesdisable {
|
||||
}
|
||||
|
||||
Write-Host "=================================" -ForegroundColor Green
|
||||
Write-Host "--- Updates ARE DISABLED ---" -ForegroundColor Green
|
||||
Write-Host "--- Updates ARE DISABLED ---" -ForegroundColor Green
|
||||
Write-Host "===================================" -ForegroundColor Green
|
||||
Write-Host "Note: Some operations may require a system restart to take full effect." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user