From ade41b05cce4a555197116568664220c5b3be9fa Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 7 Oct 2026 13:48:28 +0200 Subject: fix(client): remove firewall rules and boot task on uninstall, unasked The Yes/No before it defaulted to No, so they stayed behind. Read both unelevated and raise the UAC prompt only when one is left. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-client/build/installer-light.nsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/meshbay-client/build/installer-light.nsh') diff --git a/packages/meshbay-client/build/installer-light.nsh b/packages/meshbay-client/build/installer-light.nsh index 86e41ba..7717331 100644 --- a/packages/meshbay-client/build/installer-light.nsh +++ b/packages/meshbay-client/build/installer-light.nsh @@ -53,15 +53,16 @@ !macroend !macro customUnInstall - ; Opt-in, default No -- a stale allow-rule is inert, so this should not - ; nag. A silent uninstall skips it entirely (no UAC prompt of its own). + ; Same as the full installer: the UAC prompt alone, no question before it, + ; and only when a rule is still there. A silent uninstall skips it (it may + ; not raise UI). ${IfNot} ${Silent} - MessageBox MB_YESNO|MB_ICONQUESTION \ - "Remove MeshBay Light's Windows Firewall rules? This needs one administrator confirmation. They are harmless if left." \ - /SD IDNO IDNO mb_keep_firewall + nsExec::Exec '"${MB_PWSH}" -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\resources\firewall.ps1" any' + Pop $R1 ; 0 = at least one rule exists + ${If} $R1 == 0 ExecShellWait "runas" "${MB_PWSH}" \ '-NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\resources\firewall.ps1" remove' \ SW_HIDE - mb_keep_firewall: + ${EndIf} ${EndIf} !macroend -- cgit v1.2.3