Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   loading files from internet (http://forums.winamp.com/showthread.php?t=282733)

beau 6th December 2007 12:34

loading files from internet
 
Ok I'm still fairly new to the NSIS installer, just looking for some help with scripting. Basically I want to download an inventory text file which has a list of further files to download. The theory is we can then simply update the inventory file on the server and not have to redeploy the setup.

The inventory file contains a file list in the following format:

filename1.jpg=images^filename2.jpg=images^data.xml=data

so that we have filename followed by the folder it should go into seperated by ^ characters.

The above would end up looking like this on the system:

images
|-filename1.jpg
|-filename2.jpg

data
|-data.xml

If that makes sense. I would be really helpful if someone could help me out with an example script. From what I have read it looks like it should be possible I am just struggling with the scripting a little.

pospec 6th December 2007 17:05

Maybe you could use InetLoad plug-in to download your "inventory file".
Then you will parse it, for examle using FileRead instruction. Look into Appendix E in documentation for advanced parsing.

beau 6th December 2007 23:10

ok I'm using inetload to download the inventory and I have that working. Just looking into the parsing now...

beau 6th December 2007 23:39

I don't suppose anyone could help with an example of how to parse the file as explained above? Help would be greatly appreciated.

Red Wine 7th December 2007 00:30

Talking about a plain text file, you should use the FileRead instruction as already mentioned.
Nevertheless you have several options, e.g an .ini which you may read with ReadINIStr instruction or a .cfg which you may read with ConfigRead.
Exclusively the file could be an xml which you may manage with one of the available xml plugins.
There are several examples for every case, you should search the forum and of course review the documentation.


All times are GMT. The time now is 05:35.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.