Initial commit
This commit is contained in:
13
build.ps1
Normal file
13
build.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
$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'
|
||||
Reference in New Issue
Block a user