Old 3rd May 2006, 12:03   #1
baskaran.vishnu
Junior Member
 
Join Date: Apr 2006
Posts: 41
Display Animated GIF images for Custom Pages

Hi,

I am having difficulties to display an animated GIF Image for a custom page,

At the moment, based on the design of my custom page, clicking the Next Button installs a hidden based application. During that process, I would like to show to an Animated GIF indicating installation in progress.

I am currently using a Bannner Image using the EBanner plugins. The banner works excellent. However, this plugin does not support animated GIFs.

I have tried using another plugin, AnimGif, however, I am having difficulties running this plugin for my custom page.

I would be grateful for any advice or references on this issue.

Thank you
baskaran.vishnu is offline   Reply With Quote
Old 4th May 2006, 02:02   #2
zeeh3
Senior Member
 
Join Date: Aug 2005
Posts: 121
Attach your script.
zeeh3 is offline   Reply With Quote
Old 4th May 2006, 10:18   #3
baskaran.vishnu
Junior Member
 
Join Date: Apr 2006
Posts: 41
Attached Scripts

Hi,

I have posted the Scripts as shown below;

/* Start Scripts */

/*Initialized code for the custom page at the beginning of the scripts */
#Custom Page Intialization
Page custom ShowMSQLCheckPage CheckMSQLPage

# Extract the Custom INI file
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "DispForms\Check MSQL.ini" "CheckMSQL"

/* Initialize a GIF image to the Plugins Directory */
Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\sample.gif "C:\sample.gif"

!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "DispForms\Check MSQL.ini" "CheckMSQL"
FunctionEnd


/* Custom Page Functions */
Function ShowMSQLCheckPage

# Display the page.
!insertmacro
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "CheckMSQL"
Pop $R0 # HWND
GetDlgItem $R1 $R0 1200 ; 1200 + Field # - 1
GetDlgItem $R2 $R0 1201 ; 1200 + Field # - 1

SetCtlColors $R0 3D66AB 3D66AB
SetCtlColors $R1 FFFFFF 3D66AB
SetCtlColors $R2 FFFFFF 3D66AB

!insertmacro MUI_INSTALLOPTIONS_SHOW
continue:

Return
FunctionEnd

Function CheckMSQLPage

newadvsplash::show /NOUNLOAD 2000 600 400 -1 /BANNER /NOCANCEL "$PLUGINSDIR\sample.gif"
newadvsplash::hwnd /NOUNLOAD
Pop $0
AnimGif::play /NOUNLOAD /hwnd=$0 /bgcol=0xffffff "$PLUGINSDIR\sample.gif"

sleep 5000
newadvsplash::wait ; waits or exits immediately if 'show' already finished
newadvsplash::stop
AnimGif::stop

FunctionEnd

/* End of Scripts */

From the codes above, the custom page calls on two functions to show the Main page(With some Text Display from the custom ini file) followed by the action to show the animated GIF Image when user clicks on the 'Next' button of the custom page. I can't seem to get the GIF Image displayed based on this condition. In fact the Installer hangs and I have to forcefully exit the Installer.exe file.

The weird thing is that when I remove '/Banner' from the newadvsplash::show command line, the Flash Image is displayed but the GIF Image does not seem to show its animation movement. It seems as if the AnimGif::play command doesn't execute.

Besides that, if I execute the newadvsplash::show (with '/Banner'),newadvsplash::hwnd and AnimGif::play commands in Function .onInit, the Animated Image with its splash screen feature is displayed during startup of the Installer.exe. It's as if that these functions work in the Function .oninit but not in custom based functions

I am using the AnimGif.dll along with the newadvsplash.dll plugins to run this method.

Would appreciate any help on this.

Thanks

(PS: I have attached the sample.gif Animated Image as a reference)
Attached Images
File Type: gif sample.gif (32.9 KB, 713 views)
baskaran.vishnu is offline   Reply With Quote
Old 5th May 2006, 08:56   #4
baskaran.vishnu
Junior Member
 
Join Date: Apr 2006
Posts: 41
Hi,

If you need any added details based on the scripts above, please inform me. I would help in any way possible.

I would truly appreciate it if anyone could assist me with the problem above.

Thanks
baskaran.vishnu is offline   Reply With Quote
Old 14th May 2006, 11:17   #5
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
newadvsplash patch

Please test attached dll version.
Attached Files
File Type: zip newadvsplash.zip (4.3 KB, 818 views)
Takhir is offline   Reply With Quote
Old 3rd April 2007, 18:49   #6
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Hi, reviving this old thread...
I'm also trying to use the newadvsplash plugin to display animated GIF banners when navigating between pages, i.e. pressing the 'Next' button displays an animated 'please wait' banner, and the next page hides the banner.

The plugin version that's on the wiki didn't work, but the special version in the last reply does work!
But... there's still a problem... it only works the first time! Any second calls to newadvsplash::show freeze the installer.

Please help...

Thanks
hbatista is offline   Reply With Quote
Old 3rd April 2007, 20:05   #7
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Not freezes in my tests using May 14, 2006 version. Script attached. I'll compare sources and add lost&found version to wiki tomorrow
Attached Files
File Type: nsi animleave.nsi (1.1 KB, 423 views)
Takhir is offline   Reply With Quote
Old 4th April 2007, 10:17   #8
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Thanks Takhir, I tried your script and it does indeed work.

But in attachment is a little example I cooked up that has the freezing problem.
It has two InstallOptions pages, and simulates a slow operation at the beginning of them where I'd like to show a banner, on the first page it works, on the second it freezes.

Can you take a look at it?
Thank you very much for your help!
Attached Files
File Type: zip bannertest.zip (1.9 KB, 519 views)
hbatista is offline   Reply With Quote
Old 4th April 2007, 12:53   #9
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
SetPluginUnload manual
helped me in your test. Is alwaysoff a default? But this is my fault too.. AnimGif not makes a full clean up on serial 'show' requests, and may hang. This is why I used 'stop' with unload.
Takhir is offline   Reply With Quote
Old 4th April 2007, 14:57   #10
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Tried using 'SetPluginUnload manual' but still no luck here ('manual' is the default anyway)

I'm using stop with unload too, but it doesn't seem to help...
hbatista is offline   Reply With Quote
Old 4th April 2007, 15:07   #11
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
script and binaries attatched - opens second page and second gif. I put new version to wiki but it has a minimum changes compare to version linked above.
Attached Files
File Type: zip test.zip (72.1 KB, 561 views)
Takhir is offline   Reply With Quote
Old 4th April 2007, 16:08   #12
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
OK, I see now what causes it to freeze, SetPluginUnload has nothing to do with it, your version worked because you changed the 'delay' value from 120000 to 1200 ms.
It appears the plugin does not like to have 'stop' called before the delay value expires.
I have to use a big value because I just want the banner to show for as much time as is necessary, not just a fixed delay...

Thanks for your patience

ps: by the way, the new version you uploaded to the wiki appears to be the same as the old one...
hbatista is offline   Reply With Quote
Old 4th April 2007, 18:28   #13
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Got it working!
Fiddled a bit with the source code, the wiki version does not seem to be the most recent (e.g. it doesn't have the '/BANNER' parsing code), but modified it anyway.

The problem seems to be that because the thread never ended ('stop' doesn't wait), it never unregistered the window class. So on the second call to 'show', the register failed. I added an unregister in the 'stop' method and the thing is now working.

In attach there's the modified source, modified lines have an '//hbatista' comment. Takhir, can you integrate this into the official plugin version?

Thanks
Attached Files
File Type: txt advsplash.cpp.txt (15.0 KB, 385 views)
hbatista is offline   Reply With Quote
Old 5th April 2007, 07:38   #14
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks for your help, hbatista!
RegisterClass really works in the application scope, not dll load/unload . I added your code to wiki.
Few comments.
1. /BANNER mode presents in code beginning 06-25-2005, may be if-else parsing looks a bit ugly, but it works - sets modal = false.
2. 04-04-2007 wiki version sets hParent=NULL for banner mode only, I guess this is a corect way.
Please test wiki version. Just for possible proxy issues - latest files in zip should have Apr. 5 date.
And thank you again!
Takhir is offline   Reply With Quote
Old 5th April 2007, 09:33   #15
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Thanks Takhir,
for some reason when I click the most recent version of the wiki file, the zip I get has files with date 2006-03-04...
when clicking the revisions I get the expected file dates.

Will try later, maybe it's some cache thing?...
hbatista is offline   Reply With Quote
Old 5th April 2007, 10:24   #16
hbatista
Junior Member
 
Join Date: Oct 2006
Posts: 15
Duh... browser cache...
Tried it, it's working fine!

Thanks again!
hbatista is offline   Reply With Quote
Old 18th July 2007, 02:57   #17
zbd
Member
 
Join Date: Oct 2006
Location: Sydney, Australia
Posts: 76
I'm having some trouble using the AnimGif plugin.

I've managed to get the image onto my custom page, however, it isn't displaying properly, it kind of flashes bits here and there.

Has anyone else experienced this?
I've tried a couple of different gifs.
I've also tried a few versions of the plugin.

Here's some of the code I'm using.

code:

AnimGif:lay /NOUNLOAD /VALIGN=CENTER /HWND=$HWNDPARENT "$EXEDIR\sample.gif"

!insertmacro MUI_INSTALLOPTIONS_DISPLAY "searching"

Sleep 2000
Sleep 2000
AnimGif::stop ; terminates all
Sleep 1000



If I'm doing everything else properly, it may be that i'm using a WANSIS skin, it may be causing some problems.

Any pointers much appreciated.
zbd 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