feat(update): add transactional external updater
This commit is contained in:
@@ -120,6 +120,18 @@ if ($LASTEXITCODE -ne 0) {
|
||||
throw "$(Decode-Utf8Base64 "UHlJbnN0YWxsZXIg5omT5YyF5aSx6LSl77yM6YCA5Ye656CB"): $LASTEXITCODE"
|
||||
}
|
||||
|
||||
$updaterSpec = Join-Path $repoRoot "cmshopee-updater.spec"
|
||||
$updaterDist = Join-Path $repoRoot "dist\updater"
|
||||
$updaterWork = Join-Path $repoRoot "build\updater"
|
||||
& $pythonExe @pythonArgs -m PyInstaller --noconfirm --clean --distpath $updaterDist --workpath $updaterWork $updaterSpec
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "独立更新器打包失败,退出码: $LASTEXITCODE"
|
||||
}
|
||||
$updaterExe = Join-Path $updaterDist "cmshopee-updater.exe"
|
||||
if (-not (Test-Path -LiteralPath $updaterExe)) {
|
||||
throw "独立更新器产物不存在: $updaterExe"
|
||||
}
|
||||
|
||||
$distDir = Join-Path $repoRoot "dist\cmshopee"
|
||||
$exePath = Join-Path $distDir "cmshopee.exe"
|
||||
if (-not (Test-Path -LiteralPath $exePath)) {
|
||||
@@ -164,6 +176,7 @@ foreach ($path in @($releaseDir, $portableZip, $releaseMetadata)) {
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
|
||||
Get-ChildItem -LiteralPath $distDir -Force | Copy-Item -Destination $releaseDir -Recurse -Force
|
||||
Copy-Item -LiteralPath $updaterExe -Destination (Join-Path $releaseDir "cmshopee-updater.exe") -Force
|
||||
Set-Content -LiteralPath (Join-Path $releaseDir "version.txt") -Value $appVersion -Encoding ascii -NoNewline
|
||||
|
||||
$readme = @(
|
||||
|
||||
Reference in New Issue
Block a user