Skip to content
⌘ NSIS Forum Archive

MSIBanner - newest plugin

48 posts

Joel#

MSIBanner - newest plugin

This is my new plugin, MSIBanner.

It prompts a banner like the MSI installations (Windows Installer).

Please test it 🙂

TODO:
1. Remove the parameter /NOUNLOAD
2. Put a progress bar.

Thanks!

😁
Joel#
updated....

Update MSIBanner....

What's new:
1. Rewrite Update function.
2. Added the progress bar.

See example.

TODO:
1. Remove the /NOUNLOAD parameter.
2. (maybe) add colors to the progress bar.
Joel#
Originally posted by kichik
It has the same problem as old Banner. The installer shows on the background.
Not anymore 😉

plus added a static text control which shows the current "%" number.

Archive page
Takhir#
Win2K (Server, SP2, Rus), NSIS 2.04, goes to background. After banner destroyed, installer window becomes visisble on the top for a short time and after this goes to BG (100% repeatable on my Win2K). I run it 4 times, and one of them caused installer crash (bad pointer) on the banner destroy step.
Looking from my corner % at the end of progress bar looks ugly. And I not found any progress bar positioning parameter, to reach it's end (100% without jumps from 20 to 100) developer should add 20 Update script lines 🙁
Joel#
Hi Takhir:
I don't know why in win2k goes to the background...maybe is the API I'm using that is not available in win2k (doubtfull, but I'll check)...
On this moment is the only place where I can place the "%".
And... Detroy function will close the counter, so you don't need to add the 20 lines... 😁
Takhir#
Originally posted by Lobo Lunar
And... Detroy function will close the counter, so you don't need to add the 20 lines... 😁
For example installer checks 3 questions while banner window is visible, and developer (I 😁 ) want to show 3 steps: 30%, 60% and 100%. May be I misunderstood something, but current implementation with 3 /UPDATEs will show 5 and 10, and after this user will see jump to 100%. Or I should add 6 /UPDATEs on every step 😉 to emulate correct check out progress?
And finally most of users can live with "background", installer crash is a real problem.
Takhir#
Test script attached. I run it on slow comp with Win98, no crashes, but background gradient flushes on installer start (after banner). This not happens if Destroy line is commented, but this case Installer loses keyboard focus.
Joel#
I tested the script in my XP and seemes to be ok.... weird 🧟

Anyway, before uploading the big one... I update again the plugin

what's new:
1.- Added reset function: Which will reset the global increment and the position of the progress bar.

2. Added Move function: Which the progress bar moves and adds the inputed value to the global increment.

3. Added Pos function: Which the progress bar moves into position inputed, becoming the current global increment.

See the example 🙂
Takhir#
Attached image shows another possible place for percent value. Win2K test still is a good idea 😉
Joel#
Hi Takhir

I'm thinking to subclass the progress bar to put the % value inside of it...

Now, I don't know why you have issues in 2k... I already tested in XP and WinME and seems that everything is ok...

I'll try to find a 2k machine to tested my self 🙂
grahama#
for some reason I am getting fatal errors....since I got the new MSIBanner
I am on Win 2000
says it is generating an error log...do you know where the log is located...
It does compile properly...and your script example works fine
Strangely, resaving the nsi as a new file name made it work...
Then, I made some changes and recompiled...and started getting the fatal errors again
🙁
grahama#
FYI, I am using variables in the text string like:
msibanner::update /NOUNLOAD "Checking for ${FILENAME}.ini"
or
msibanner::move 15 /NOUNLOAD "Checking for ${FILENAME}.ini"
grahama#
another note:
sometimes it compiles properly and runs....properly
if I try to launch the file manually, I get the fatal errors again
grahama#
went back to the previous MSIBANNER which does not produce the erros
do you have the latest MSIBANNER BEFORE the new changes were made ?
not sure if I have it

many thanks
grahama#
thanks Lobo 🙂

the main nsi is !Fonovisav5
the plugins are from the nsis plugin folder
I have made some alterations trying to find the bug...but basically get the same fatal error even though it compiles properly
Joel#
Hi grahama!

I read your code 🙂

Seems that when the plugin read this line:

MSIBanner::UPDATE /NOUNLOAD 'User= "$R1" AccountType= "$R2" IsUserAdmin= "$R0"'
can't continue.... watch the loop thing 🙂
Guest#
Help using MSIBanner

I am relatively new to the NSIS installer. I am trying to use your MSIBanner plugin to show progress.

I put code in a function that controls a custom page. That code is the same as your demonstration and the function is attached.

What I see is the msibanner dialog come up but it never gets any increments. At the very end it goes to 100% in one step and goes away, i guess on MSIBanner::destroy.

Are there any other steps that must happen? Is MsiBanner designed to be used in another way?

Thanks,
Jim McGlaughlin
Guest#
Here is the function:

;====================================================================
Function CustomInstallPageXXXX

!insertmacro MUI_HEADER_TEXT "Installation Progress" "Line 2"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Progress.ini"


; Call MSIBanner show funtion to create both dialog and dialog title:
MSIBanner::Show /NOUNLOAD "${PROGNAME} Installer - Progress Monitor"

; Call MSIBanner Update function so, the text & the progress bar will be...mmm, updated 😛
MSIBanner::Update /NOUNLOAD "Reading known stuff from your PC"
; Sleep a while, since we don't real reading let's see for a sec. the text 😉
Sleep 100
MSIBanner::Update /NOUNLOAD "Reading unknown stuff 1 from your PC"
Sleep 100
MSIBanner::Update /NOUNLOAD "Reading unknown stuff 2 from your PC"
Sleep 100
MSIBanner::Update /NOUNLOAD "Reading unknown stuff 3 from your PC"
Sleep 100

; Let's reset the progress bar...
MSIBanner::Reset /NOUNLOAD "Reseting values..."

MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 5"
Sleep 100
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 4"
Sleep 100
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 3"
Sleep 100
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 2"
Sleep 100
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 1"
Sleep 100


MSIBanner::Reset /NOUNLOAD "Re-counting again...."
; And... let's move the progress bar manually 🙂
Sleep 400
MSIBanner::Pos /NOUNLOAD 10 "Reading hardaware"
Sleep 400
MSIBanner::Pos /NOUNLOAD 25 "Reading memory"
Sleep 400
MSIBanner::Pos /NOUNLOAD 45 "Reading mouse"
Sleep 400
MSIBanner::Pos /NOUNLOAD 60 "Reading software"
Sleep 400
MSIBanner::Pos /NOUNLOAD 40 "wait... forgot keyboard"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 70 "Reading CPU"
Sleep 400
MSIBanner::Pos /NOUNLOAD 90 "Finish ing global scoops..."
Sleep 400
; last call and the progress bar will increase more:
MSIBanner::Pos /NOUNLOAD 100 "Cleaning...."

; MessageBox MB_OK "end of custom install"

MSIBanner:😁estroy


FunctionEnd
Guest#
"Sleep 1000 is equal to 1 sec... but 400 or 100? you do the math "

For a test I did not want to wait a full second between events. Is 1000 the minimum? I sent it to 400 milliseconds to speed up the test.
Joel#
No, is not the minimun, but the increasing of the progress bar is very quick, which also depends on the users machines. That's why I recommend one sec. of delay.... at least to see the bar info 🙂
Joel#
Updated:
-Added getHWND. Which will get the handle(hwnd) of the dialog of MSIBanner.
-Added two more example files.
-I think the erros went out 🙂

Test it 😁
JimInNH#
Thank you, Thank you, Thank you!

I am now able to launch MSIBanner in .oninit and hide the window immediately. Then in a later custom page I can show it and update it.

Thanks, I needed that. Today is/was my deadline for getting and installer done and this avoids an unpleasant work around.

This forum is great.