Archive: Need Help, all i want is a shortcut on startmenu


Need Help, all i want is a shortcut on startmenu
Im doing this the cheezy way because im new to this whole installer thing, so im using the ZIP to EXE installer program.

I have the following line of code in the /contrib/zip2exe/modern.nsh file, and its making shortcuts but it is installing twice and i end up with 2 shortcuts, what am i doing wrong all i want is the shortcut to go in C:\Documents and Settings\All Users\Start Menu\Programs\XYZ\xyz.lnk
and maybe one on the desktop if its not too complicated.

can someone help me witht the right code?

---------------------------------------------------------
;Change this file to customize zip2exe generated installers with a modern interface

!include "MUI.nsh"

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Page custom StartMenuGroupSelect "" ": Start Menu Folder"
Function StartMenuGroupSelect
Push $R1

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

StrCmp $R1 "success" success
StrCmp $R1 "cancel" done
; error
MessageBox MB_OK $R1
Return
success:
Pop $R0

done:
Pop $R1
FunctionEnd

Page instfiles
Section
# this part is only necessary if you used /checknoshortcuts
StrCpy $R1 $R0 1
StrCmp $R1 ">" skip

SetShellVarContext All
CreateDirectory $SMPROGRAMS\$R0
CreateShortCut "$SMPROGRAMS\$R0\All users XYZ.lnk" $INSTDIR\XYZ.exe

skip:
SectionEnd


you can add IfFileExists before creating a shortcut and skip this, if it exists already


so how should the code look?


IfFileExists $INSTDIR\XYZ.exe 0 +2


then what???