Archive: loading files from internet


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.


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.


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


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


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.