This commit is contained in:
Your Name
2026-08-03 10:52:51 +08:00
parent 5ac803f7a6
commit 1048b9ba29
29 changed files with 436 additions and 597 deletions
+7 -8
View File
@@ -22,7 +22,7 @@ function Test-BuildPython([string]$Candidate) {
if (-not $Candidate -or -not (Test-Path -LiteralPath $Candidate)) {
return $false
}
& $Candidate -c "import PyInstaller, PySide6, requests, numpy, PIL, pyautogui, pyperclip, win32gui, mcp" *> $null
& $Candidate -c "import PyInstaller, PySide6, requests, numpy, PIL, pyautogui, pyperclip, win32gui, mcp, rapidocr_onnxruntime" *> $null
return $LASTEXITCODE -eq 0
}
@@ -61,15 +61,14 @@ finally {
Pop-Location
}
$exe = Join-Path $projectRoot "dist\ZhenAI-WeCom-Assistant-v$version.exe"
$appName = "ZhenAI-WeCom-Assistant-v$version"
$appDir = Join-Path $projectRoot "dist\$appName"
$exe = Join-Path $appDir "$appName.exe"
if (-not (Test-Path -LiteralPath $exe)) {
throw ("Build completed but EXE was not found: " + $exe)
}
$packageToc = Join-Path $projectRoot "build\wechat_rpa\PKG-00.toc"
if (-not (Test-Path -LiteralPath $packageToc)) {
throw "PyInstaller package manifest was not found"
}
$internalDir = Join-Path $appDir "_internal"
$requiredRuntimeFiles = @(
"PySide6\QtWebEngineProcess.exe",
"PySide6\resources\qtwebengine_resources.pak",
@@ -77,9 +76,8 @@ $requiredRuntimeFiles = @(
"PySide6\translations\qtwebengine_locales\zh-CN.pak",
"VCRUNTIME140.dll"
)
$packageManifest = (Get-Content -LiteralPath $packageToc -Raw).Replace('\\', '\')
foreach ($requiredFile in $requiredRuntimeFiles) {
if (-not $packageManifest.Contains($requiredFile)) {
if (-not (Test-Path -LiteralPath (Join-Path $internalDir $requiredFile))) {
throw ("Required embedded runtime file is missing: " + $requiredFile)
}
}
@@ -103,5 +101,6 @@ finally {
Write-Output "Packaged Qt WebEngine self-check passed"
$hash = (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash
Write-Output ("App folder: " + $appDir)
Write-Output ("EXE: " + $exe)
Write-Output ("SHA256: " + $hash)