Skip to content
⌘ NSIS Forum Archive

SpiderBanner plugin

36 posts

JasonFriday13#

SpiderBanner plugin

I have been working on this plugin for two or three months now. This is a test version so that the bugs (if any) are fixed. I have included my SimpleBg plugin with this test installer. I haven't posted on this forum in ages, so its good to be back.

For those who create plugins in C, I will share the basic idea behind the plugin. It displays a custom dialog with no border, and is a child of the parent window. Then the parent window is resized to fit the custom dialog. Much the same way the installer shows its pages. I had to subclass the progress bar and detail text so that I could show the info on my custom dialog.
Backland#
Looks good so far, I ran it a few times, and there were redraw problems with the header and status labels.
JasonFriday13#edited
Nope, I just didn't bother putting them in in the first place.

[edit] My plugin doesn't touch those fields, its purely MUI controlled.

[edit again] I have found a major issue with minimizing and restoring the window. Looks like I will have to subclass the installer window after all.
sag47#
how did you get the installation to loop around with pushing the finish button? NSIS src would be nice. thx
SAM
JasonFriday13#
It is this nice little trick with the SendMessage command:

SendMessage $HWNDPARENT "0x408" 1 0

The no. 1 is how many pages to skip. 2 skips two pages foward. -3 skips three pages back.
JasonFriday13#
I finally figured out the window problem. Here is another test version. And I didn't have to subclass the installer window 😁 .
JasonFriday13#
This is the final test version before I officially release this plugin. I will try my best to fix any bugs if you manage to find any.

I still have to write up the documentation and examples, but it shouldn't take that long.

I also managed to cut 512 bytes off the plugin by removing some hide and show routines. The plugin is now 6 kb 😁.
JasonFriday13#
Yeah, I'm gonna have to look though the source code for the installoptions plugin, to see where the repainting routines are.
JasonFriday13#edited
Lets try this again. Here is the final test version before I officially release this plugin.

I have fixed the redraw problem, and in turn this also fixed another minor redraw problem.

[edit] Now I am going to take as much unneeded code out as I can to get the size down.
JasonFriday13#
Oops, forgot the attachment.
JasonFriday13#
This plugin is now available on the wiki.

JasonFriday13#edited
Fixed a minor bug. Now the Destroy function can be called in the leave function of the instfiles page, or if you feel like it, you can call it on the pre and show functions of the next page 😁. Enjoy.

[Edit] This is the most advanced plugin I have ever coded for nsis. I've come a long way since the SysRestore plugin 🙂 .[/edit]

JasonFriday13#
It doesn't matter what interface you have, as long as you have an InstFiles page, and your installer isn't silent, this plugin will work with it. You can see this with the examples I posted earlier (default UI, MUI, ISUI). I doubt it will work with skinned UIs (eg, ExperienceUI), but you never know, it might work.
JasonFriday13#
A new version has just been released. This version fixes the progress bar not working under Windows 98, and now the window is "hidden" (moved to the bottom right of the screen) while the dialog is being loaded. I noticed this bug after I saw the installing page on the parent before the dialog was being destroyed. It should be fixed now. Plus, the size is still 6kb 😁. Wiki link below.

valentz142#
Hi Jason,

It is a good plugin, anyway i found 2 bugs accidentally, normal user i believe won't do this.
Using example.nsi that provided in SpiderBanner_plugin.zip, here are the errors:
1. inserting "SpiderBanner::Show /NOUNLOAD $R0 $R1" again between "SpiderBanner::Show /NOUNLOAD $R0 $R1" and "SpiderBanner:😁estroy" will close installer immediately

2. click and hold banner, until get MUI's finish page, release mouse, and could not click anything, until press CTRL+ALT+DEL and click cancel.

Hopefully could strengten your plugin.
JasonFriday13#
Hello. Thanks for the reply.

1. This problem is easily fixed. I did this fix on one of my other plugins that needed it. A good programmer will never do the same thing twice with this plugin.

2. This problem is not with my plugin, but with nsis itself. Try it with this very simple test installer I have attached.

[edit]This is the script used:
Name "Test"
OutFile "Test.exe"

!include "MUI.nsh"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

Section "Test"
DetailPrint "This is a test."
Sleep 1000
Sleep 1000
Sleep 1000
Sleep 1000
Sleep 1000
SectionEnd
[/edit]
JasonFriday13#
New version now available on wiki. Fixes bug no. 1 above.

JasonFriday13#
Hi guys, I've been working on an update to my plugin, and there is a new version released on the wiki. Uses the new plugin api, which means NSIS 2.42 or higher is required. Next project is updating the InstallSpiderUI with the latest versions of my software and MUI2. Enjoy!

mrphantuan#
Originally Posted by JasonFriday13 View Post
Hello. Thanks for the reply.

1. This problem is easily fixed. I did this fix on one of my other plugins that needed it. A good programmer will never do the same thing twice with this plugin.

2. This problem is not with my plugin, but with nsis itself. Try it with this very simple test installer I have attached.

[edit]This is the script used:
Name "Test"
OutFile "Test.exe"

!include "MUI.nsh"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

Section "Test"
DetailPrint "This is a test."
Sleep 1000
Sleep 1000
Sleep 1000
Sleep 1000
Sleep 1000
SectionEnd
[/edit]
Thanks you a lot!



JasonFriday13#
Been tinkering around with unicode, and currently I have working ANSI and Unicode versions from the same source code 😁. Currently in the process of updating all my plugins to support unicode, including InstallSpiderUI which will have a custom plugin containing code from 3 of my plugins. Watch this space 😉 .
JasonFriday13#
Just updated my SimpleBg and SpiderBanner plugins. Both had minor fixes in preparation for x64 support, and the SpiderBanner plugin had an unloading bug fixed and some code cleanup. The ansi and unicode versions are still the same size (5kb for SimpleBg and 10kb for SpiderBanner, it was tough keeping it this size).

Check it out on the wiki:

SimpleBG plugin

SpiderBanner plugin
JasonFriday13#
I have done some minor tweaks to both SimpleBg and SpiderBanner plugins, both had similar updates:

Removed msvcr*.dll dependency, strings are dynamically allocated now.

SimpleBg plugin available here: http://nsis.sourceforge.net/SimpleBg_plug-in.

SpiderBanner plugin available here: http://nsis.sourceforge.net/SpiderBanner_plug-in.
develar#
@JasonFriday13 Your plugin is the best to build one-click installer. We use it in the https://github.com/electron-userland/electron-builder (windows installer for Electron app).

Is it possible to specify custom icon file as banner image (instead default app exe icon)? I found place in the code where I can fix it — https://github.com/electron-userland...ment-228267211 but I am totally unfamiliar with nsis plugin/c API 🙂 Maybe for you it will be easy to support it.
JasonFriday13#
Icons are a bit harder to support because of trying to pass it on the nsis stack to the plugin. I can add support for it though, it's been a couple of years since I've even looked at the code.

That code you linked to is the exact part I can change, I'll probably add an option to load an icon from file or from the installer resources.

I'll check it out soon, no promises though.
JasonFriday13#
I've improved the SpiderBanner plugin again, now a flag can be specified multiple times and only the last one takes effect. I've also added support for loading an icon from a file, usage is in the documentation readme.

Available from here: http://nsis.sourceforge.net/SpiderBanner_plug-in.