Skip to content

Commit f860ddc

Browse files
committed
fix(scripts): handle nested chrome.7z extraction in Windows installer
1 parent 49b447f commit f860ddc

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/install_botbrowser.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,21 @@ if ($sevenZip) {
116116
exit 1
117117
}
118118

119+
# Handle nested archives (the outer 7z may contain chrome.7z or other archives)
120+
$nested7zFiles = Get-ChildItem -Path $InstallDir -Filter "*.7z" -Recurse -ErrorAction SilentlyContinue
121+
foreach ($nested in $nested7zFiles) {
122+
Write-Host " Extracting nested archive: $($nested.Name)"
123+
& $sevenZip.Source x $nested.FullName -o"$InstallDir" -y | Out-Null
124+
Remove-Item $nested.FullName -Force
125+
}
126+
127+
$nestedZipFiles = Get-ChildItem -Path $InstallDir -Filter "*.zip" -Recurse -ErrorAction SilentlyContinue
128+
foreach ($nested in $nestedZipFiles) {
129+
Write-Host " Extracting nested archive: $($nested.Name)"
130+
Expand-Archive -Path $nested.FullName -DestinationPath $InstallDir -Force
131+
Remove-Item $nested.FullName -Force
132+
}
133+
119134
Write-Host "4. Cleaning up..."
120135
Remove-Item $tempFile -Force
121136

0 commit comments

Comments
 (0)