Old 4th December 2021, 13:43   #1
Junior Member
Join Date: Dec 2021
Posts: 1
Uninstall Start menu shortcut

Env Win 7 Nsis 3.08
I'm new about nsis.. i just succesfully create some simple NSIS scrpt to install my programs
The question is about start menu shortcut unistalling
i succesfully write code to let to installer to choose start menu folder
i put here the interested code

XPStyle on
Page custom StartMenuGroupSelect "" ": Start Menu Folder"
UninstPage uninstConfirm
UninstPage instfiles

Function StartMenuGroupSelect
Push $R1

StartMenu::Select /checknoshortcuts "Don't create a start menu folder" /autoadd /lastused $R0 "MP3 Downloader"
Pop $R1

StrCmp $R1 "success" success
StrCmp $R1 "cancel" done
; error
MessageBox MB_OK $R1
StrCpy $R0 "MP3 Downloader" # use default
Pop $R0

Pop $R1
Section "Start Menu Shortcuts"
# this part is only necessary if you used /checknoshortcuts
StrCpy $R1 $R0 1
StrCmp $R1 ">" skip

CreateDirectory $SMPROGRAMS\$R0
CreateShortcut $SMPROGRAMS\$R0\MP3_Dowmloader.lnk $INSTDIR\MP3_Downloader.bat
CreateShortcut "$SMPROGRAMS\$R0\MP3 Updater.lnk" "$INSTDIR\Updater.bat"


the question is how to reference the directory $SMPROGRAMS\$R0
in the unistallal section ?

i tried

Delete "$SMPROGRAMS\$R0\MP3_Dowmloader.lnk"
Delete "$SMPROGRAMS\$R0\MP3 Updater.lnk"

but it does not function ..
i'm not using the modern interface..and if possible i do not want to use it..
Thanks in advance for the support
MB1 is offline   Reply With Quote
Old 4th December 2021, 16:24   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
Classic NSIS does not write anything anywhere automatically, you need to save the folder name in the installer. You can save it in a .ini file or in the registry. Restore the variable in your uninstaller.

Ideally you should just have a single shortcut in $SMPROGRAMS. The Microsoft guidelines say you should not create shortcuts to updaters/uninstallers/help etc.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump