Files
AutoDeployYun/build.ps1
2026-10-30 11:07:49 +08:00

14 lines
708 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$ErrorActionPreference = 'Stop'
Set-Location -LiteralPath $PSScriptRoot
$deployPython = (Get-Command python).Source
$deployOriginalPath = $env:PATH
try {
# Keep unrelated native runtimes (e.g. Poppler ICU) out of DLL discovery.
$env:PATH = @((Split-Path -Parent $deployPython), "$env:SystemRoot\System32", $env:SystemRoot) -join ';'
& $deployPython -m PyInstaller --noconfirm --clean --windowed --name AutoDeploy --icon autodeploy/app.ico --add-data 'autodeploy/remote.py;autodeploy' --add-data 'autodeploy/app.ico;autodeploy' main.py
if ($LASTEXITCODE -ne 0) { throw 'EXE 打包失败' }
} finally {
$env:PATH = $deployOriginalPath
}
Write-Host '完成:dist\AutoDeploy\AutoDeploy.exe'