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

Hi
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

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
Return
success:
Pop $R0

done:
Pop $R1
FunctionEnd
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"

skip:
SectionEnd



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

i tried

code:
Delete "$SMPROGRAMS\$R0\MP3_Dowmloader.lnk"
Delete "$SMPROGRAMS\$R0\MP3 Updater.lnk"
RMDir "$SMPROGRAMS\$R0"



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