Download Latest: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Initial Release)
 
m (→‎Description: Added Forum Link)
Line 10: Line 10:
'''Download Latest''' is a compile time utility to download a file if it has changed from a web site and generate a NSIS header about the file for easy inclusion into your packages.
'''Download Latest''' is a compile time utility to download a file if it has changed from a web site and generate a NSIS header about the file for easy inclusion into your packages.


[http://forums.winamp.com/showthread.php?t=336281 Forum Discussion]
[http://forums.winamp.com/showthread.php?p=2823100 Forum Discussion]


== How To Use ==
== How To Use ==

Revision as of 15:36, 2 December 2011

Author: Zinthose (talk, contrib)


Download Links

DownloadLatest.zip (47 KB)
Written and compiled using NSIS.

Description

Version 1.1.

Download Latest is a compile time utility to download a file if it has changed from a web site and generate a NSIS header about the file for easy inclusion into your packages.

Forum Discussion

How To Use

Extract the exe to the projects path and use the !system command to execute it within your scripts.


Example

This example downloads the latest version of Adobe Flash x86 and includes it into the package.

OutFile "Setup[Adobe Flash x86].exe"
ShowInstDetails show
 
!system `"DownloadLatest.exe" \
  /URL="http://download.macromedia.com/pub/flashplayer/curren/install_flash_player_ax_32bit.exe" \
  /DST="media\downloads" /NSH="Flash32"` = 0
!include "media\downloads\Flash32.nsh"
 
Section
    DetailPrint "File Version: ${DL_Flash32_Version}"
    DetailPrint "ETag: ${DL_Flash32_ETag}"
    DetailPrint "Last Modified: ${DL_Flash32_LastModified}"
    DetailPrint "FileName: ${DL_Flash32_FileName}"
    DetailPrint "Source Path: ${DL_Flash32_Path}"
 
    MessageBox MB_YESNO|MB_ICONQUESTION|MB_TOPMOST|MB_DEFBUTTON2 \
      "Do you want to install Adobe Flash?" /SD IDYES IDYes DoInstall
    Abort "User Aborted Install."
 
    DoInstall:
    InitPluginsDir
    SetOutPath $PLUGINSDIR\INST
    File "/oname=$OUTDIR\install.exe" "${DL_Flash32_Path}\${DL_Flash32_FileName}"
 
    StrCpy $0 ""
    IfSilent 0 +2
        StrCpy $0 "-install"
    ExecWait `"$OUTDIR\install.exe" $0` $0
    DetailPrint "Result: $0"
SectionEnd

Versions History

0.1 - 02/Dec/2011
  • Initial release!

Credits

Author: Dane Jones (aka zinthose).

License

  This software is provided 'as-is', without any express or implied
  warranty. In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute
  it freely, subject to the following restrictions

  1. The origin of this software must not be misrepresented;
     you must not claim that you wrote the original software.
     If you use this software in a product, an acknowledgment in the
     product documentation would be appreciated but is not required.
  2. Altered versions must be plainly marked as such,
     and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any distribution.