Archive: NSISDL download problem


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


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


inetc/inetload handle redirection internally (in WinInet :) ). http://nsis.sourceforge.net/Category:Plugins


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.


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