Archive: InetLoad, GetSectionNames Problem


InetLoad, GetSectionNames Problem
Hi,

I have the following Problem:
I am using inetLoad to get stuff from the web. For this I am using the GetSectionNames Function to loop over the INI-File:


Function .onInit
#Loading updatefile
InetLoad::load "http://example.com/update.ini" "$TEMP\update.ini"
FunctionEnd

Function GetUpdates
ReadINIStr $Path "$TEMP\update.ini" "$9" "path"
InetLoad::load "http://example.com/$Path" "$DESKTOP\$Path"
Push $0
FunctionEnd

Section GetSections
${GetSectionNames} "$DESKTOP\update.ini" "GetUpdates"
SectionEnd


When I use a simple MessageBox instead of the InetLoad:load it shows me all the sections in the INI-File... So why doesn't it work with InetLoad?

Thank you in anticipation!

The most suitable answer to the event is that you didn't put the "/NOUNLOAD" optional parameter before the first parameter of all the "InetLoad::load" calls. Without it, the plug-in always unloads after the call is completed, except in some plug-ins. I have no information if this is true for this plug-in, specifically, so please check this information.


Thx deguix
I added the "/NOUNLOAD"-Parameter but it still doesn't work. Any other ideas how I can manage this?


make sure the ini files are downloaded correctly, first. The GetSectionNames call should be fine -if- the ini files are present and correct.


The INI-File is downloaded correctly...


Try just a ReadINIStr in your GetSections section.. see if that reads okay.. e.g.

ReadIniStr $0 "$DESKTOP\update.ini" "GetUpdates" "somekey"

where somekey should be an existing key name -_-

InetLoad puts download result as string to stack. There are 2 reasons to pop this string in .onInit and later, first is to check download status ("OK"), the second - next InetLoad call tries to get more url/file pairs from stack and fails this case. You can use /end at the end of InetLoad command line to stop stack reading.
It was kichik who asked about few files download in the single plug-in call ;)


@Animaether: Yes, it works.

@Takhir: Can you give me an example, please?


Example.nsi included to InetLoad package.

InetLoad::load "http://example.com/update.ini" "$TEMP\update.ini" /END
Pop $0
StrCmp $0 "OK" +2
MessageBox MB_OK "Download Failed: $0"
...
Function GetUpdates
ReadINIStr $Path "$TEMP\update.ini" "$9" "path"
InetLoad::load "http://example.com/$Path" "$DESKTOP\$Path"
Pop $0
FunctionEnd