Skip to content
⌘ NSIS Forum Archive

Start Menu Shortcut

7 posts

MajinSephiroth#

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"
kichik#
Use SetOutPath to set the working directory before using CreateShortcut. The working directory is used for the "start in" directory of the shortcut.
MajinSephiroth#
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"
kichik#
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.
MajinSephiroth#
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?
kichik#
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.