Archive: parameter


parameter
Ok I am trying to make a short cut. I can pass any shortcut parameter with a + or - in front of it but I cannot have any spaces with the parameter.

Ie:

CreateShortCut "$DESKTOP\BF2C.lnk" "$INSTDIR\..\..BF2.exe" +modPath mods/BF2C "$INSTDIR\BF2C.ico"
does not compile

but
CreateShortCut "$DESKTOP\BF2C.lnk" "$INSTDIR\..\..BF2.exe" +fullscreen +menu +modpath "$INSTDIR\BF2C.ico"
works just fine.

Anyway to add in the mods/BF2C section? Is the a character to add for spaces like a % or something?

Thanks for any help.

use quotes


Put quotes around +fullscreen +menu +modpath

-Stu


lol I knew it would be something simple (and make me look dumb).

Thanks for your help.


Ok another related question. I can create the link the target and parameters work but it needs the correct "Start in" to be different from the $INSTDIR. Is there a way to do that?

The other option was to have a lnk file in the installer copy to the $DESKTOP the shortcut works but it doesnt use the ico file.

Thanks again for any help.


SetOutPath sets the "Start in" directory for shortcuts.


Got around to another version and a time to fix this bug. The problem I am getting is that I still cant set a proper "Starts In" path.


SetOutPath "$INSTDIR\..\..\"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\BF2C.lnk" "$INSTDIR\..\..\BF2.exe" "+menu 1 +fullscreen 1 +modPath mods/BF2C" "$INSTDIR\BF2C.ico"
CreateShortCut "$DESKTOP\BF2C.lnk" "$INSTDIR\..\..\BF2.exe" "+menu 1 +fullscreen 1 +modPath mods/BF2C" "$INSTDIR\BF2C.ico"


This will give me
Starts In:
"C:\Program Files\EA GAMES\Battlefield 2\mods\BF2C\..\.."

Any way to fix this?

Thanks.

I used something like this (long ago :) )


SetOutPath "$INSTDIR"
SetOutPath ".."
SetOutPath ".."

na that doesnt work either. It just makes the "Starts In" just ".."

Thanks for helping though.


wiki page Repair path names with ../


that completely lost me :(. Sorry, Is there one in english?


StrCpy $INSTDIR $EXEDIR
DetailPrint $INSTDIR # C:\Program Files\NSIS\Projects\Testing
GetFullPathName $R0 "$INSTDIR\..\.."
DetailPrint $R0 # C:\Program Files\NSIS
SetOutPath $R0

-Stu