Old 19th June 2007, 08:25   #1
boomsurf
Junior Member
 
Join Date: Jun 2007
Posts: 2
NSISDL download problem

Hi all

I'm having an existing installer that downloads a file from an url (e.g. http://www.oldservername.com/file.zip).

nsisdl::download /TRANSLATE "${DOWNLOAD_DOWNLOADING}" "${DOWNLOAD_CONNECTING}" "${DOWNLOAD_SECOND}" "${DOWNLOAD_MINUTE}" "${DOWNLOAD_HOUR}" "${DOWNLOAD_SECONDS}" "${DOWNLOAD_MINUTES}" "${DOWNLOAD_HOURS}" "${DOWNLOAD_PROGRESS}" "${DOWNLOAD_REMAINING}" /TIMEOUT=30000 ${DOWNLOADBASE}/${LANGBASE}/file.zip $PLUGINSDIR/file.zip

Now the url was changed by the isp to e.g. http://www.newservername.com/file.zip. On the old page a simple redirect is done.

<http><head></head><body><meta http-equiv="refresh" content="0;URL=http://www.newservername.com/file.zip"><body>

This causes the installer to fail because it cannot download the file. I guess its because the server returns a 404. When I hit the old URL within IE it redirects to the new server and downloads the file.

Unfortunately I cannot redirect using a server side pearl script or modify the htaccess because I don't get the permission to do it.

I cannot change the installer everytime the url changes, so I'm looking for a solution.

Any help/hint is appreciated.

Thanks
boomsurf is offline   Reply With Quote
Old 19th June 2007, 09:02   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should store the URL in a text/INI file at a remote address that will not change. Then you can download this file and read it with FileRead/ReadINIStr.

If you cannot have a fixed URL then header redirection in a PHP/Perl/whatever executable is the only way.

I recommend using quotes around the two last parameters as well.

Stu
Afrow UK is offline   Reply With Quote
Old 19th June 2007, 12:30   #3
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
inetc/inetload handle redirection internally (in WinInet ). http://nsis.sourceforge.net/Category:Plugins
Takhir is offline   Reply With Quote
Old 19th June 2007, 12:34   #4
boomsurf
Junior Member
 
Join Date: Jun 2007
Posts: 2
Thanks so far for help.

Unfortunately there's a CD based installer out there that gets used very often and I'm not able to change.

So if you have any idea how to handle this without creating a new installer let me know.
boomsurf is offline   Reply With Quote
Old 19th June 2007, 14:21   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Try Takhir's plugin, although I'm guessing that that will not work for meta reload as that is an HTML element not a header instruction.

Stu
Afrow UK 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