Archive: Matching Start In folder with Target


Matching Start In folder with Target
Hey, I'm a bit of a newbie here, so I hope I won't get flamed too badly for asking this question here :)

Ok, I'm trying to install two applications with a single installer. I want them to have the same root folder $INSTDIR(C:\Program Files\My Game Bundle), where Game1 would be

$INSTDIR\Game1
and Game2 would be
$INSTDIR\Game2

The game files for each game would be in their respective directories, with the uninstaller lying in the top level folder($INSTDIR). While I can get the files copied to the correct location, the problem I'm having is with the shortcuts. With windows shortcuts, you have a "Target" path which links directly to the executable. The "Start In" shortcut links to the top level folder, $INSTDIR. This doesn't work out correctly with Game1, which needs to point directly at the folder in which the exe is located(it has to do with the way the game engine looks for files). How do I make the "Start In" folder point at the same folder the "Target" path is at?

Yes, I did try searching for this too...but otherwise, have mercy :)


Use SetOutPath first.

E.g.
SetOutPath "C:\blah"
CreateShortcut "$SMPROGRAMS\blah.lnk" "C:\blah\blah2k.exe"

-Stu


Well, I'm using SetOutPath to copy all the files and what not, and I install all of the files before creating the shortcut. Now the shortcut finds the exe just fine. The problem is though with the way the game engine is, we need both the "start in" path to directly match the target path. Not to question your wisdom, but I don't know if what you mentioned will be enough.. :)

(What you have written is pretty much how my Shortcut is made, with the exception that I'm doing the SetOutPath a few lines earlier in the script. I don't think that should make a difference though.)


So basically you want your shortcut to target C:\blah\blah.exe and to start in C:\blah\blah.exe?

Try to use:
SetOutPath "C:\blah\blah.exe"

Be warned though that NSIS will create a folder called "C:\blah\blah.exe" :D

-Stu