From a7167def2397caac0c004c12fd20d675bbcc4d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Fri, 12 Jun 2026 15:19:49 +0200 Subject: [PATCH] Another go. Took 4 minutes --- cmake/NSIS.template.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index 7b52b7bcc..68af2da16 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -112,6 +112,18 @@ ${Else} StrCpy $ReinstallMode 0 ${EndIf} +; When launched with /R by the client, explicitly parse /D= from the raw +; parameter string. Qt's QProcess::startDetached with a pre-formed command +; string does not guarantee the NSIS stub's built-in /D= handler sees the +; value, so we extract it ourselves here where GetOptions is reliable. +${If} $ReinstallMode = 1 + ClearErrors + ${GetOptions} $9 "/D=" $R1 + ${IfNot} ${Errors} + StrCpy $InstDir $R1 + ${EndIf} +${EndIf} + ${If} $InstDir == "" ; User did not use /D to specify a directory, ; we need to set a default based on the install mode