Old 22nd September 2006, 20:44   #1
2biased
Junior Member
 
Join Date: Sep 2006
Posts: 2
Start menu entries not created

Hi,

by reading through the forum and the docs the Start Menu entry topic should be a easy thing but unfortunately I am not able to make it work for me. I try to create 3 sub folders in the start menu like

$SMPROGRAMS\A Folder\B Folder\C Folder

and within the C Folder 4 items

StartApp -> goes to the exe
ShowReadme -> points to a text file
OpenManual -> points to a pdf file
Uninstall -> points to the uninstaller

The code for this looks like the following:

code:

Section "ToStartMenu"

; Install for all users if uncommented
; SetShellVarContext current

IfFileExists "$SMPROGRAMS\A Folder\*.*" +2 0
CreateDirectory "$SMPROGRAMS\A Folder"
IfFileExists "$SMPROGRAMS\A Folder\B Folder\*.*" +2 0
CreateDirectory "$SMPROGRAMS\A Folder\B Folder"
IfFileExists "$SMPROGRAMS\A Folder\B Folder\C Folder\*.*" +2 0
CreateDirectory "$SMPROGRAMS\A Folder\B Folder\C Folder"
CreateShortCut "$SMPROGRAMS\A Folder\B Folder\C Folder\StartApp.lnk" "$INSTDIR\StartApp.exe"
CreateShortCut "$SMPROGRAMS\A Folder\B Folder\C Folder\ReadMe.lnk" "$INSTDIR\TheRealReadme.txt"
CreateShortCut "$SMPROGRAMS\$SMPROGRAMS\A Folder\B Folder\C Folder\Manual.lnk" "$INSTDIR\User Manual.pdf"
CreateShortCut "$SMPROGRAMS\A Folder\B Folder\C Folder\Uninstall.lnk" "$INSTDIR\Uninst.exe"

; back to current user if uncommented
; SetShellVarContext current

SectionEnd



The folders are created without problems but the installer claims to have problems to create the actual shortcuts. No matter if I try to install them into the user space or for all user using the SetShellVarContext commented out in this example.

As I said, I didn't find a solution to the problem in the manual or the forum and I am pretty new to NSIS so I hope someone can give me a small hint what I do wrong.

Thanks in advance.
2biased is offline   Reply With Quote
Old 22nd September 2006, 20:46   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
There's no need for all of those IfFileExists calls. CreateDirectory will create the directory and any missing parent directories and will simply continue if the directory already exists.

I can't tell why the shortcuts are not being created from the example you gave, aside from that double $SMPROGRAMS typo. Make sure you're using the exact same path for CreateDirectory and CreateShortcut. If that doesn't work, attach a real example.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 22nd September 2006, 22:41   #3
2biased
Junior Member
 
Join Date: Sep 2006
Posts: 2
Thanks for the hint with the typo. In the actual code it wasn't this typo but I had an error with the paths I just didn't see. Sorry for the hassle thought but thanks a lot for the help. Really apreciate it.
2biased is offline   Reply With Quote
Reply
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