Archive: CreateShortCut issue


CreateShortCut issue
Hey, I'm having a bit of a hard time using CreateShortcut with an app of mine. Basically, I'm installing a set of programs, each with their own folder, and each of those folders will be in a main folder(which will, in turn, be in the program files folder). Basically, an example of this would be:

C:\Program Files\AllGames\GameSet1\GameA
C:\Program Files\AllGames\GameSet1\GameB
C:\Program Files\AllGames\GameSet2\...
and so on.

What I'm doing here is that I'm giving the user the default path of installing to:
C:\Program Files\AllGames\GameSet1
(since other sets will be handled by other installers),
and here, two separate subfolders will be placed in GameSet1, aptly named GameA and GameB. $INSTDIR has been set to this path.

The problem I'm having is with the Start In not matching up with the folder in the target. One of the games I'm installing is very particular about the way the shortcut defines where the .exe is and where it's supposed to look(otherwise it doesn't work). We have a 3rd-party system that wrapped our software with some special stuff, so it makes things a little hairy(though I know it's not the cause of the problem). Basically, what's happening is that the 3rd-party's page loads, so it's finding the .exe through some special windows trick or another, but the actual game won't load since the .exe isn't found in the start in folder.

The .exe is in
C:\Program Files\MyGames\GameSet1\GameA\, and the start in folder is:

C:\Program Files\MyGames\

How do I make these two match? I'm already using:
CreateShortCut "$R5\$R1.lnk" "$INSTDIR\GameA\RocketBowl.exe" "" "$INSTDIR\GameA\RocketBowl.exe", where $R5 is the desktop path, $R1 is the text caption for the icon.

This issue applies to the start menu shortcuts, too.

Please help, so confused :(


SetOutPath sets the working directory of the shortcut.


So I just do something like:
SetOutPath "C:\Program...<exe target>", and then do the CreateShortCut?


Yes, you use SetOutPath with the desired working directory and then CreateShortcut.


oh Thank God, I finally got it.

And thank you of course...I've been stuck on this for an embarrassing amount of time :)


Does it mention in the manual that SetOutPath sets current 'start in' path for CreateShortcut's?

-Stu


Yes.

From the Docs:

$OUTDIR is used for the working directory. You can change it by using SetOutPath before creating the Shortcut.

Whoops, wrong topic!