-
This commit is contained in:
parent
e086626047
commit
550d88b6ba
1 changed files with 0 additions and 37 deletions
|
|
@ -131,43 +131,6 @@ try {
|
||||||
Write-Host "Download complete."
|
Write-Host "Download complete."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Extract if executable doesn't exist
|
|
||||||
if (-not (Test-Path $exePath)) {
|
|
||||||
Write-Host "Extracting BleachBit..."
|
|
||||||
|
|
||||||
# Use Expand-Archive for extraction (built-in since PowerShell 5.0)
|
|
||||||
$tempExtractPath = "$env:TEMP\BleachBit_Extract"
|
|
||||||
|
|
||||||
if (Test-Path $tempExtractPath) {
|
|
||||||
Remove-Item -Path $tempExtractPath -Recurse -Force
|
|
||||||
}
|
|
||||||
|
|
||||||
Expand-Archive -Path $zipPath -DestinationPath $tempExtractPath -Force
|
|
||||||
|
|
||||||
# Move contents to install path
|
|
||||||
$extractedContent = Get-ChildItem -Path $tempExtractPath -Recurse
|
|
||||||
|
|
||||||
foreach ($item in $extractedContent) {
|
|
||||||
$destination = $item.FullName.Replace($tempExtractPath, $InstallPath)
|
|
||||||
|
|
||||||
if ($item.PSIsContainer) {
|
|
||||||
if (-not (Test-Path $destination)) {
|
|
||||||
New-Item -Path $destination -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$parentDir = Split-Path $destination -Parent
|
|
||||||
if (-not (Test-Path $parentDir)) {
|
|
||||||
New-Item -Path $parentDir -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
Move-Item -Path $item.FullName -Destination $destination -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clean up temp extraction
|
|
||||||
Remove-Item -Path $tempExtractPath -Recurse -Force
|
|
||||||
Write-Host "Extraction complete."
|
|
||||||
}
|
|
||||||
|
|
||||||
# Verify executable exists
|
# Verify executable exists
|
||||||
if (-not (Test-Path $exePath)) {
|
if (-not (Test-Path $exePath)) {
|
||||||
throw "BleachBit executable not found at: $exePath"
|
throw "BleachBit executable not found at: $exePath"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue