Skip to content

Commit 333a45d

Browse files
timfishdevelar
authored andcommitted
fix(nsis): correctly remove shortcut and only remove directory if its empty
Close #2381
1 parent 99c1025 commit 333a45d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/electron-builder-lib/templates/nsis/uninstaller.nsh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ Section "un.install"
3838
!ifndef DO_NOT_CREATE_START_MENU_SHORTCUT
3939
WinShell::UninstShortcut "$oldStartMenuLink"
4040

41+
Delete "$oldStartMenuLink"
4142
ReadRegStr $R1 SHELL_CONTEXT "${INSTALL_REGISTRY_KEY}" MenuDirectory
42-
${if} $R1 == ""
43-
Delete "$oldStartMenuLink"
44-
${else}
45-
RMDir /r "$SMPROGRAMS\$R1"
43+
${ifNot} $R1 == ""
44+
RMDir "$SMPROGRAMS\$R1"
4645
${endIf}
4746
!endif
4847
${endIf}

0 commit comments

Comments
 (0)