[wpkg-users] Package Download patch

Andre Ilie ai at photonic-sense.com
Tue Apr 25 13:44:55 CEST 2006


Hi

	Just had some time to implement this package downloading stuff. I 
really like the idea as its very useful for remote dialup users and you 
can even work like the FreeBSD ports collection, by downloading the 
original package from the original websever (eg. acrobat from 
www.adobe.com), thus saving a lot of work with making your own file store.

	Downloading of packages is implemented like this:

	1. You can define an environment variable called WPKG_SOURCE where the 
packages get downloaded to. If its not defined we use %TEMP%\wpkg. You 
can use this environment var in your <install>, <remove> and <upgrade> 
commands. After successfull installation the downloaded files get 
removed. Files get overwritten on download if there. I've used an 
environment var because you can access it from the scripts/programs run 
from wpkg.
	2. Added some code to installPackage() to allow downloading of several 
files for a package from several sources. You can define source files 
either with or without MD5 checksum. When its there, it will be checked 
using an external tool (md5.exe, which you can get from here: 
http://www.fourmilab.ch/md5/ . I gave up on using a native MD5 
implementation in JScript as its really really slow (3MB in ~30 
seconds). You can also define a HTTP timeout, to skip the source if it 
takes too much time (default timeout is 7200s). The XML format is:

	<package name="bla" ...>
	    <file name="setup.exe"
		  timeout="60"
                   md5="4d9bfe4c51d792c196fedf95680d80d3">
		<source url="http://www.bla.com/mysetup.exe" />
		<source url="http://mirror1.bla.com/setup.exe" />
		<source url="http://mirror2.bla.com/xxxx.exe" />
		...
	    </file>
	    <file name="destination-filename.cab>
		<source url="http://www.onesource.com/data1.cab" />
		...
	    </file>
	    ...
	
	    <install cmd='msiexec.exe /q /i %WPKG_SOURCE%\setup.exe' />
	    ...
`	</package>

	3. You can use md5SumOk() function now to check MD5 checksums against 
the original one. If you want to use another MD5 tool, just change 
MD5PROG and MD5PROGARGS.
	4. I've now added some code to allow raising package priorities 
automatically before sorting to have the packages in the right order 
when using dependencies. Its not a good solution, because its not really 
checking every eventuality (eg. wrong dependency entries, or double 
dependencies)... someone should have a look on this.
	5. Hided some debug output in synchronizeProfile() as it was really 
annoying. (message about "testing available packages...").
	6. Added a listing of the package list after sorting to see  priority 
changes added by the dependency-priorities. Enabled in debug mode.

	I hope it will help you, as for me it works really nice and I've 
started to use this way of installing on all machines (even on LAN). 
Maybe someone could improve this MD5 hashing thingie, as its a little 
bit against wpkg concept to have no dependencies.

	There is also no HTTP resuming built in as I don't need this feature 
(when it's fully there, install it, if not, restart download). I just 
used the XMLHTTP component for this task, so I don't know how it behaves 
with proxies, authentication or even FTP.


	Greets,
		Andre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wpkg_0.9.8-test3+patch.js
Type: application/x-javascript
Size: 83231 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20060425/bf57cd6a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ai.vcf
Type: text/x-vcard
Size: 377 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20060425/bf57cd6a/attachment-0001.vcf>


More information about the wpkg-users mailing list