Wget

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Wget For windows[edit]

Wget can be used to download http files using the command line. This can be handy when this functionality is needed in other installers or scripts (for example, you can spread the load of downloading large files across multiple http servers, without the need to alter your wpkg server infrastructure)

Download the pre-compiled exe file from this link [1]

<!-- 
  Download wget for windows from here
  http://users.ugent.be/~bpuype/wget/
  This should be ok for 64 and 32 bit systems (if someone confirms this can they alter this like accordingly)
-->
<package
        id="wget"
        name="wget for windows v1.11.4"
        revision="2012081601"
        priority="20"
        reboot="false">
        <check type="file" condition="exists" path="%WINDIR%\system32\wget.exe" />

        <install cmd='cmd /c copy /y %SOFTWARE%\wget\wget.exe %WINDIR%\system32' />
        <upgrade include="install" />
</package>

Usage[edit]

As an example. to use wget from within another package, use something similar as below. This will quietly download a single file, if the file does not exist already OR if previously downloaded, the timestamps for the local file and the file on the server do not match. If the file is already downloaded to the C drive, and the file has not been updated on the server, (i.e. the timestamps match) wget will do nothing and exit with a successful status. The gnu wget manual has a full set of command line switches that can be used.


     <install cmd='wget -q -N http://10.106.81.30/kde.ova -P c:\kde' />


-q Quiet
-N Turn on time-stamping.
-P Set the local download directory