Revert to the PowerShell relaunch helper, on the operator's call

Restored verbatim from before 0430aab:

  Wait-Process -Id <pid>; Start-Sleep -Milliseconds 400;
  Start-Process -FilePath <exe> -ArgumentList '--post-update'

Two rewrites tried to start the new exe from inside the dying process
and both failed on real stations — 0.27.23 and again after the SW_HIDE
fix. The original's own comment had already said why: "Launching the new
exe directly while we're still alive raced the mutex and often left
nothing running." Telling the new instance our pid so it could wait on
the other side looked equivalent and is not. What the helper has that
neither rewrite did is that it OUTLIVES us — the launch happens once
this process is completely gone, from a process that was never our
child.

The Defender cost is known and accepted: an unsigned binary that
replaces itself, clears the mark-of-the-web and spawns a windowless
script to start another executable has the shape of a dropper, and
0.27.14 was removed from a station as Trojan:Script/Wacatac.H!ml. The
operator's decision is that whitelisting OpsLog beats an updater that
leaves people with no running program, and the changelog says so.

HideWindow stays on the PowerShell and is not the bug that made the
updated OpsLog invisible: it hides the helper's console, which is the
point, while Start-Process shows the new window normally.

relaunchCmd and its detachment stay for RestartApp, the database-switch
relaunch, which has never been reported broken.

Two tests kept honest: the update path must contain Wait-Process and
Start-Process and must not spawn the exe directly again, and
TestEveryRelaunchPassesItsPid had quietly stopped matching anything when
the spawn sites changed spelling — its pattern now covers relaunchCmd
too, so it guards RestartApp instead of passing vacuously.
This commit is contained in:
2026-09-11 08:57:11 +02:00
parent ac2067dd58
commit 97cc446c15
4 changed files with 67 additions and 50 deletions
+2 -2
View File
@@ -2,10 +2,10 @@
{
"version": "0.27.25",
"en": [
"Two more pieces of the old relaunch are back, for the operators still losing OpsLog after an update: it is started detached, and a breath is taken after the previous instance has actually gone."
"The relaunch after an update goes back to the helper that waited for OpsLog to close before starting the new version. Two rewrites tried to do without it and both left some operators with no window. Windows Defender may flag it — allow OpsLog in Defender if it does."
],
"fr": [
"Deux éléments de plus de lancienne relance sont rétablis, pour les opérateurs qui perdent encore OpsLog après une mise à jour : il est démarré détaché, et une pause est prise après la disparition effective de linstance précédente."
"La relance après une mise à jour revient à lassistant qui attendait la fermeture dOpsLog avant de démarrer la nouvelle version. Deux réécritures ont essayé de sen passer et laissaient certains opérateurs sans fenêtre. Windows Defender peut le signaler — dans ce cas, autorisez OpsLog dans Defender."
]
},
{