diff --git a/build.ps1 b/build.ps1 index 23e7480..2a6eaa4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,8 +4,8 @@ .SYNOPSIS 壁纸更换器 - 编译脚本 .DESCRIPTION - 使用 PyInstaller 将 Python 源码打包为单个 .exe 文件。 - 输出: .\dist\WallpaperChanger.exe + 使用 PyInstaller 将 Python 源码打包为目录模式(--onedir)。 + 输出: .\dist\WallpaperChanger\WallpaperChanger.exe #> $ErrorActionPreference = "Stop" @@ -34,7 +34,7 @@ Remove-Item -Force "$ScriptDir\*.spec" -ErrorAction SilentlyContinue Write-Host "[4/4] PyInstaller 打包 ..." -ForegroundColor Yellow Set-Location -LiteralPath $ScriptDir python -m PyInstaller ` - --onefile ` + --onedir ` --noconsole ` --name "WallpaperChanger" ` --clean ` @@ -45,5 +45,5 @@ if ($LASTEXITCODE -ne 0) { throw "PyInstaller 打包失败" } Write-Host "" Write-Host "========================================" -ForegroundColor Green Write-Host " 编译完成!" -ForegroundColor Green -Write-Host " 输出: $ScriptDir\dist\WallpaperChanger.exe" -ForegroundColor Green +Write-Host " 输出: $ScriptDir\dist\WallpaperChanger\WallpaperChanger.exe" -ForegroundColor Green Write-Host "========================================" -ForegroundColor Green \ No newline at end of file