| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- # Portable packager for Steam求购 custom edition (dakehu).
- # Output: SteamQG_Portable.zip — does NOT overwrite SteamSH_Portable.zip / steamSH_V*.exe
- param(
- [string]$SourceExe = "SteamQG.exe",
- [string]$OutputFile = "SteamQG_Portable.exe"
- )
- $ErrorActionPreference = "Stop"
- [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
- Write-Host "========================================" -ForegroundColor Cyan
- Write-Host "SteamQG (Steam求购) portable packager" -ForegroundColor Cyan
- Write-Host "========================================" -ForegroundColor Cyan
- Write-Host "`n[1/3] Checking source..." -ForegroundColor Yellow
- if (-not (Test-Path $SourceExe)) {
- Write-Host "ERROR: source not found: $SourceExe" -ForegroundColor Red
- Write-Host "Run tauri build then build-windows.ps1 first." -ForegroundColor Yellow
- exit 1
- }
- Write-Host " OK: $SourceExe" -ForegroundColor Green
- Write-Host "`n[2/3] Preparing package folder..." -ForegroundColor Yellow
- $tempDir = Join-Path $env:TEMP "SteamQG_Portable_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
- New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
- Copy-Item $SourceExe (Join-Path $tempDir "SteamQG.exe") -Force
- $startBat = @"
- @echo off
- chcp 65001 >nul
- echo Starting SteamQG...
- cd /d "%~dp0"
- start "" "SteamQG.exe"
- "@
- $startBat | Out-File (Join-Path $tempDir "start.bat") -Encoding UTF8
- $readme = @"
- SteamQG Portable (Steam求购 custom edition)
- ==========================================
- 1. Double-click start.bat or SteamQG.exe
- 2. Standalone, no install required
- 3. Independent from old steamSH / Youdangdang builds
- "@
- $readme | Out-File (Join-Path $tempDir "README.txt") -Encoding UTF8
- Write-Host " OK" -ForegroundColor Green
- Write-Host "`n[3/3] Creating zip..." -ForegroundColor Yellow
- $zipFile = "SteamQG_Portable.zip"
- if (Test-Path $zipFile) { Remove-Item $zipFile -Force }
- Compress-Archive -Path (Join-Path $tempDir "*") -DestinationPath $zipFile -Force
- Write-Host " OK: $zipFile ($([math]::Round((Get-Item $zipFile).Length / 1MB, 2)) MB)" -ForegroundColor Green
- Remove-Item $tempDir -Recurse -Force -ErrorAction SilentlyContinue
- Write-Host "`nDone. Old SteamSH_Portable.zip / steamSH_V*.exe untouched." -ForegroundColor Yellow
|