Archive: InstallOptions Modification


InstallOptions Modification
Hey. I required certain functionality to a dialog so I modified the InstallOptions plugin to include the following.

Added Button support:
- will return the field name instead of success, back, etc.

Added Callback or Validation before the dialog closes:
- after calling the show method, call the clean method to close the dialog.

Added /TIMEOUT to allow data refresh:
- will return "timeout" instead of success, back, etc.

This was made more for my requirements but if you have a use for it, glad to hear. If anyone can see any problems or has any suggestions I would appreciate them.

Thanks


since i'm using beta 4 cvs, i have the following problem using installoptions. the script does not use modern ui!

when the components page is displayed, the captions say "$NAME Setup: Installtion Options", which should be displayed on the IO page instead. in beta 3 the page was called with Page custom SetCustom ": Page Title". this does no longer work. is it my fault or is that a bug?


try the following:
Page custom SetCustom "" ": Page Title"


it still appears on the components page, and it doesnt use my text (still Installation Options).


Does a caption of a custom page appear on the components page? That's weird. Can you attach your script and a screenshot?


not trying to call installoptions from within the the component page are you? Like this...

Page components CustomPage
Function CustomPage
installoptions::dialog "test.ini"
Pop $0
FunctionEnd


it is NO mui installer. this code is a template, in case you're wondering about thos ##'s.


when I compile it I get the component dialog with the title
"##PACKTITLE##CATALOGUE Setup: Install Options"
Then I get the custom dialog with this title
"##PACKTITLE##CATALOGUE Setup: Page Title"

Thats the way it should be


Installation Options is the normal text for the component page (you can set options for the installation). This is not related to the InstallOptions plug-in.


oh ok, so i was only confused by the terminology. anyway, the io page doesnt have that caption for me, its only "name setup".


works now


good to hear


dselkirk

I would like to use your modified verstion of the InstallOptions plug-in.

Any change you could upload/attach an archive that contains the compiled dll too?

Thanks


Here ya go.


Any chance this code will get added to the official dll?
I think that any additions could be added...

Edit: BTW, the added Button support...
Does that allow to add another button, or just support on the current buttons?
I think it would be nice if we could add a clickable active button which would call an NSIS function...
E.g. add a "Settings" button on our IO page to call Function Settings, which would ExecWait another installer containing the settings dialog.

-Stu


Fixed an offset issue with returning the appropriate button field name. Had to take in account the FileRequest and DirRequest types that have 2 controls.

Afrow UK: take a look ate test.nsi for an example.


This modification will be reviewed and possibly merged after NSIS 2 comes out. I don't really want to add new features now, I want to concentrate on bug fixing and testing.

BTW, to validate before the page ends you can use the leave function.


Originally posted by kichik
I don't really want to add new features now, I want to concentrate on bug fixing and testing.
That means no integrated 7-zip support before nsis 2 release?

It's already in progress so it won't stop now.


Have a bug with this modification:

I used it in my installer as a page. After going to the page with your InstallOptions, going a page back (Start Menu) and returning again, it doesn't show the page anymore. Tried everything but it continues. Maybe I can put a screenshot here but not now. Thanks for a great modificated InstallOptions!


are you calling InstallOptions::clean before you go back?


Yes.


The standard InstallOptions in the latest NSIS development version now supports most of these features (all except the timeout idea). It has been done slightly differently but the effect is the same.

See the latest InstallOptions documentation and the new testnotify.nsi example script for all the juicy details!


Great work!


I tested the new version by using the new examples. I've only a small question. What kind of SendMessage Parameter can enable/disable a checkbox?


You can't do that with messages. For that you need the EnalbeWindow Win32 API function which is also available as a script instruction. TestNotify.nsi example shows how to use it.


works like a charm. I've two more questions:

1. How can i change the state of a checkbox? Using WriteIniStr doesn't - probably because IO doesn't re-read the ini file.

2. I have a input Field with the following settings:

[Field 5]
Type=Text
Left=20
Right=50
Top=80
Bottom=95
MinLen=3
MaxLen=3
Flags=ONLY_NUMBERS

If i don't use the leave page the input is checked. I.e. you can't continue until the length requirements are met. But if i use a leave page the input isn't checked. Any reasons?


  1. Use BM_SETCHECK (!define BM_SETCHECK 0x00F1)
  2. The validation function was called after the leave function. Thanks, fixed.