Old 20th July 2004, 22:59   #1
augy
Junior Member
 
Join Date: Jul 2004
Posts: 2
http/1.1 400 bad request with NSISdl

I get the "http/1.1 400 bad request" error string whenever I try a particular download:

NSISdl::download "http://www.domainprotected.net/$CurInstallClient_Update/eCM for $CurInstall.exe" "$Path\$CurInstall\eCM for $CurInstall.exe"

as you may have guessed, $CurInstall and $Path are both user variables. I've checked the strings with messageboxes already--they expand out properly at runtime. It's particularly difficult to figure out the problem because I do another download right after this one:

NSISdl::download "http://www.domainprotected.net/$CurInstallClient_Update/reg/UpdatedRegistryFile.reg" $Path\UpdatedRegistryFile.reg

and it also expands out just fine with messagebox AND it downloads correctly.

Please note that I don't actually receive any error message popup; I only get the message if I pop it off the stack and messagebox it. I would assume that the error message it trying to tell me that the file is nonexistent, but I've checked the path over and over and over again (it's been about a week, and the boss is getting irritated =D) to no avail. The program seems to just skip over it; it blips the downloading dialog and then moves on to the next download.
Oh, and this isn't an installer per se; it's actually an updater for a program installed with NSIS, so there's no $INSTDIR or anything; however, $Path contains the path to the installation directory, pulled out of the registry.

So, any ideas?


Thanks alot,

augy
augy is offline   Reply With Quote
Old 21st July 2004, 10:40   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Remember that $CurInstallClient_Update is considerated one variable, so the value of $CurInstall is ignored. To solve this you need to use a common (or constant) variable (like $0), put the variable you want in it and concatenate the string into it. Like this below:

code:
StrCpy $0 $CurInstall
StrCpy $0 $0Client_Update
NSISdl::download "http://www.domainprotected.net/$0/eCM for $CurInstall.exe" "$Path\$CurInstall\eCM for $CurInstall.exe"



Which means one more thing to go to the documentation:

"When you concatenate user variables with strings and there is no separation by a space, you need to use a common variable like $0, set the value of this constant variable with the user variable's, then you concatenate with a string and use it."

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 21st July 2004, 22:28   #3
augy
Junior Member
 
Join Date: Jul 2004
Posts: 2
"Remember that $CurInstallClient_Update is considerated one variable, so the value of $CurInstall is ignored"

Well, this isn't true--When I messagebox, the string looks fine, and the second NSISdl::download I have listed works just fine, and it uses the user variables in the same way. Is there anything else that may be causing it?


augy
augy is offline   Reply With Quote
Old 22nd July 2004, 01:56   #4
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
Perhaps its the spaces in "http://www.domainprotected.net/$CurInstallClient_Update/eCM for $CurInstall.exe" or the spaces in "$Path\$CurInstall\eCM for $CurInstall.exe"?

Did you try:
"http://www.domainprotected.net/$CurInstallClient_Update/eCM%20for%20$CurInstall.exe"
or '"$Path\$CurInstall\eCM for $CurInstall.exe"' or a combination of the two?

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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