Archive: MSIBanner - newest plugin


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!

:D


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.


It will put at the archive in a few hours...

any last suggestions?


It has the same problem as old Banner. The installer shows on the background.


ok, add it into my TODO list... :)

Archive page.


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

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


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... :D


Originally posted by Lobo Lunar
And... Detroy function will close the counter, so you don't need to add the 20 lines... :D
For example installer checks 3 questions while banner window is visible, and developer (I :D ) 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.

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.


I tested the script in my XP and seemes to be ok.... weird :igor:

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


Attached image shows another possible place for percent value. Win2K test still is a good idea ;)


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


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


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"


another note:
sometimes it compiles properly and runs....properly
if I try to launch the file manually, I get the fatal errors again


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


send the changes your made.... :)


thanks Lobo :)
http://www.siren.cc/Univision/fonovi...NNER_error.zip
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


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

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


Did you use Update, pos nor move functions?


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 :p
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::Destroy


FunctionEnd


Sleep 1000 is equal to 1 sec... but 400 or 100? you do the math :D


many thanks Lobo for looking thru my code :)
that is a great help

g


"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.


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


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


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.


seems to work perfectly Lobo :)
no more crashes
way to go :)
g


Really? :D

So, will be later on the web archive plus in my server... :)

Thanks to you all for testing it.... ;)


Yes, no more crashes :)
But installer after banner still goes to background on Win2K :(


Is there any documentation for this? (I think it would be helpful for us all to know exactly what functions are available to test.)

Great work on this, by the way!


erm... see examples? :|


I just thought that perhaps you had more undocumented properties/procedures you'd like to have tested, but from the sounds of it, what's in the examples is all there is.

In response to Takhir:

But installer after banner still goes to background on Win2K
I've compiled all the included examples on my Win2K computer using NSIS 2.04 and did not see the same symptoms--the installer always stays in front. Were those tests done with the included example scripts or something different?

This happens on my comp with all (3) included nsi examples. Win2K Server Rus, SP2, NSIS 2.04. Pentium II 400, 256 MB :)
I see installer page for a short time (~0.5 sec) in the foreground, but after this page goes to background, while it's task bar item continue flashing (focus not lost?).


hmmm, Strange...
My PC is Win2k Pro w/ SP4. Do you think the SP might be the problem?

(I'd test it, but unfortunately, I don't have any spare Win2k computers...)


This may be slow comp...
BTW KichiK also wrote about background problem (4-th post of this thread).


BTW KichiK also wrote about background problem
Yes, but was before adding the feature ;)

I was experimenting with the banner on an XP pro computer and Win2K. I seem to get fairly consistant errors whenever I use a silent installer with the banner and a message box displaying with the .onInstSuccess callback.

Here's a simplified example script:


!define PRODUCT "MSIBanner"

Name ${PRODUCT}
OutFile "${PRODUCT}2.exe"
ShowInstDetails show
;XPStyle on

Function .onInit
SetSilent silent
MSIBanner::Show /NOUNLOAD "NSIS Installer - ${PRODUCT}"
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 5"
MSIBanner::Pos /NOUNLOAD 100 "Cleaning...."
FunctionEnd

Function .onInstSuccess
MessagebOX MB_OK "DONE!"
FunctionEnd

Section -default
MSIBanner::Destroy
DetailPrint "Works great!"
SectionEnd


If I remove the calls to MSIBanner, it seems to work fine. It also seems to be ok if I REM the SetSilent line. (Example error is attached.)

Archive: MSIBanner - newest plugin


Of course... there aren't windows or dialogs which the banner attached to it...

The MSIBanner isn't a standalone one ;)
Needs a parent window.

BIG EDIT:
Just test the code ... and I don't get any errors:


!define PRODUCT "MSIBanner"

Name ${PRODUCT}
OutFile "${PRODUCT}2.exe"
ShowInstDetails show
;XPStyle on

Function .onInit
SetSilent silent
MSIBanner::Show /NOUNLOAD "NSIS Installer - ${PRODUCT}"
Sleep 1000
MSIBanner::Move /NOUNLOAD 20 "Countdown to destruction 5"
Sleep 1000
MSIBanner::Pos /NOUNLOAD 100 "Cleaning...."
Sleep 1000
FunctionEnd

Function .onInstSuccess
MessagebOX MB_OK "DONE!"
FunctionEnd

Section -default
MSIBanner::Destroy
DetailPrint "Works great!"
SectionEnd

Be sure to have the lastest version of the MSIBanner...
WOW! Works even in silent mode :up:

Your explanation makes perfect sense! (And once you do it right, it works like a charm!)
;)
Thanks!


2 new questions:
I have situations where I launch applications during an install. The applications I use a banner page that displays while the app is initializing. The problem is that the banner of the other apps covers MSI Banner's window.

Is it possible to force the MSI Banner to the top of all other windows? Or is it posible to set the position of MSI Banner on the screen?


Try using BringToFront to bring the installer to the top.

-Stu


Is it possible to force the MSI Banner to the top of all other windows?
Do what Stu said :D

Or is it posible to set the position of MSI Banner on the screen?

Maybe on next release ;)

Thanks guys!


could you make it support InstallColors and InstProgressFlags in future?


Originally posted by Joel
The MSIBanner isn't a standalone one ;)
Needs a parent window.
i take it that's why the attached example doesn't work?