Old 8th May 2008, 23:48   #1
Junior Member
Join Date: Oct 2006
Posts: 6
Endless Progress Bar?

Hi everyone,

I have a need to execute a process during my installation but there is no way for me to know how long it will take. I was wondering if there is any sort of endless progress bar available for use in NSIS? ie. a bar that is constantly moving but doesn't necessarily go from 0 to 100%.

I know one option is to use the GradualProgress function on the RealProgress plugin but this isn't quite what im looking for because it goes from 0 to 100 and once it reaches 100, it stays there until the task is done.

Is anyone aware of such a progress indicator for nsis?

Appreciate any answers.

chickendavis is offline   Reply With Quote
Old 9th May 2008, 05:43   #2
Red Wine
Forum King
Red Wine's Avatar
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
You could the trick by adding a loop after Exec command, e.g.
Exec "Some_Application.exe"
Sleep 2000
FindWindow $R0 "Some_Application_WindowClass" "Some_Application_WindowTitle"
Sleep 1000 ;might need to decrease sleep time
IsWindow $R0 loop

Doing this in a section would show progress bar somehow blinking.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 9th May 2008, 12:29   #3
Senior Member
{_trueparuex^}'s Avatar
Join Date: Dec 2005
Location: Glow
Posts: 285
In Windows XP or later you can set the progress bar in maraquee mode.
!define PBM_SETMARQUEE 0x040A
!define PBS_MARQUEE 0x08
!ifndef GWL_STYLE
!define GWL_STYLE -16

; Get progress bar handle.
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1004

; Set PBS_MARQUEE style for the progress bar control.
System::Call "user32::GetWindowLong(i $0, i ${GWL_STYLE}) i .r1"
System::Call "user32::SetWindowLong(i $0, i ${GWL_STYLE}, i $1|${PBS_MARQUEE})"

; Send PBM_SETMARQUEE message to start the marquee.
; lParam is time in milliseconds between marquee animation updates.
SendMessage $0 ${PBM_SETMARQUEE} 1 50

Sleep 5000 ; do your thing

; Stop the marquee and set the old styles back for the progress bar control.
SendMessage $0 ${PBM_SETMARQUEE} 0 0
System::Call "user32::SetWindowLong(i $0, i ${GWL_STYLE}, i $1)"

{_trueparuex^} is offline   Reply With Quote
Old 9th May 2008, 18:14   #4
Junior Member
Join Date: Oct 2006
Posts: 6
Thanks very much for the suggestions 'Red Wine' and '{_trueparuex^}'. I will do some testing and decide which of these optiosn is best for me.

chickendavis is offline   Reply With Quote
Old 4th September 2008, 14:46   #5
Senior Member
Join Date: Jan 2004
Posts: 197
Send a message via AIM to jweinraub
I like this but it isn't what I thought it would do. I got a small segment and it moved.

I rather have the entire thing filled partially and it moves similarly to how Win XP boots. Or how Internet Explorer does downloads when it doesn't know how big it is.
jweinraub is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump