- NSIS Discussion
- InstallOptions Modification
Archive: InstallOptions Modification
dselkirk
19th September 2003 19:01 UTC
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
Yathosho
19th September 2003 19:32 UTC
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?
dselkirk
19th September 2003 19:58 UTC
try the following:
Page custom SetCustom "" ": Page Title"
Yathosho
19th September 2003 20:07 UTC
it still appears on the components page, and it doesnt use my text (still Installation Options).
Joost Verburg
19th September 2003 20:11 UTC
Does a caption of a custom page appear on the components page? That's weird. Can you attach your script and a screenshot?
dselkirk
19th September 2003 20:16 UTC
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
Yathosho
19th September 2003 20:17 UTC
it is NO mui installer. this code is a template, in case you're wondering about thos ##'s.
dselkirk
19th September 2003 20:23 UTC
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
Joost Verburg
19th September 2003 20:33 UTC
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.
Yathosho
19th September 2003 20:35 UTC
oh ok, so i was only confused by the terminology. anyway, the io page doesnt have that caption for me, its only "name setup".
Yathosho
19th September 2003 21:40 UTC
works now
dselkirk
19th September 2003 21:44 UTC
good to hear
jfn
22nd September 2003 10:31 UTC
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
dselkirk
22nd September 2003 13:37 UTC
Here ya go.
Afrow UK
22nd September 2003 18:50 UTC
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
dselkirk
22nd September 2003 20:13 UTC
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.
kichik
22nd September 2003 20:15 UTC
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.
DOCa Cola
23rd September 2003 16:53 UTC
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?
kichik
23rd September 2003 17:15 UTC
It's already in progress so it won't stop now.
deguix
1st October 2003 01:01 UTC
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!
dselkirk
1st October 2003 02:06 UTC
are you calling InstallOptions::clean before you go back?
deguix
3rd October 2003 00:34 UTC
Yes.
eccles
5th December 2003 22:28 UTC
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!
dselkirk
7th December 2003 21:30 UTC
Great work!
flizebogen
8th December 2003 12:16 UTC
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?
kichik
8th December 2003 12:45 UTC
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.
flizebogen
8th December 2003 13:37 UTC
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?
kichik
8th December 2003 14:08 UTC
- Use BM_SETCHECK (!define BM_SETCHECK 0x00F1)
- The validation function was called after the leave function. Thanks, fixed.