Archive: Start Menu Shortcut


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"


Use SetOutPath to set the working directory before using CreateShortcut. The working directory is used for the "start in" directory of the shortcut.


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"


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.


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?


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.


Oh I see, thanks a lot. That helped.