Skip to content
⌘ NSIS Forum Archive

AdvSplash + gif, jpeg and others

58 posts

zeeh3#
You are welcome, Takhir 🙂 and thanks a lot kichik, from now on meganoob no more, the activation arrived at last!
NukeyDoo#
I am havng a problem with the newadvsplash plugin. I grabbed the one from Takhir's wiki page, and when I run it, the sound and transparent gif show/play ok, but when it's unloading the installer crashes. I'm not sure what I'm doing wrong.

Here is the code I used:

Function .onInit

InitPluginsDir
File /oname=$PLUGINSDIR\splash.gif "F:\Projects\Test\Install\Images\splash.gif"
#optional
File /oname=$PLUGINSDIR\splash.mp3 "F:\Projects\Test\Install\Extras\splash.mp3"
newadvsplash:😛lay $PLUGINSDIR\splash.mp3
newadvsplash::show 7000 600 400 -2 $PLUGINSDIR\splash.gif

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.

Delete $PLUGINSDIR\splash.gif
Delete $PLUGINSDIR\splash.mp3

FunctionEnd

Any help is appreciated
dandaman32#
You need the /NOUNLOAD flag after newadvsplash::show:

newadvsplash::show /NOUNLOAD 7000 600 400 -2 $PLUGINSDIR\splash.gif 
-Dan
Takhir#
Yes, /nounload required, but in the first call ('play' this case). For 'modal' banner

newadvsplash:😛lay /nounload "$PLUGINSDIR\splash.mp3"
newadvsplash::show 7000 600 400 -2 "$PLUGINSDIR\splash.gif"
NathanProbst#
Small change to prevent grabbing focus...

FWIW, I have slightly modified my copy of NewAdvSplash.dll (thanks for the sources!) to add the SWP_NOACTIVATE flag to the SetWindowPos call in the WndProc function. For my purposes, it was annoying that the splash grabbed focus when it displayed. This was on or about line 105 in advsplash.cpp.

If others feel this is a useful improvement, perhaps this change could be integrated into the main source?

Nathan Probst
NathanProbst#
As a quick follow up, I also found it necessary to remove the call to SetForegroundWindow() in the function sf(). Without this change, there is an annoying momentary window activation as the display is ending.

I'd appreciate it if someone (Takhir?) could sanity-check my changes...not sure if I've broken anything!
Takhir#
Thanks, Nathan!
Default 'activate' behavior came with old AdvSplash code. I tested your variant and don't see big differences, but if we'll have more then one reqest I can add this as option. Please note 2 another places in the code: sf() function - attempts to set window foreground on splash creation and removing; TOPMOST splash window style - in some situations this also may be a bit annoying.
Takhir#
New version available:
1. /PASSIVE key - not forces splash window to foreground (last request);
2. /BANNER mode MUI sample fix.
3. Animated sample (thanks zeeh3), requires AnimGif plug-in.
torpark#
Is there no way to get PNG support?

A splash screen must have PNG for alpha transparency. Otherwise you are constricted to working in a box shape or trying to matte blend a 256 bit gif. Horrible!
Takhir#
No. Use BMP, in the compressed archive it's size is the same as for png file. Any case you need to define transparent color in the script - plug-in extracts this info from gif's only.
Takhir#
New release. No "wait" function any more, "stop /WAIT" does the trick. Another option "stop /FADEOUT" - forces banner to close, but with fade out effect ('Delay' -> 0). "stop" without options terminates banner (as it was earlier). Have fun.
585#
Hi all.

I have simle question: How can I use RUNDLL32.EXE with AdvSplash.dll?

I was trying this, but it is not right:
rundll32.exe "...path\AdvSplash.dll", show 3000 1500 1500 -1 splash.bmp
LoRd_MuldeR#
It's an NSIS plugin, you call it from an NSIS installer, not from Rundll32.exe.

I doubt the interface of NSIS plugins is compatible with Rundll's syntax. The NSIS plugin function expects a pointer to the top of the NSIS stack and it also expects the arguments to be on that stack. You can't emulate that with a Rundll32.exe, I guess...
gringoloco023#
Unicode NSIS

Hi Takhir,

I hope you are still actively developing this plugin?
Because, I am (we are) looking for NewAdvSplash, recompiled to work with Unicode NSIS.
It would be really appreciated, as we are in need of a fair few plugins with Unicode NSIS support!

Link to Unicode NSIS homepage: scratchpaper.com/home
Link our project: portableapps.com/node/21879

Thanx a lot, in advance !
Takhir#
I added Unicode decoration and dll dependencies looks good now, but unfortunatelly I don't have NSIS-Unicode installed now (keeping safe company' mainstream projects 🙂 ) so please test attached version. I only tested multibyte variant and this worked fine with gif and wav (mp3 supported currently removed because MCI crashes sometimes). Fill free to rename dll if need. If this work, I'll add new variant with both dlls to wiki.
gringoloco023#
Execelent !!! Thanx so much!!!

Done some testing and 'show' works fine, just 'play' doesn't do anything. While the same script works for Ansi NSIS.

Anyway, PortableApps.com doesn't use 'play', so I`m happy
gringoloco023#
NewAdvSplash for unicode NSIS

The link has disappeared (as many other links on this forum), and as well I couldn't find on the nsis sourceforge page, jet !

Could you please add a link again !!!

Thanx
Takhir#
Sorry, I'll update wiki page later. File attached.
Takhir#
April 10, 2010 wiki page update excludes mp3 from supported sound formats. Today I added phrase about Unicode support.
ss1969#
Originally Posted by Takhir View Post
Jpeg compression is a wellknown quality/size decision, may be usefull for a big splash images.
I only replaced LoadImage() with OleLoadPicturePath() call (and renamed project files 🙂 )

Tested on Win2K

This might be done already, but I not found "IPicture" word using forum search or in my "Contrib" folder.

For any use, of course..


I don't know if it's appropriate to discuss this thing more than a decade later... But when I tested it on Windows 11 using NSIS 3.10, I encountered an issue where, with Scaling > 100% and Delay Time > 0, the splash logo appears in two different places. Specifically, the fading position is in the center of the screen, while the logo during the delay time is not in that position. Additionally, it seems the GIF doesn't animate; I'm not sure if that's an issue on my end.

I originally wanted to compile and fix it myself, but I can't find any compilable project files (I'm using VS2022).
Anders#
The .dsw is the Visual Studio 6 project file. If you can't open that, create a new Win32 dll project. Add the source files and grab the compiler/linker settings from the .dsp file.

I'm not sure what could be causing this issue, some kind of DPI emulation going wrong or a drawing bug? What you set with ManifestDPI... in your nsi file might matter.

You could try making the window or thread DPI aware and see if that helps (makensisw has some dpi stuff you can take a look at).
ss1969#
Originally Posted by Anders View Post
The .dsw is the Visual Studio 6 project file. If you can't open that, create a new Win32 dll project. Add the source files and grab the compiler/linker settings from the .dsp file.

I'm not sure what could be causing this issue, some kind of DPI emulation going wrong or a drawing bug? What you set with ManifestDPI... in your nsi file might matter.

You could try making the window or thread DPI aware and see if that helps (makensisw has some dpi stuff you can take a look at).
Thanks, ManifestDPI set to false really helps. Now the windows size is scaled following windows, and the logo is correctly displayed.
MarkusFynd#
Hello! Please excuse my ignorance, but how do I use this plugin? I am completely new to NSIS so this might be a bit advanced for a beginner, but I'm not able to figure it out and it seems like the Wiki description isn't accurate. The plugins directory has two folders, 'x86-ansi' and 'x86-unicode', do I need to put the .dll into one or both of these? What about the rest of the contents of the downloaded .zip?
Anders#
Put the one .dll from the wiki .zip unicode folder inside NSIS\plugins\x86-Unicode and the other .dll in NSIS\plugins\x86-ANSI.