Skip to content

Commit fd7b8a0

Browse files
committed
fix(winre): run correct script
1 parent 14faee9 commit fd7b8a0

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/playbook/Executables/AtlasModules/PackagesEnvironment/centralScript.ps1

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ if ($Verbose) { Write-Host "" }
120120
if ($WinRE) {
121121
if (Test-Path $useWinreIndicator) {
122122
Remove-Item $useWinreIndicator -Force
123-
} else { exit }
123+
} else {
124+
exit
125+
}
124126

125127
Write-Host ''
126128
& "$envPath\winrePackages.ps1" -LogPath "$sessionLogDirectory\winreSetup.log"
@@ -139,14 +141,13 @@ foreach ($package in $packageList) {
139141
$packageName = (Get-Item $package).Basename
140142
Write-Info -Text "Installing $packageName with online-sxs..."
141143
$onlineSxsOutput = & "$envPath\onlineSxs.ps1" "$package" *>&1
142-
if (!$? -and !$safeModeWithList) {
143-
# if (!$safeModeWithList) {
144-
Write-Info "Failed to install $packageName, will try safe mode after completion..." -UseError
145-
$failedPackages += $package
146-
} elseif (!$? -and $safeModeWithList) {
147-
# } elseif ($safeModeWithList) {
148-
Write-Info "Failed to install $packageName, will try in WinRE..." -UseError
144+
if (!$?) {
149145
$failedPackages += $package
146+
if (!$safeModeWithList) {
147+
Write-Info "Failed to install $packageName, will try safe mode after completion..." -UseError
148+
} else {
149+
Write-Info "Failed to install $packageName, will try in WinRE..." -UseError
150+
}
150151
} else {
151152
Write-Info "Installed $packageName..."
152153
}
@@ -172,7 +173,7 @@ if ($failedPackages.Count -ne 0) {
172173
'Force' = $true
173174
}
174175
$arguments = "/c title Finalizing installation - Atlas & echo Do not close this window. & echo Atlas is setting up component removal in Windows Recovery... & echo Your computer will automatically restart. & echo] & schtasks /delete /tn `"$safeModeStartupTitle`" /f > nul & " `
175-
+ "powershell -NoP -EP Unrestricted -C `"& '$envPath\winrePackages.ps1' -WinRE`" & pause"
176+
+ "powershell -NoP -EP Unrestricted -C `"& '$envPath\centralScript.ps1' -WinRE`" & pause"
176177
$action = New-ScheduledTaskAction -Execute 'cmd' -Argument $arguments
177178
Register-ScheduledTask -TaskName $safeModeStartupTitle -Action $action @taskArgs | Out-Null
178179
}

src/playbook/Executables/AtlasModules/PackagesEnvironment/winrePackages.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ param (
44
[switch]$DeleteBitLockerPassword
55
)
66

7-
if ((Get-WmiObject -Class Win32_ComputerSystem).SystemType -match '*ARM64*') {
8-
Write-Host "This script is not supported on ARM64." -ForegroundColor Yellow
9-
pause
10-
}
11-
127
# Task Scheduler is needed for this script to function correctly
138
if ((Get-Service -Name 'Schedule' -EA SilentlyContinue).Status -ne 'Running') {
149
Set-Service -Name 'Schedule' -StartupType Automatic

0 commit comments

Comments
 (0)