diff --git a/bleachbit.ps1 b/bleachbit.ps1 index b54810f..c91c43b 100644 --- a/bleachbit.ps1 +++ b/bleachbit.ps1 @@ -131,43 +131,6 @@ try { 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 if (-not (Test-Path $exePath)) { throw "BleachBit executable not found at: $exePath"