@@ -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