From 97e85651382d302c152cc601acfafd80d846e0e5 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Sun, 27 Sep 2026 13:52:42 +0800 Subject: [PATCH] fix(desktop): emit per-pass NSIS RemovePathSegment variant electron-builder compiles installer.nsh twice (installer pass and BUILD_UNINSTALLER pass) and elevates makensis warnings to errors. The installer pass emitted both RemovePathSegment variants but only references the non-un. one (and vice versa), so the unreferenced variant failed the build with warning 6010. Emit only the variant each pass references. This is the root cause of the desktop-build.yml failures on dev. --- packages/desktop/resources/installer.nsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/desktop/resources/installer.nsh b/packages/desktop/resources/installer.nsh index 673a25e19..d366fdfbb 100644 --- a/packages/desktop/resources/installer.nsh +++ b/packages/desktop/resources/installer.nsh @@ -56,8 +56,15 @@ done: Push $R8 ; return the cleaned path FunctionEnd !macroend -!insertmacro RemovePathSegment "" -!insertmacro RemovePathSegment "un." +; electron-builder compiles this include twice (installer pass + BUILD_UNINSTALLER +; pass) and treats makensis warnings as errors. Each pass references only its own +; function variant, so emit just that one — an unreferenced variant fails the +; build with warning 6010. +!ifdef BUILD_UNINSTALLER + !insertmacro RemovePathSegment "un." +!else + !insertmacro RemovePathSegment "" +!endif !macro WriteUserPath ; $R0 = new user Path value. REG_EXPAND_SZ keeps %VAR% references expandable