- NSIS Discussion
- show progress of a file, instead of overall status?!
Archive: show progress of a file, instead of overall status?!
nco2k
14th January 2006 15:54 UTC
show progress of a file, instead of overall status?!
hi everybody,
i have a installer which contains two files, a small exe and a ~300mb (already packed) archive-file.
now the problem is, the archive-file is very big and needs some time to extract, so in that time, the progressbar of the installer, wont go on until the archive-file has been fully extracted. it looks ugly when the progress goes to about 5-10% and wont change for a very long time, then suddenly jump to 100%, after the archive-file has been extracted. the exe is small and dont need much time to extract.
if i change the installation order, so that the exe extracts first and after that the archive-file, the progressbar goes to about 90-95% and then wont move until the archive-file has been extracted. this would look even more ugly.
now my question... is there a possibility to show the current extraction status of my archive-file in the progressbar, instead of the overall installation progress??
sorry for my bad english, i hope you guys understand what i mean. thanks for any help!
p.s.: i am using the Modern UI and have SetCompress off becuase my archive-file is already compressed and it would only slow things down.
c ya,
nco2k
Takhir
14th January 2006 17:48 UTC
AFAI know progress bar position is script line related (this is why it looks crazy in script loops). You can use fixed banner during file extraction (included to distribution). You can also test NSIS ReserveFile, but this may be useless in your situation. It is possible to write a new plug-in (or update one of existing banner plug-ins http://nsis.sourceforge.net/Category:Plugins ), but this require some tests of file system behaviour, main quiestion is correctness of file size requests during file write.
BTW multi-file distribution is not a bad idea sometimes :)
nco2k
15th January 2006 17:49 UTC
well i would love to do that, but my c/c++ skills are zero. :)
probably i will ask Afrow UK. maybe he has the time and the will to make such a plugin, which shows the status of the current file 0-100% (for each file) instead of the overall-progress.
it would be pretty cool, if he (or someone else) could make such a plugin. :)
c ya,
nco2k
Afrow UK
15th January 2006 17:52 UTC
This would be very hard to do and may not even be possible to do during run-time via a plugin. The actual NSIS source code would have to be modified in some way, and I'm not going there I'm afraid! Compiler plugins are another option but unfortunately they have not been implemented yet.
Edit: Actually I have an idea of how to implement this after a little thought. I'll probably work on it during the week.
-Stu
nco2k
15th January 2006 18:00 UTC
i agree, if the nsis source has to be modified, then its better not to mess with it.
but how does the EBanner plugin (http://nsis.sourceforge.net/EBanner_plug-in) modify/change the progressbar state ?!
c ya,
nco2k
Afrow UK
15th January 2006 18:11 UTC
I've edited my post above.
-Stu :)
Afrow UK
15th January 2006 18:12 UTC
Changing the progress bar value is easy. It's determining how much of a file has been decompressed, and how much the progress bar should move in that time which is the problem.
-Stu
Takhir
16th January 2006 07:31 UTC
EBanner displays image on the installation dialog field, it not touches progress bar. This is very similar to NSIS SetBrandingImage (with png support :) ). IMHO Marquee is better for your purpose. You can add second timer (first one used for text redraw), check resulting file size on it's message/event and update progress bar position on the dialog using TBM_SETPOS (it's easy to get progress bar ID). I am not sure in all these mixed threadings, but probably this should work.
Afrow UK
16th January 2006 23:15 UTC
I worked on the plugin today and after a good few hours I've got it working nicely, and it's very easy to use (for the NSIS coder that is).
Needs more testing though and I need to make a small readme.
-Stu
nco2k
17th January 2006 22:38 UTC
wow great, im looking forward to it. ;)
c ya,
nco2k
Takhir
18th January 2006 16:12 UTC
I also had a free minute and did some tests with target file size tracking (instead of LVN catching Afrow UK used). Result is FileSizeProgress plug-in.
In 'SetCompress off' installer mode plug-in adds requested percentage to the "Extract:..." line, but this require file name and total file size options defined (/fn=, /fs=, see included samples). Some automation for file size may be done using !system command (samples for file version extraction at the compile time were discussed many times).
In 'SetCompress on' mode plug-in can work without file definition, this case plug-in takes value from text line above progress bar.
Progress bar range is from it's current position to predefined final position (/pbf=), default is 100 (progress bar maximum). Last parameter is timer interval (/int=).