Add guarded UPX exe packing flow
This commit is contained in:
1 parent
11de0f75c7
commit
abcee63776
4 files changed
+251
-1
No files matched your search
@@ -1,7 +1,10 @@
|
||||
param(
|
||||
[string]$Version = "",
|
||||
[switch]$SkipInstall,
|
||||
[switch]$Obfuscate
|
||||
[switch]$Obfuscate,
|
||||
[switch]$PackExe,
|
||||
[switch]$PackExeForce,
|
||||
[string]$UpxDir = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -85,6 +88,20 @@ if (Test-Path $licensePath) {
|
||||
|
||||
Copy-Item -LiteralPath (Join-Path $Root "README.md") -Destination (Join-Path $DistRoot "README.md") -Force
|
||||
|
||||
if ($PackExe) {
|
||||
$PackArgs = @($DistRoot)
|
||||
if ($UpxDir) {
|
||||
$PackArgs += @("--upx-dir", $UpxDir)
|
||||
}
|
||||
if ($PackExeForce) {
|
||||
$PackArgs += "--force"
|
||||
}
|
||||
python -m tools.exe_packing @PackArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "UPX packing failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
python -m tools.distribution_manifest $DistRoot
|
||||
|
||||
Write-Host "[OK] Portable package: $DistRoot"
|
||||
|
||||
Reference in new issue
Block a user