|
|
|
|
#1 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Two plugins
Just so that people know that they exist, I've uploaded two plugins.
EmbeddedLists.dll This displays a single selection, multiple selection or columned list box (with column headings and optional check boxes). The plugin takes its list box items from the NSIS stack. I wrote this plugin as even with the makensis 8192 string length build I felt it was unsafe when having a large number of list box items for InstallOptions list boxes (from an Internet source). ButtonEvent.dll A small 3KB dll that allows you to catch click events of any custom buttons on any NSIS dialogs. The buttons must be added to the UI files with Resource Hacker. The example included makes use of a custom button on the parent window (alongside the Next and Back buttons) and one on the Components page. -Stu |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Hi Stu,
this ButtonEvent sounds like something was really missed! It is that what I was looking for to figure some actions I have in my mind, yet, I was not able to find such code or to write one by my self. Next, I'll check it deeply to find out how it works, thus where and how it will assists me. Regards Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Well basically you just need to add a button with Resource Hacker and give it a unique ID number.
If the button is on the parent dialog (105) then call the AddEventHandler function in .onGUIInit. If the button is on a child form (inner dialog) then call it in the pages' Show function. With this accomplished, the buttons will act the same as the user clicking "Next" except an internal flag is set showing that the user in fact clicked on one of the custom buttons. For custom buttons on the parent dialog, the WhichButtonID function should be called in all pages' Leave functions (to catch the click event for all pages of the installer). For individual pages, the WhichButtonID only needs to be called for that pages' Leave function. Hope that helps. The example script displays this, but in script form. -Stu |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
The example of EmbeddedLists.dll caused the installer to crash, but it was one time crash only. It crashed after I clicked next button on the multi column page, but I am not sure about that. It might have been when initializing the check box page too.
My os is windows 2000 |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Do you have .NET Framework 1.1 installed? The plugin was written under MS VS.NET, but works fine on a Windows XP machine without .NET Framework installed. I don't have a Windows 2000 machine anymore either.
-Stu |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
I avoid .NET Framework like the plague. So no, I don't have .NET Framework installed.
|
|
|
|
|
|
#7 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'll recompile it in C++6 tomorrow and I'll post here.
How often does it crash? Have you been able to get it to crash again? -Stu |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
Yes actually I just got it to crash again. And I think I even can reproduce the crash. This time it crashed when I clicked the close button in the Installion complete page. This makes me wonder, maybe I used the cancel button instead of next button when it crashed last time. (I really should pay more attention while testing these things
)
|
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Hello.
I was able to recompile the plugin under VC++6 with minor changes. One thing that could be causing the crash (but I doubt it) is that the ListView_SetCheckState macro was undefined for VC++6 when MSDN said that it is defined from Windows 95 and upwards (with IE3+ installed). However, the compiler said otherwise. If you could re-download from the same URL and try it out I'd be very greatful. If my assumptions are correct then I'll have to avoid using VS.NET for plugin work. -Stu |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Aug 2005
Posts: 121
|
Hi Stu, I have a question for you. Can EmbeddedLists.dll be used with installoptions' custom page?
|
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Sep 2004
Location: Nottingham
Posts: 263
|
These look cool! I don't quite understand the difference between your ButtonEvent and just using the NOTIFY flag on a custom button with appropriate exit code. I haven't looked at it, only at your description.
I point this out because in the future when people are searching the wiki, it would be worth having a clear explanation
|
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
The explanation is pretty clear. You can't place a button on an existing NSIS dialog with InstallOptions. Adding it with ResourceHacker is the only way, and then it doesn't actually do anything when you click on it. This is where the ButtonEvent plugin comes in.
-Stu |
|
|
|
|
|
#13 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
zeeh3: If you want to display a list box on an InstallOptions dialog, use Type=ListBox. Note that this is a basic control without the additional features that a ListView control has (multiple columns and column headings).
-Stu |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
Sorry to say, but it still crashes. Now it crashed just like the first crash. So I guess that was right after all.
Is anyone else having problems with this plugin? |
|
|
|
|
|
#15 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Interesting. I'll have a good look at the code tomorrow.
-Stu |
|
|
|
|
|
#16 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
The Embedded Lists functionality can be achieved using InstallOptions and System plugins.
|
|
|
|
|
|
#17 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I would love to see the code to add a SysListView32 control :]
-Stu |
|
|
|
|
|
#18 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
It would be complex, but the System plugin is very powerful. Pretty much any Windows API can be invoked using it.
Right now I don't have the time, but maybe later I could look at it. |
|
|
|
|
|
#19 | |
|
Senior Member
Join Date: Aug 2005
Posts: 121
|
Quote:
![]() I was just asking for an enhaced Listbox using your plugin with custom pages. |
|
|
|
|
|
|
#20 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'm not sure what InstallOptionsEx has, but you can check that out (forum search).
-Stu |
|
|
|
|
|
#21 |
|
Junior Member
Join Date: May 2003
Posts: 3
|
how can i hide my custom button (placed where your "Try Me" button is on the example) for all pages after the welcome page? i only want the button to be pressable on the welcome page.
also trying to abort the installation after the button is pressed (after the button does its purpose, of course) (thx for your plug-in stu) |
|
|
|
|
|
#22 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Use Quit to close the installer. Abort when called in any pages' Leave function will just return the user back to the page.
To hide the button for all other pages; in their Show functions use: GetDlgItem $R0 $HWNDPARENT id_num ShowWindow $R0 ${SW_HIDE} For the page for it to be shown on; use ${SW_SHOW} instead of ${SW_HIDE}. id_num is your button control ID defined through Resource Hacker. -Stu |
|
|
|
|
|
#23 |
|
Member
Join Date: Aug 2005
Location: Australia
Posts: 71
|
Can I use ButtonEvent to catch clicks on the minimize/maximize/close buttons? Thanks.
|
|
|
|
|
|
#24 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Hmm no I never thought of that
![]() I should be able to add support for it if you want? Edit: Well only the minimise and close buttons are usable, but the close button is the same as clicking on Cancel (MUI_CUSTOMFUNCTION_ABORT is called). As for minimise what would you want to do there? -Stu |
|
|
|
|
|
#25 |
|
Member
Join Date: Aug 2005
Location: Australia
Posts: 71
|
Well,
I was thinking that it might help me with using Wansis and TrayIcon together. |
|
|
|
|
|
#26 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
So you'd like to call a function when the program is minimised or maximised?
-Stu |
|
|
|
|
|
#27 |
|
Member
Join Date: Aug 2005
Location: Australia
Posts: 71
|
I was thinking that. But whenever you click the Tray Icon to minimize/maximize, it would call the function.
|
|
|
|
|
|
#28 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
That would need to be a modification to the NotifyIcon plugin.
I'll see what I can do. -Stu |
|
|
|
|
|
#29 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|