I've having problems trying to amend the Working Directory to be the $INSTDIR for the Start Menu Shortcuts I create.
I'm using SetOutPath $INSTDIR successfully for the Desktop Shortcut I create ok, but for the Start Menu Short Cuts the Installer either:
a) fails to create the Shortcut (if I remove the SetOutPath command from the CREATE_SMGROUP_SHORTCUT macro, or change it to $INSTDIR), or
b) sets the working directory to be the Start Menu Group rather than the INSTDIR (if I leave the SetOutPath $SMPROGRAMS\$StartMenuGroup alone)
Here are the relevant sections of my script:
SetOutPath $INSTDIRBy the way, the macro was generated by the EclipseNSIS wizard.
CreateShortcut "$DESKTOP\Program1.lnk" $INSTDIR\Program1.exe
!insertmacro CREATE_SMGROUP_SHORTCUT "Program 1" $INSTDIR\Program 1.exe
!insertmacro CREATE_SMGROUP_SHORTCUT "Program 2" $INSTDIR\Program 2.exe
!insertmacro CREATE_SMGROUP_SHORTCUT "Program 3" $INSTDIR\Program 3.exe
...
!macro CREATE_SMGROUP_SHORTCUT NAME PATH
Push "${NAME}"
Push "${PATH}"
Call CreateSMGroupShortcut
!macroend
...
Function CreateSMGroupShortcut
Exch $R0 ;PATH
Exch
Exch $R1 ;NAME
Push $R2
StrCpy $R2 $StartMenuGroup 1
StrCmp $R2 ">" no_smgroup
#SetOutPath $SMPROGRAMS\$StartMenuGroup *** SEEMS TO BE THE PROBLEM - BUT WHAT TO SET TO? ***
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$R1.lnk" $R0
no_smgroup:
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
I'd be grateful for suggestions.
Thanks.