Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 8th June 2002, 11:19   #1
veekee
Senior Member
 
Join Date: Mar 2002
Location: France / Paris
Posts: 138
Question CreateShortCut adds drive letter ???

Hi,

Someone asks me in a french nsis forum about a problem with the CreateShortCut function ! I asked him to llokup in the doc but i found his problem quite stange !
He wanted to use parameters in the shortcup, and use the direct method :
CreateShortCut "$INSTDIR\Play HLP.lnk" "'$INSTDIR\halflife.exe' -console -dev -game Hl-Parpaing"



I know that this is not the wrong way to use that function, but if this is executed by NSIS, the shortcut links to : "C:\'E:\HalfLife\halflife.exe' -console -dev -game Hl-Parpaing"

C:/ was added at the begining ? Does anyone knows why ?
veekee is offline   Reply With Quote
Old 8th June 2002, 11:47   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Quote:
I know that this is not the wrong way to use that function, but if this is executed by NSIS, the shortcut links to : "C:\'E:\HalfLife\halflife.exe' -console -dev -game Hl-Parpaing"
As a matter of fact, it IS the wrong way of using this function. The parameters should come in a seperate string. And it does show in the docs:

Quote:
CreateShortCut link.lnk target.file [parameters] [icon.file] [icon_index_number] [start_options] [keyboard_shortcut]

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is online now   Reply With Quote
Old 8th June 2002, 11:57   #3
veekee
Senior Member
 
Join Date: Mar 2002
Location: France / Paris
Posts: 138
Sur, this is in the doc ... the fact is : is there a logical reason that NSIS links to "C:\'E:\HalfLife\halflife.exe' -console -dev -game Hl-Parpaing" instead of "'E:\HalfLife\halflife.exe' -console -dev -game Hl-Parpaing" ?
veekee is offline   Reply With Quote
Old 8th June 2002, 12:09   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
The reason there are two strings is that this is the way Windows does it. The Windows function that creates the shortcut gets two parameters, one for the path and one for the shortcut parameters.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is online now   Reply With Quote
Old 8th June 2002, 12:33   #5
veekee
Senior Member
 
Join Date: Mar 2002
Location: France / Paris
Posts: 138
but why, when using one parameter (intead of the two required), is there a c:\ that appears ?
veekee is offline   Reply With Quote
Old 8th June 2002, 13:23   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Because it does not know a drive marked with a ", so it adds the default drive letter. This is what Windows does, NSIS has nothing to do with it.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is online now   Reply With Quote
Old 8th June 2002, 13:30   #7
veekee
Senior Member
 
Join Date: Mar 2002
Location: France / Paris
Posts: 138
aarg, so simple ! Thanks a lot kichik : you were very patient ( <- me ) !
veekee is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump