Compare commits

...

5 commits

Author SHA1 Message Date
Lukas Brübach
43c6ec973c [Installer] Test the error flag with LogicLib's ${Errors} condition
makensis rejected the script with "macro _If requires 4 parameter(s), passed
2" at the ClearErrors/OpenProcess pair. A ${If} condition cannot be a bare
$Var: LogicLib needs either a comparison or one of its flag macros, and a lone
$Errors splits into too few arguments for _If. ${Errors} is the documented flag
condition and is the same mechanism as the ${Silent} test already used here.

The dump step earned its keep - this took one run to locate rather than another
round of guessing.
2026-10-02 04:36:23 +02:00
Lukas Brübach
4c911df257 [CI] Run the NSIS log dump under bash
The dump step used the default pwsh shell, where `find` resolves to Windows'
text-search find.exe rather than a file finder, so it died with "FIND:
Parameter format not correct" instead of printing anything. Pin shell: bash.
2026-10-02 03:24:21 +02:00
Lukas Brübach
a041d8c0c3 [CI] Dump the NSIS compile log when packaging fails
CPack reports a failed makensis run as "Problem running NSIS command" plus a
path to NSISOutput.log, and that log exists only on the runner, so the actual
compile error never reaches the workflow output. An installer script that does
not compile is therefore undiagnosable from CI alone, which is exactly how a
three-argument FindFirst cost two build cycles here.
2026-10-02 02:40:32 +02:00
Lukas Brübach
397ef4c010 [Installer] Give FindFirst the two arguments it takes
FindFirst takes the pattern and the output variable and leaves the search
handle in $0. There is no handle argument, and FindNext taking only a variable
is the giveaway: the handle has to live somewhere implicit, and it is $0.

The call passed three arguments, so makensis rejected the script and the CPack
packaging step failed with "Problem running NSIS command" before ever reaching
the required-runtime check.

This was not only a compile error. The handle variable was never populated, so
the stale-runtime check that commit 844a1a9b added could never see a match: it
probed $StaleFindHandle, which stayed empty, and the widened wildcard scan over
the purge set was a no-op. Pass the pattern, test $0, and close $0. No FindNext
is needed, because $R0 is a yes/no flag rather than a list.

Drops the now unused StaleFindHandle Var.
2026-10-02 02:40:12 +02:00
Lukas Brübach
24c3079a29 [Installer] Close the /? help string so the installer compiles again
The last line of the continued MessageBox string ended in $\n\" instead of $\n".
NSIS reads \" as an escaped quote, so the string never terminated and makensis
rejected the script, which took the CPack packaging step down with it. The
Windows build failed on "Problem running NSIS command" before ever reaching the
new required-runtime check.
2026-10-02 01:32:25 +02:00
2 changed files with 24 additions and 8 deletions

View file

@ -458,6 +458,17 @@ jobs:
VCPKG_FEATURE_FLAGS: dependencygraph
run: .ci/compile.sh --server --test --vcpkg
# CPack reports a failed makensis run as "Problem running NSIS command"
# plus a path to NSISOutput.log, and that log lives only on the runner, so
# the actual compile error is otherwise nowhere in the workflow output.
# Dump it, or a broken installer script is undiagnosable from CI alone.
# shell: bash matters here - the default pwsh resolves `find` to Windows'
# text-search find.exe, which errors instead of searching.
- name: "Dump NSIS compile log"
if: failure() && matrix.os == 'Windows'
shell: bash
run: find . -name NSISOutput.log -exec cat {} +
# Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342
- name: "[macOS] Delete remote compiler cache (ccache)"
if: matrix.os == 'macOS' && matrix.use_ccache == 1 && github.ref == 'refs/heads/master' && steps.restore_ccache.outputs.cache-hit

View file

@ -15,7 +15,6 @@ Var ReinstallMode
Var AllowForceClose
Var GuardDir
Var OldUninstallString
Var StaleFindHandle
Var StaleFindName
Var IsUpgrade
Var AbortReason
@ -95,7 +94,7 @@ ${IfNot} ${Errors}
/S : Silent install$\n\
/R : Silent upgrade$\n\
/PID=%pid% : Process to wait for before replacing files (used by the in-app updater)$\n\
/D=%directory% : Specify destination directory$\n\"
/D=%directory% : Specify destination directory$\n"
Quit
${EndIf}
@ -519,9 +518,9 @@ Function WaitForLauncherToExit
; do with the upgrade.
ClearErrors
System::Call 'kernel32::OpenProcess(i 0x00100000, i 0, i $WaitPid) p.r0'
${If} $Errors
; The launcher is gone - OpenProcess cannot open a dead process - which is
; exactly the state the wait was for.
${If} ${Errors}
; The launcher is gone - OpenProcess cannot open a dead process - which is
; exactly the state the wait was for.
DetailPrint "The application that started this installer has already exited."
StrCpy $LauncherExited 1
Return
@ -686,10 +685,16 @@ Function CheckStaleRuntimeMask
${If} $R0 = 1
Return
${EndIf}
FindFirst $StaleFindHandle $StaleFindName "$INSTDIR\$R3"
${If} $StaleFindHandle != ""
; FindFirst takes the pattern and the name variable only, and leaves the
; search handle in $0 - there is no handle argument and no handle variable
; to keep, which is why FindNext does not take one either. $R3 and $R0 are
; untouched by it, so only $0 is consumed here.
; One match is enough: $R0 is a yes/no flag, not a list, so there is no
; FindNext and nothing to iterate.
FindFirst "$INSTDIR\$R3" $StaleFindName
${If} $0 != ""
StrCpy $R0 1
FindClose $StaleFindHandle
FindClose $0
${EndIf}
FunctionEnd