# Windows 포터블 zip 패키징. # 사용: .\scripts\package-portable.ps1 [-Target x64|arm64] # 결과: dist-portable\Archive--windows-.zip # 내용: Archive.exe, ffmpeg.exe, ffprobe.exe, data\(빈 폴더 → 포터블 모드), README.txt param( [ValidateSet("x64", "arm64")] [string]$Target = "x64" ) $ErrorActionPreference = "Stop" $root = Split-Path $PSScriptRoot -Parent $triple = if ($Target -eq "x64") { "x86_64-pc-windows-msvc" } else { "aarch64-pc-windows-msvc" } # 버전 (tauri.conf.json) $conf = Get-Content "$root\src-tauri\tauri.conf.json" -Raw | ConvertFrom-Json $ver = $conf.version $exe = if ($Target -eq "x64") { "$root\src-tauri\target\release\archive.exe" } else { "$root\src-tauri\target\$triple\release\archive.exe" } if (-not (Test-Path $exe)) { throw "빌드 산출물이 없습니다: $exe (먼저 tauri build --no-bundle 실행)" } $ffmpeg = "$root\src-tauri\binaries\ffmpeg-$triple.exe" $ffprobe = "$root\src-tauri\binaries\ffprobe-$triple.exe" if (-not (Test-Path $ffmpeg)) { throw "ffmpeg 사이드카 없음: $ffmpeg (scripts\fetch-ffmpeg.ps1 -Target win$($Target -replace 'x','') 먼저 실행)" } $stage = "$root\dist-portable\stage-$Target" Remove-Item -Recurse -Force $stage -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force "$stage\data" | Out-Null Copy-Item $exe "$stage\Archive.exe" Copy-Item $ffmpeg "$stage\ffmpeg.exe" Copy-Item $ffprobe "$stage\ffprobe.exe" @" Archive $ver — 포터블 (무설치) 실행: Archive.exe 를 더블클릭하세요. - 이 폴더의 data\ 하위에 인덱스(archive.db)와 썸네일이 저장됩니다. 폴더째로 USB/다른 PC로 옮겨도 그대로 동작합니다. - WebView2 런타임이 필요합니다. Windows 11과 최신 Windows 10에는 기본 설치되어 있습니다. 없다면 아래에서 설치하세요: https://developer.microsoft.com/microsoft-edge/webview2/ 문제가 있으면 data\logs\ 의 로그를 확인하세요. "@ | Set-Content "$stage\README.txt" -Encoding utf8 $outDir = "$root\dist-portable" $zip = "$outDir\Archive-$ver-windows-$Target.zip" Remove-Item $zip -ErrorAction SilentlyContinue Compress-Archive -Path "$stage\*" -DestinationPath $zip -CompressionLevel Optimal Remove-Item -Recurse -Force $stage $sizeMB = [math]::Round((Get-Item $zip).Length / 1MB, 1) Write-Host "[package-portable] 완료: $zip ($sizeMB MB)"