- NSIS Discussion
- Several dialogs with Install Options
Archive: Several dialogs with Install Options
Nideco
23rd April 2002 17:29 UTC
Several dialogs with Install Options
I'm trying to put in my installer 2 or more dialogs with Install Options DLL. I've tried everything to integrate them with my nsi but I canĀ“t. Has anybody done something like this? In the Install Options documentation there is an example that works ok, but only with one dialog. I need an example with more than 1 dialog.
Thanks.
Smile2Me
23rd April 2002 18:21 UTC
Hi Nideco,
take a look here: http://forums.winamp.com/showthread....hlight=RegCode
It creates two pages in the installer: one where a user can insert his/her name and code, and one with the result of checking this code.
Good luck, greetz,
-Hendri.
[Edit]
Actually, some typos where in the file at the link above. Fixed now. See the attachment. -Hendri.
[/Edit]
Nideco
24th April 2002 09:27 UTC
Thank u for the code, Smile2me but it's not exactly what I'm looking for. The problem is that in 'regcode' when you are in the second dialog you disable the back button. I want to go backward and forward whenever I want. And I also want to call different .ini (to configure the dialogs), if it's possible.
Smile2Me
24th April 2002 10:04 UTC
The disabling of the back-button can be adapted, look at the source for this. It's not necessary to disable the back button. It's necessary in the context of the RegCode but not required.
For the ini thing. You can call as many different ini's as you like. I just made some general function "RunRegged" to call the same ini twice because I modify the ini. It's also possible to use other ini's.
What is important for you to know when using InstOpts for inserting pages is the construction in .onNextPage and in .OnPrevPage where the new pages are contructed. This is done using a counter for the page numbers (here $R9). When the page number is what you like it to be, insert a page.
Summary, the things you want to do are all possible!
Good luck,
-Hendri.
Nideco
24th April 2002 10:25 UTC
I think the solution it's not so easy. The problem is that when you are in the dialog made with InstOpt you can't trigger the functions .OnPrevPage and .OnNextPage, so you have to capture $0 from the dialogs and simulate this events. Thus you can't call the InsOpt dialogs always from .OnPrevPage or .OnNextPage and this makes the code quite difficult.
Smile2Me
24th April 2002 12:29 UTC
Hi Nicedo,
here is the source of two examples:
the first displays two ini's that are not straight after each other;
the second displays two ini's straight after each other.
It is indeed not straightforward, but still possible...
Good luck, let me know if this helps you out, greetz,
-Hendri.
Nideco
24th April 2002 15:22 UTC
Thanks smile2me, it works!! it's really cool! :up:
eccles
24th April 2002 22:29 UTC
I struggled with multiple Install Options pages recently too, so I had a go at making the process a little easier to handle.
Here's Hendri's two examples again using this possible method - note the differences between setup1.nsi and setup2.nsi (just 1 line changed, other than comments)!
Hope someone finds this useful... :)
--
Dave
Smile2Me
25th April 2002 10:43 UTC
Nice work Dave!
I knew my source was messy, but I got it to work and was happy with that :) Thx for clearing the source up!
Greetz,
-Hendri.
eccles
25th April 2002 22:27 UTC
Originally posted by Smile2Me
I knew my source was messy, but I got it to work and was happy with that :) Thx for clearing the source up!
Heh! I've got nothing against your code :D I just thought there must be a way to generalise the process a little!
Now... how can we make it
even more efficient/configurable/etc... ;)
--
Dave
Smile2Me
28th April 2002 09:35 UTC
Well, here's a little modification of Dave's code. I changed the check for CustomPage. Now it's not necessary anymore to edit the script (add labels and checks for CustomPageD/E/F/...) if you want to add new pages. Just edit the definition of ${PAGES} and the code will do the rest.
[Edit]
Now... how can we make it even more efficient/configurable/etc...
This modification is a little contribution to achieving this goal, but the major achievement was that of Dave with his multini2.
[/Edit]
Have fun, greetz,
-Hendri.
eccles
28th April 2002 23:02 UTC
Hi Hendri
Aha, I like it ;)
Currently working on multini4... (although a bug with the new !insertmacro has just held me back)...
[edit]
(this bug)
[/edit]
--
Dave.
eccles
15th May 2002 21:50 UTC
Originally posted by eccles
Currently working on multini4...
Mmm, I got a little sidetracked :hang:
Any interest in me completing this? I started trying to turn it into a macro and more configurable (but hopefully not bringing in too much complexity again...)
--
Dave.
Smile2Me
16th May 2002 06:29 UTC
Dave,
I'm certainly interested in nice NSIS scripts! Try to complete your idea!
Good luck,
-Hendri.
eccles
16th May 2002 08:18 UTC
Ok, will do... :)
eccles
7th June 2002 00:16 UTC
Ok, I can't put this off any longer. You'll just have to have this the way it is :D
Now included is CustomPages.nsh which defines a macro for encapsulating all the page number tracking, plus more. Multini4.nsi uses this.
I had ideas for other examples using the macro, but they'll have to wait :)
Have fun!
Dave.
Smile2Me
7th June 2002 07:52 UTC
Good work Dave!
-Hendri.
Smile2Me
11th June 2002 08:47 UTC
Using MultIni4 I redesigned RegCode for easy implementation. The script only needs an adjustment of the PAGES string if you have other components or if you want the pages to be displayed at another location in the installer.
And of course your custom RegCode checker should be inserted, but that is easy, see the script. Currently the script has a tempentry to test the cases Valid/Invalid regcode. Delete this entry to make it a fully working script.
Have fun,
-Hendri.
martijntijn
5th November 2007 10:39 UTC
When i use the multiini4 and compile the nsi, i get the following two warnings:
install function ".onNextPage" not referenced - zeroing code (7-10) out
install function ".onPrevPage" not referenced - zeroing code (10-13) out
And i don`t see the two options pages...
martijntijn
5th November 2007 10:45 UTC
[code]
Function: ".onUserAbort"
Error: Function named ".onUserAbort" already exists.
[\code]
What does it mean? This is functions exist only once in my nsi...
Afrow UK
5th November 2007 10:53 UTC
.onUserAbort is used by Modern UI.
Use !define MUI_CUSTOMFUNCTION_ABORT MyOnUserAbort
Stu