Skip to content

Commit 8b0ff38

Browse files
committed
test(windows-updater): probe file replacement during staged apply
Add pre/post copy file probes for app.asar and the main executable in the apply script, and bump app version to force a fresh in-app update cycle for diagnosing why reload can relaunch without applying new binaries. Made-with: Cursor
1 parent af459e4 commit 8b0ff38

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "https://github.com/HyperlinksSpace/HyperlinksSpaceProgram.git"
1717
},
1818
"main": "index.js",
19-
"version": "53.0.1393",
19+
"version": "53.0.1394",
2020
"type": "module",
2121
"engines": {
2222
"node": ">=18 <=22"

windows/build.cjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,19 @@ function setupAutoUpdater() {
13441344
" $ts = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ss.fffZ')",
13451345
' Add-Content -LiteralPath $LogFile -Value ("[$ts] " + $m) -Encoding UTF8',
13461346
"}",
1347+
"function Write-FileProbe([string]$label, [string]$path) {",
1348+
" try {",
1349+
" if (-not (Test-Path -LiteralPath $path)) {",
1350+
' Write-ApplyLog ($label + ": missing " + $path)',
1351+
" return",
1352+
" }",
1353+
" $fi = Get-Item -LiteralPath $path -ErrorAction Stop",
1354+
" $utc = $fi.LastWriteTimeUtc.ToString('yyyy-MM-ddTHH:mm:ss.fffZ')",
1355+
' Write-ApplyLog ($label + ": size=" + $fi.Length + " mtimeUtc=" + $utc + " path=" + $path)',
1356+
" } catch {",
1357+
' Write-ApplyLog ($label + ": probe failed " + $_.Exception.Message + " path=" + $path)',
1358+
" }",
1359+
"}",
13471360
"try {",
13481361
' Write-ApplyLog "apply start waitPid=$($plan.waitPid) exe=$($plan.exeName) versioned=$($plan.useVersionedLayout)"',
13491362
" $pp = Get-Process -Id $plan.waitPid -ErrorAction SilentlyContinue",
@@ -1364,6 +1377,14 @@ function setupAutoUpdater() {
13641377
" $dst = $plan.installDir",
13651378
' Write-ApplyLog "mirror target (flat): $dst"',
13661379
" }",
1380+
" $srcAsar = Join-Path $src 'resources\\app.asar'",
1381+
" $srcExe = Join-Path $src $plan.exeName",
1382+
" $dstAsar = Join-Path $dst 'resources\\app.asar'",
1383+
" $dstExe = Join-Path $dst $plan.exeName",
1384+
" Write-FileProbe 'pre-copy src asar' $srcAsar",
1385+
" Write-FileProbe 'pre-copy src exe' $srcExe",
1386+
" Write-FileProbe 'pre-copy dst asar' $dstAsar",
1387+
" Write-FileProbe 'pre-copy dst exe' $dstExe",
13671388
' Write-ApplyLog "copy staging -> dest (robocopy; versioned uses /MIR, flat uses non-destructive /E)"',
13681389
" $robocopyExe = Join-Path $env:SystemRoot 'System32\\robocopy.exe'",
13691390
" if ($plan.useVersionedLayout) {",
@@ -1379,6 +1400,10 @@ function setupAutoUpdater() {
13791400
" Copy-Item -Path (Join-Path $src '*') -Destination $dst -Recurse -Force",
13801401
' Write-ApplyLog "Copy-Item fallback done"',
13811402
" }",
1403+
" Write-FileProbe 'post-copy src asar' $srcAsar",
1404+
" Write-FileProbe 'post-copy src exe' $srcExe",
1405+
" Write-FileProbe 'post-copy dst asar' $dstAsar",
1406+
" Write-FileProbe 'post-copy dst exe' $dstExe",
13821407
" if ($plan.useVersionedLayout) {",
13831408
" if (Test-Path -LiteralPath $plan.currentLink) {",
13841409
" Remove-Item -LiteralPath $plan.currentLink -Force",

0 commit comments

Comments
 (0)