Archive: show progress of a file, instead of overall status?!


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


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 :)


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


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


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


I've edited my post above.

-Stu :)


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


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.


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


wow great, im looking forward to it. ;)

c ya,
nco2k


http://forums.winamp.com/showthread....hreadid=235740

-Stu


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=).