Old 11th March 2003, 06:49   #1
Andrew Francis
Junior Member
 
Join Date: Feb 2003
Location: Perth, Western Australia
Posts: 8
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.
Andrew Francis is offline   Reply With Quote
Old 11th March 2003, 10:20   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
You can skip the page if the user has not selected the section.
Joost Verburg is offline   Reply With Quote
Old 11th March 2003, 14:20   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
As Joost said you can use:

PHP Code:
Function PageFunc
  SectionGetFlags 
${MySec} $0
  IntOp 
$$& ${SF_SELECTED}
  
StrCmp $${SF_SELECTED0 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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th March 2003, 14:24   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Using pages is also useful because the buttons will have the right texts.
Joost Verburg is offline   Reply With Quote
Old 11th March 2003, 17:29   #5
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
And don't forgot to add:

!include "Sections.nsh"
Joost Verburg is offline   Reply With Quote
Old 12th March 2003, 05:47   #6
Andrew Francis
Junior Member
 
Join Date: Feb 2003
Location: Perth, Western Australia
Posts: 8
Thanks guys, I'll take a look at both options.
Andrew Francis is offline   Reply With Quote
Old 4th May 2003, 17:02   #7
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,351
is there an example how to use this?
Yathosho is offline   Reply With Quote
Old 5th May 2003, 13:15   #8
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Use the code as pre function for the page. If the section has not been selected, the page will be skipped.
Joost Verburg is offline   Reply With Quote
Old 21st August 2003, 18:13   #9
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,351
i put together the results of private chats with kichik and joost. an example based on the original InstallOptions.nsi can be found here.
Yathosho is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump