Difference between revisions of "Wget"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Created wget silent installer page.)
 
(added the usage example paragraph)
 
Line 22: Line 22:
 
</package>
 
</package>
 
</source>
 
</source>
 +
 +
=== Usage ===
 +
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 [http://www.gnu.org/software/wget/manual/wget.html gnu wget manual] has a full set of command line switches that can be used.
 +
 +
 +
<source lang="xml">
 +
    <install cmd='wget -q -N http://10.106.81.30/kde.ova -P c:\kde' />
 +
</source>
 +
 +
 +
-q Quiet
 +
-N Turn on time-stamping.
 +
-P Set the local download directory
  
 
[[Category:Silent Installers]]
 
[[Category:Silent Installers]]

Latest revision as of 09:02, 29 August 2012

Wget For windows

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

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