- NSIS Discussion
- Progress Bar...
Archive: Progress Bar...
Jnuw
3rd May 2005 16:21 UTC
Progress Bar...
Hello all.
I'm building a very small installer, that's only job is to extract a very large folder, silently. The only thing I would like the user to see is a progress bar in the middle of the screen, like in a banner. I'm looking at MSIBanner right now, but it looks like I have to update the progress bar manually. Is there any way to have any kind of progress bar display during a silent install that will automatically update based on the progress of the FILE command within nsis? Thanks all.
RobGrant
3rd May 2005 16:30 UTC
I dunno if there's a neater way (someone else may know) but you could consider having some sort of callback:
So instead of:
File "$INSTDIR\myFile.file"
Have:
!macro addfile PATHANDFILE
File "${PATHANDFILE}"
; Update banner by 1, somehow!
!macroend
!insertmacro addfile "$INSTDIR\myFile.file"
I don't know how banner works exactly, but perhaps if you know how many files there are, you can tell it that, then use this to increment the number transferred. Just a thought.
deguix
3rd May 2005 19:08 UTC
This below does what you want:
http://forums.winamp.com/showthread....Loading+Bar+UI
This is not a plugin. With this, you'll need to create another installer for the window and put the code you want to be executed in its section.
The process is the same as doing with the progress bar in the main installer window but with the customized UI. This UI crops the window in the second installer, making it show only the progress bar and the description of the current progress.
You'll have to execute the second installer where you want the progress bar to appear.
Jnuw
3rd May 2005 23:39 UTC
Thanks deguix for your tool, that works perfectly. Just one question, I like the progress bar, and I like the current status (extracting blabla.dll), but can I add a title or some words that don't change? Like "Please wait while blabla extracts...", that stay up the whole time? Thanks again!
Comperio
4th May 2005 00:56 UTC
Here's a possible solution:
When extracting a file, use a "SetDetailsPrint none" command. This supressress any messages from a file command, but leaves the previous message on the display. The code for each file would be something like this:
detail print "Please wait while [filename] extracts..."
SetDetailsPrint none
file "C:\MyFile.exe"
SetDetailsPrint textonly
If you wanted to make it easier, you could wrap the file extraction process into a function or macro to allow you to call it wherever you needed.
Jnuw
4th May 2005 04:24 UTC
Comperio, good to know about the SetDetailsPrint none command, thanks. However would I lose the extract status then? Is there a way to get both? Thanks!
deguix
4th May 2005 07:15 UTC
Hmmm... interesting. You're wanting to have a description and the extraction status at the same time... You'll need to edit the UI with Resource Hacker, add another label (for the description), and set the text of this label using "SendMessage" command when you want it. Maybe I should give an update to the old UI later. I still gotta do some other things right now...
Jnuw
4th May 2005 19:54 UTC
Originally posted by deguix
Maybe I should give an update to the old UI later. I still gotta do some other things right now...
Yeah, that would be great when you have a chance. I love seeing the real-time status of what’s going on, but it would be nice to have a general message like, "Please wait while your system is updated..." or something like that. Thanks!