Old 27th March 2007, 22:21   #1
MajinSephiroth
Junior Member
 
Join Date: Mar 2007
Posts: 6
Start Menu Shortcut

I'm having a problem with this but I cannot seem to find the solution. When I check the start menu .lnk file I can see that the target specified is correct, but not the "Start in" part.

What happens:

Target - "C:\Program Files\myCompany\gameFolder\myGame.exe"
Start in - "C:\Program Files\myCompany\"

What I need it to do:

Target - "C:\Program Files\myCompany\gameFolder\myGame.exe"
Start in - "C:\Program Files\myCompany\gameFolder\"

I'm assuming it's a parameter in the CreateShortCut command for NSIS, unfortunately I can't seem to find which one.

Currently I'm using a CreateShortCut like this:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\myGame.lnk" "$INSTDIR\gameFolder\myGame.exe"
MajinSephiroth is offline   Reply With Quote
Old 27th March 2007, 22:27   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use SetOutPath to set the working directory before using CreateShortcut. The working directory is used for the "start in" directory of the shortcut.

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 27th March 2007, 22:34   #3
MajinSephiroth
Junior Member
 
Join Date: Mar 2007
Posts: 6
Thought about that and tried that, but here's the funny part. It ended up creating "another" gameFolder. So now the directory structure is: "\myCompany\gameFolder\gameFolder\"

When I am choosing which file to compile in the installer I am using:

File /r "gameFolder"
MajinSephiroth is offline   Reply With Quote
Old 27th March 2007, 22:38   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Then you haven't used SetOutPath correctly. Use it on the exact absolute path where you want "Start in" to be. Usually, it'd just be $INSTDIR.

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 27th March 2007, 22:43   #5
MajinSephiroth
Junior Member
 
Join Date: Mar 2007
Posts: 6
I had it as:

SetOutPath "$INSTDIR\gameFolder"

when it added that extra folder in the directory structure, but I do have the setoutpath right before my file command. Is that why?

Should I put the SetOutPath after the File?
MajinSephiroth is offline   Reply With Quote
Old 27th March 2007, 22:50   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use File /r "gameFolder\*.*" instead and it'll extract all the files in gameFolder and won't create the folder itself. The folder is already created by your new SetOutPath command.

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 28th March 2007, 06:29   #7
MajinSephiroth
Junior Member
 
Join Date: Mar 2007
Posts: 6
Oh I see, thanks a lot. That helped.
MajinSephiroth 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