Skip to content

Commit cb09afb

Browse files
committed
packaging/windows: fix un.SecRemoveUserData also showing on install Components page
NSIS dispatches install-vs-uninstall sections based on the `un.` prefix on the DISPLAY NAME (first arg to Section), not on the section ID. The `Section /o "Remove user data..." un.SecRemoveUserData` declaration put the prefix on the ID and left the name bare, so NSIS treated it as an installer section — the checkbox appeared on the install-time Components page where it had no business being. Worse, if a user had ticked it during install, the section body (SetShellVarContext current + RMDir /r "$APPDATA\aMule") would have wiped user data while installing. Fix: move the `un.` prefix onto the display name. NSIS strips it from the rendered label, so the user still sees "Remove user data..." in the uninstaller's Components page, but the section is correctly classified as uninstaller-only. The MUI_DESCRIPTION_TEXT ${un.SecRemoveUserData} reference and the section's ID stay the same — only the first arg to Section moves.
1 parent 6cf207a commit cb09afb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packaging/windows/installer.nsi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,12 @@ SectionEnd
334334
; who installed; multi-user machines need each user to run the
335335
; uninstaller themselves to clean their own profile (unavoidable, no
336336
; way for an elevated process to enumerate every desktop session).
337-
Section /o "Remove user data (config, ED2K servers, Kad nodes, partfiles)" un.SecRemoveUserData
337+
; NSIS dispatch rule: the `un.` prefix on the DISPLAY NAME (first
338+
; arg) is what marks a Section as an uninstaller section — the ID
339+
; alone is not enough. NSIS strips `un.` from the rendered label, so
340+
; the user sees "Remove user data..." in the uninstaller's Components
341+
; page.
342+
Section /o "un.Remove user data (config, ED2K servers, Kad nodes, partfiles)" un.SecRemoveUserData
338343
SetShellVarContext current
339344
${If} ${FileExists} "$APPDATA\aMule"
340345
DetailPrint "Removing user data at $APPDATA\aMule..."

0 commit comments

Comments
 (0)