From 976348857772c2fd9657d3eca07fbcddd20f382a Mon Sep 17 00:00:00 2001 From: RedBlackAka <140876408+RedBlackAka@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:00:00 +0200 Subject: [PATCH] installer: Clean up Windows Start Menu entry * Clean up Windows Start Menu entry * Clean up old Start Menu shortcuts when upgrading --- src/installer/citra.nsi | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/installer/citra.nsi b/src/installer/citra.nsi index 38be13b62..ced187279 100644 --- a/src/installer/citra.nsi +++ b/src/installer/citra.nsi @@ -160,9 +160,10 @@ Section "Base" !insertmacro UPDATE_DISPLAYNAME ; Create start menu and desktop shortcuts - ; This needs to be done after azahar.exe is copied - CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$DisplayName.lnk" "$INSTDIR\azahar.exe" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\$DisplayName.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall $DisplayName.lnk" + RMDir "$SMPROGRAMS\${PRODUCT_NAME}" + CreateShortCut "$SMPROGRAMS\$DisplayName.lnk" "$INSTDIR\azahar.exe" ${If} $DesktopShortcut == 1 CreateShortCut "$DESKTOP\$DisplayName.lnk" "$INSTDIR\azahar.exe" ${EndIf} @@ -171,11 +172,6 @@ Section "Base" SetOutPath "$TEMP" SectionEnd -Section -AdditionalIcons - ; Create start menu shortcut for the uninstaller - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall $DisplayName.lnk" "$INSTDIR\uninst.exe" "/$MultiUser.InstallMode" -SectionEnd - !include "FileFunc.nsh" Section -Post @@ -200,10 +196,11 @@ SectionEnd Section Uninstall !insertmacro UPDATE_DISPLAYNAME - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall $DisplayName.lnk" - Delete "$DESKTOP\$DisplayName.lnk" + Delete "$SMPROGRAMS\$DisplayName.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\$DisplayName.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall $DisplayName.lnk" RMDir "$SMPROGRAMS\${PRODUCT_NAME}" ; Be a bit careful to not delete files a user may have put into the install directory.