From 31d31edd6254646e184e083bd915d0b3cf49262c Mon Sep 17 00:00:00 2001 From: chun_qiu Date: Fri, 31 Jul 2026 13:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E7=94=A8=20--onedir=20=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=99=8D=E4=BD=8E=E6=9D=80?= =?UTF-8?q?=E8=BD=AF=E8=AF=AF=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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