2007-06-21 18:41:24 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Support code for file downloads
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2007-07-25 18:42:22 +00:00
|
|
|
!macro DownloadFile RET ID FILENAME APPEND
|
2007-06-21 18:41:24 +00:00
|
|
|
|
|
|
|
#Downloads a file using the InetLoad plug-in (HTTP or FTP)
|
|
|
|
|
|
|
|
#RET = Return value (OK if succesful)
|
|
|
|
#ID = Name of the download in settings.nsh
|
|
|
|
#FILENAME = Location to store file
|
2007-07-25 18:42:22 +00:00
|
|
|
#APPEND = Filename to append to server location in settings.nsh
|
2007-06-21 18:41:24 +00:00
|
|
|
|
|
|
|
#Try first mirror server
|
2007-07-25 18:42:22 +00:00
|
|
|
InetLoad::load "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}" /END
|
2007-06-21 18:41:24 +00:00
|
|
|
Pop ${RET} #Return value (OK if succesful)
|
|
|
|
|
|
|
|
${if} ${RET} != "OK"
|
|
|
|
#Download failed, try second mirror server
|
2007-07-25 18:42:22 +00:00
|
|
|
InetLoad::load "${DOWNLOADALT_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}" /END
|
2007-06-21 18:41:24 +00:00
|
|
|
Pop ${RET}
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
!macroend
|