Andrew Francis
11th March 2003 07:49 UTC
InstallOptions in a Section, not a Page
Hi everyone (and NSIS coders in particular :) )
InstallOptions crashes for me in NSIS 2beta0. Specifically, it appears to work until I click a button at the bottom of the dialog. Searching the forum, I found this thread, which indicates that I can only use InstallOptions inside a Page, not a Section.
However, I only want the dialogs to appear when the user has chosen a particular item. While I could fudge around with Pages and global variables, it would make the script a lot messier. My current solution is to use the InstallOptions.dll from NSISv1.98 in my NSISv2 script. It works fine within a Section.
However, I'd prefer to migrate entirely to NSISv2's InstallOptions. I was wondering if anyone knows why the v1 InstallOptions works within a Section, but the v2 InstallOptions doesn't.. and if it would be possible to hack the v2 DLL around so it once again works inside a Section.
I've done a diff of the source for both versions, but there's too much in there for me to spot this particular difference. Anyone able to throw me a bone? :)
Thanks, Andrew.
Joost Verburg
11th March 2003 11:20 UTC
You can skip the page if the user has not selected the section.
kichik
11th March 2003 15:20 UTC
As Joost said you can use:
PageFunc
SectionGetFlags${MySec} $0
IntOp$0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} 0 skipPage
# show page here...
skipPage
FunctionEnd
>
If you don't want to use this way and still want to change InstsallOptions source then you'll have to revive ParentWndProc and cfgDlgProc.
Joost Verburg
11th March 2003 15:24 UTC
Using pages is also useful because the buttons will have the right texts.
Joost Verburg
11th March 2003 18:29 UTC
And don't forgot to add:
!include "Sections.nsh"
Andrew Francis
12th March 2003 06:47 UTC
Thanks guys, I'll take a look at both options.
Yathosho
4th May 2003 18:02 UTC
is there an example how to use this?
Joost Verburg
5th May 2003 14:15 UTC
Use the code as pre function for the page. If the section has not been selected, the page will be skipped.
Yathosho
21st August 2003 19:13 UTC
i put together the results of private chats with kichik and joost. an example based on the original InstallOptions.nsi can be found here.