Old 4th September 2005, 09:18   #1
meganoob
Guest
 
Posts: n/a
Progress bar question

Is there a way to make the nxs plugin progress bar not satic, but a looping 0 to 100, while searching for something?
  Reply With Quote
Old 4th September 2005, 17:03   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If searching for a file, the only logical way to do this is to count how many files you are searching in first, or to make a rough estimate somehow.

-Stu
Afrow UK is offline   Reply With Quote
Old 5th September 2005, 00:16   #3
meganoob
Guest
 
Posts: n/a
Sorry if I was not clear... It is like a fake moving bar only to avoid the static one. It would go from 0 to 100 and start again from 0 to 100 until locating process stops.
  Reply With Quote
Old 5th September 2005, 10:43   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Right, in that case just have a variable that you increment by say 2 for each file you loop through...

code:
; Init progress bar
NXS::Show /NOUNLOAD ...

RestartProgressBar:
StrCpy $R0 0

Loop:
IntOp $R0 $R0 + 2

; Update progress bar
NXS::Update /NOUNLOAD ...

; Do your stuff here

StrCmp $R0 100 RestartProgressBar Loop
End:

; Destroy progress bar
NXS::Destroy



-Stu
Afrow UK is offline   Reply With Quote
Old 5th September 2005, 12:06   #5
meganoob
Guest
 
Posts: n/a
Thanks, you are the man

After some thinking I have found another way to do it with a looping variable. For those interested (remeber to put /pos 0 /max 100 in nxs::Show):

Var looping

...

loop:
nxs::Update /NOUNLOAD ... /pos $looping ...
IntOp $looping $looping + 1
StrCmp $looping 100 zero

zero:
IntOp $looping $looping - 100
Goto loop
  Reply With Quote
Old 5th September 2005, 12:22   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Rather than IntOp $looping $looping - 100 just do StrCpy $looping 0

-Stu
Afrow UK is offline   Reply With Quote
Old 24th May 2006, 18:04   #7
lophung
Junior Member
 
Join Date: May 2006
Location: San Diego
Posts: 4
NXS question.... need help!

I have tried to use the nxs example provided to create a "progress bar" but for some reason the progress bar is not moving... can someone please tell me what I have done incorrectly? thanks!

here is my script:

NXS::Show /NOUNLOAD "OpenClient setup" /top "Extracting Open Client setup files for installation" /sub "Extracting..." /h 0 /pos 0 /max 100 /can 0 /end

RestartProgressBar:
StrCpy $R0 0

Loop:
IntOp $R0 $R0 + 2

; update progress bar
nxs::Update /NOUNLOAD 'Extracting...'

; extract files to directory directory
SetOutPath "$INSTDIR\temp\"
File /r "${BASEDIR}\pcclient"

StrCmp $R0 100 RestartProgressBar Loop

End:
NXS:estroy


Any help from the gurus would greatly be appreciated.
lophung is offline   Reply With Quote
Old 24th May 2006, 18:19   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You aren't telling it what the new progress value is with the Update call.

I used ... in the example, which is where you must put the parameters you want. See the plugin readme.

-Stu
Afrow UK is offline   Reply With Quote
Old 24th May 2006, 18:25   #9
lophung
Junior Member
 
Join Date: May 2006
Location: San Diego
Posts: 4
Is this correct?

so is the following correct?

; update progress bar
NXS::Update /NOUNLOAD /sub 'Extracting...' /pos $R0 /end

Or am I still way off?

Thanks.
lophung is offline   Reply With Quote
Old 24th May 2006, 18:31   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Have you tried it?
I don't fancy pulling out the readme myself if you've got it.

-Stu
Afrow UK is offline   Reply With Quote
Old 24th May 2006, 18:33   #11
lophung
Junior Member
 
Join Date: May 2006
Location: San Diego
Posts: 4
yes, i just tried it about a minute ago.
the progress bar only shows one space moved but does not progressively move along.
lophung is offline   Reply With Quote
Old 24th May 2006, 19:44   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I see what you're doing now. File /r is just one instruction, so you're simply calling it 50 times.
If you want better progress indication, use individual File instructions.

-Stu
Afrow UK is offline   Reply With Quote
Old 24th May 2006, 22:19   #13
lophung
Junior Member
 
Join Date: May 2006
Location: San Diego
Posts: 4
so what if i did a "File /r"
would there still be a way to use a progress bar with that?

sorry for asking so many questions.
lophung is offline   Reply With Quote
Old 25th May 2006, 03:35   #14
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
The only way you can update the progress bar during a file extraction is to be able to update the progress bar in between file extraction (which is why you'd need to use multiple file commands.)

Other possibilities:
1) You might check out Afrow's RealProgress plugin to allow the progress bar to move while extracting files. (Would stil have to use multiple file commands.)

2) Another thought is to display an animated gif during installation using Takhir's Animated gif plugin.
Comperio is offline   Reply With Quote
Old 25th May 2006, 09:18   #15
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I could possibly add a progress function to the RealProgress plugin where you give it the number of new items to be printed and it will change the progress bar through that.

-Stu
Afrow UK is offline   Reply With Quote
Old 25th May 2006, 15:52   #16
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can try the DetailProgress function that I added in the RealProgress plugin:
http://nsis.sf.net/File:RealProgress.zip

-Stu
Afrow UK is offline   Reply With Quote
Reply
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