vun
17th September 2004 05:20 UTC
2 SetOutPath?
Hi I am having a problem with my desktop shortcut. I want my shortcut to run a batch file that is stored in the bin folder of my main application folder. I have set my $INSTDIR to be "C:\foldername" and this is also apparently the "Start In" of my shortcut. I want the "start in" to be something like "C:\foldername\bin". I was wondering if it is possible to have 2 SetOutPath to solve my problem. I have already tried it but the compiler says I did not reference my variable and I am wasting memory. For a better understanding of my problem, I have attaced my code below. I apologise if this is a repeated thread but I do not understand what the other threads mean. Thanks!
vun
17th September 2004 05:23 UTC
Sorry I forgot to attach my script. Here it is.
kobus
17th September 2004 08:28 UTC
Hi,
I am not sure I well understand your problem, but maybe you can do it like that.
CreateShortCut "$DESKTOP\SMSCenter.lnk" "$INSTDIR\bin\startup.bat"
kobus
vun
17th September 2004 08:44 UTC
Hey kobus, thanks for your reply. I really appreciate it. However, I've already done what you asked me to do but each time i tried to run my application from the shortcut, the "Start In" would only have "C:\projects" which is my $INSTDIR. It dosent seem to read anything after my $INSTDIR.
Eg: CreateShortCut "$DESKTOP\SMSCenter.lnk" "$INSTDIR\SMSCenter\bin\startup.bat"
It will not register "SMSCenter\bin\". It only recognises $INSTDIR and only registers that as my "Start In". I need my Start In to be in the bin folder because that's where my batch file is located. I hope this is clearer now :).
kobus
17th September 2004 10:33 UTC
Ok, now it's clear, what is going on :)
Documentation says:
4.9.3.4 CreateShortCut
... $OUTDIR is used for the working directory. You can change it by using SetOutPath before creating the Shortcut. ...
so maybe it will works
SetOutPath "x:\blabla\bin" ; directory needed for shortcut working dir
CreateShortCut .....
SetOutPath "c:\projects" ; original Install directory
Kobus
vun
17th September 2004 11:53 UTC
Hey kobus, thanks for the solution. My installer works fine now. I read that part of the documentation but I didnt really understand it. I really appreciate your quick responses and your help.
Thanks!!