zirnevis
8th July 2010 06:19 UTC
inetc::get
Hi Guys,
I'm writing a small installation / registration that will actually register the user using http forms, however, in the first starting step I want to start downloading the main package which is around 20MB and install this in the last step as soon as the file is available.
however inetc::get is being runned as modal and it doesn't allow the rest of the code to run.
1. how to let the rest of the script run while inetc::get is downloading?
2. how to get the download status from inetc and display in the banner area so user know that there is a main packaging coming at what speed?
Cheers
Afrow UK
8th July 2010 10:37 UTC
The plug-in does not have asynchronous support and even if it were added where would you display the banner? Are your steps custom pages or is all this going on on the instfiles page?
Stu
zirnevis
8th July 2010 10:59 UTC
I can put the process anywhere,
even if we can't place it in banner, it is still okay,
the only important thing is that the download runs in the backgroun upon
launch.
I'm using Pages for the registration process.
Cheers
Afrow UK
8th July 2010 13:03 UTC
You can request the feature be added (Takhir is the author) but for now you could use wget.exe to do the download. You can use ExecDos::Exec with the /ASYNC flag and then ExecDos::Wait just before you have to run the downloaded file.
http://nsis.sourceforge.net/ExecDos_plug-in
http://gnuwin32.sourceforge.net/packages/wget.htm
Stu
zirnevis
9th July 2010 17:45 UTC
wget is already too large :(
Afrow UK
9th July 2010 19:31 UTC
439KB is too large? What about after it's compressed in the installer? (I'm not going to check the file size then). Make sure you use /solid lzma.
Stu
Animaether
9th July 2010 22:19 UTC
I wonder how large a separate NSIS installer with inetc with a single purpose (download data from a given location (provided on the command line, perhaps)) would be - could certainly execute that in the background (you'd still get no feedback on progress, though).
Afrow UK
10th July 2010 10:09 UTC
That'd just be wasting more space and at the end of the day you'd still have to extract wget.exe to run it. I don't see the problem with wget's size but another option is to use a VBS to do it (search Google).
Stu
Animaether
10th July 2010 13:26 UTC
Originally posted by Afrow UK
That'd just be wasting more space and at the end of the day you'd still have to extract wget.exe to run it.
o_O
Either I missed something, or maybe you misunderstood :)
I wasn't suggesting a separate installer that calls wget.exe - I was suggesting a separate installer that calls inetc; replacing wget.exe altogether.
The overhead from that would be the size of a bare installer (31.8k - not counting the size of inetc as that's what he's already using; including inetc.dll: 40.9k) + some code space if he made it command line-driven, rather than hardcoded URIs and conditions.
That would still be less than including wget with any compression (/solid lzma gives 152.6k)
Originally posted by Afrow UK
I don't see the problem with wget's size
neither do I - but if for whatever reason it is a concern, the inetc-in-separate-installer route should work, no?
( as would the VBS route, which would probably be even smaller, yes )
Afrow UK
10th July 2010 13:51 UTC
Ah sorry yes I misunderstood, or rather I didn't think of that :)
Stu
zirnevis
12th July 2010 09:42 UTC
Hi guys,
Thanks for the response,
I managed to do it by making another installer and using inetload then calling it with exedos /async
to run it in the background. the only thing i need to do is to check the installer file size and make a timer in main installer to check the downloaded size and compare with original size to draw a process bar.
I'm not sure how to check file size a file over web?
any idea?
Regards
Afrow UK
12th July 2010 10:01 UTC
You should use inetc rather than inetload (inetc supersedes it). inetc has a ::head function which you can use to get the headers for your file. The headers will contain the file size if the server provides it.
Stu