Old 11th August 2007, 10:34   #1
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.
Attached Files
File Type: zip spiderbanner example.zip (46.2 KB, 609 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 11th August 2007, 11:00   #2
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Looks good so far, I ran it a few times, and there were redraw problems with the header and status labels.
Backland is offline   Reply With Quote
Old 11th August 2007, 13:45   #3
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile

Last edited by JasonFriday13; 11th August 2007 at 16:02.
JasonFriday13 is offline   Reply With Quote
Old 11th August 2007, 16:59   #4
sag47
Member
 
Join Date: Dec 2006
Posts: 50
Send a message via AIM to sag47
how did you get the installation to loop around with pushing the finish button? NSIS src would be nice. thx
SAM
sag47 is offline   Reply With Quote
Old 11th August 2007, 18:26   #5
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 11th August 2007, 18:30   #6
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
I finally figured out the window problem. Here is another test version. And I didn't have to subclass the installer window .
Attached Files
File Type: zip spiderbanner example.zip (46.3 KB, 539 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 11th August 2007, 19:11   #7
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
yep, that fixed it
Backland is offline   Reply With Quote
Old 14th August 2007, 12:07   #8
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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 .
Attached Files
File Type: zip spiderbanner example.zip (46.1 KB, 576 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 14th August 2007, 14:27   #9
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
I'm seeing the redraw issues again the last version...
Backland is offline   Reply With Quote
Old 15th August 2007, 11:48   #10
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
Yeah, I'm gonna have to look though the source code for the installoptions plugin, to see where the repainting routines are.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 17th August 2007, 11:37   #11
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.
Attached Files
File Type: zip spiderbanner example.zip (46.3 KB, 516 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile

Last edited by JasonFriday13; 17th August 2007 at 14:04.
JasonFriday13 is offline   Reply With Quote
Old 18th August 2007, 04:46   #12
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Yeah its fixed, looks good
Backland is offline   Reply With Quote
Old 18th August 2007, 10:03   #13
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
Here are some more examples using the ISUI and the normal UI. Enjoy.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 18th August 2007, 10:04   #14
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
Oops, forgot the attachment.
Attached Files
File Type: zip other examples.zip (78.5 KB, 588 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 19th August 2007, 05:21   #15
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
This plugin is now available on the wiki.

http://nsis.sourceforge.net/SpiderBanner_plug-in

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 24th August 2007, 09:50   #16
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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]

http://nsis.sourceforge.net/SpiderBanner_plug-in

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile

Last edited by JasonFriday13; 24th August 2007 at 10:13.
JasonFriday13 is offline   Reply With Quote
Old 26th August 2007, 03:11   #17
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Keep it up, does it work fine with the new MUI2 beta?
Backland is offline   Reply With Quote
Old 26th August 2007, 05:58   #18
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 21st October 2007, 10:53   #19
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

http://nsis.sourceforge.net/SpiderBanner_plug-in

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th November 2007, 09:12   #20
valentz142
Junior Member
 
Join Date: Dec 2006
Posts: 8
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.
valentz142 is offline   Reply With Quote
Old 12th January 2008, 15:04   #21
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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:
code:
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]
Attached Files
File Type: zip test.zip (40.4 KB, 458 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th January 2008, 18:26   #22
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
New version now available on wiki. Fixes bug no. 1 above.

http://nsis.sourceforge.net/SpiderBanner_plug-in

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 29th November 2010, 04:09   #23
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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!

http://nsis.sourceforge.net/SpiderBanner_plug-in

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 30th November 2010, 08:29   #24
mrphantuan
Banned
 
Join Date: Nov 2010
Posts: 7
Quote:
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:
code:
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!



mrphantuan is offline   Reply With Quote
Old 1st December 2010, 10:47   #25
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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 .

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 6th January 2014, 05:48   #26
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 15th September 2014, 11:20   #27
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 24th June 2016, 07:24   #28
develar
Junior Member
 
Join Date: Jun 2016
Posts: 6
@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.
develar is offline   Reply With Quote
Old 24th June 2016, 08:27   #29
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 25th June 2016, 01:36   #30
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
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.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 26th June 2016, 17:29   #31
develar
Junior Member
 
Join Date: Jun 2016
Posts: 6
@JasonFriday13 Thanks a lot! Works as expected.
develar is offline   Reply With Quote
Old 28th June 2016, 03:58   #32
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
@develar
I've been reading your other thread, and just so you know, MUI_HEADERIMAGE_BITMAP is handled behind the scenes to extract the file at runtime so that it can be displayed. This doesn't happen for plugin calls so you have to use File /oname=$PLUGINSDIR\headerico.ico "${HEADER_ICO}" to include the icon and extract it to the plugins directory, then use SpiderBanner::Show /MODERN /ICON "$PLUGINSDIR\headerico.ico" to show it.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 9th March 2017, 13:41   #33
develar
Junior Member
 
Join Date: Jun 2016
Posts: 6
@JasonFriday13 Hi. Could you please add an option to translate text "Installing, please wait..."?
develar is offline   Reply With Quote
Old 10th March 2017, 11:51   #34
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
Use this to change the text (this may not work if using other dialogs with the same parent):
PHP Code:
Name "Test"
OutFile "Test1.exe"

page instfiles

!include "winmessages.nsh"

RequestExecutionLevel user

Section
  SpiderBanner
::Show
  FindWindow 
$"#32770" "" $hwndparent
  FindWindow 
$"#32770" "" $hwndparent $0
  GetDlgItem 
$$0 1000
  SendMessage 
$${WM_SETTEXT"STR:Text changed!"
  
Sleep 3000
  SpiderBanner
::Destroy
SectionEnd 
Doing it this way means the plugin code remains unchanged. I knew it was possible to change it from the nsis script, I just never tried it until now.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 16th June 2017, 17:09   #35
develar
Junior Member
 
Join Date: Jun 2016
Posts: 6
@JasonFriday13 Thanks a lot. One note — it is very important to not forget to prepent text "STR:" otherwise text will be empty
develar is offline   Reply With Quote
Old 18th June 2017, 03:33   #36
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 854
Yep, that's why it's in the example I gave .

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 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