Old 9th August 2005, 04:44   #1
Junior Member
Join Date: Aug 2005
Posts: 3
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_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
Pop $R0

Pop $R1

Page instfiles
# 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

XeoNoX is offline   Reply With Quote
Old 9th August 2005, 08:34   #2
Forum King
Yathosho's Avatar
Join Date: Jan 2002
Location: AT-DE
Posts: 3,368
you can add IfFileExists before creating a shortcut and skip this, if it exists already
Yathosho is offline   Reply With Quote
Old 10th August 2005, 02:09   #3
Junior Member
Join Date: Aug 2005
Posts: 3
so how should the code look?

IfFileExists $INSTDIR\XYZ.exe 0 +2

then what???
XeoNoX 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