Add Scribd PDF Downloader under Scribd/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
5d2933ea95
28 files changed
+2159
No files matched your search
@@ -0,0 +1,46 @@
|
||||
# Build Windows portable app (folder with Scribd PDF Downloader.exe)
|
||||
# Run from project root: .\build\windows\build.ps1
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = Resolve-Path (Join-Path $PSScriptRoot "..\..")
|
||||
Set-Location $Root
|
||||
|
||||
Write-Host "=== Scribd PDF Downloader - Windows build ===" -ForegroundColor Cyan
|
||||
|
||||
if (-not (Test-Path ".venv\Scripts\python.exe")) {
|
||||
Write-Host "Creating virtual environment..."
|
||||
python -m venv .venv
|
||||
}
|
||||
|
||||
Write-Host "Installing dependencies..."
|
||||
& .venv\Scripts\pip install -r requirements-build.txt -q
|
||||
|
||||
Write-Host "Installing Chromium into package (for bundling)..."
|
||||
$env:PLAYWRIGHT_BROWSERS_PATH = "0"
|
||||
& .venv\Scripts\playwright install chromium
|
||||
|
||||
Write-Host "Running PyInstaller..."
|
||||
& .venv\Scripts\pyinstaller --noconfirm --clean "build\scribd_gui.spec"
|
||||
|
||||
$Dist = Join-Path $Root "dist\Scribd PDF Downloader"
|
||||
if (-not (Test-Path $Dist)) {
|
||||
throw "Build failed: dist folder not found."
|
||||
}
|
||||
|
||||
Copy-Item "config.ini" $Dist -Force -ErrorAction SilentlyContinue
|
||||
|
||||
$Zip = Join-Path $Root "dist\Scribd-PDF-Downloader-Windows.zip"
|
||||
if (Test-Path $Zip) { Remove-Item $Zip -Force }
|
||||
Start-Sleep -Seconds 2
|
||||
try {
|
||||
Compress-Archive -Path $Dist -DestinationPath $Zip -Force
|
||||
} catch {
|
||||
Write-Host "Zip skipped (copy the dist folder instead): $_" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Build complete!" -ForegroundColor Green
|
||||
Write-Host " App folder: $Dist"
|
||||
Write-Host " Zip archive: $Zip"
|
||||
Write-Host ""
|
||||
Write-Host ('Run: "' + (Join-Path $Dist 'Scribd PDF Downloader.exe') + '"')
|
||||
Reference in new issue
Block a user