|
|
#1 |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
If section is checked, show fields
I haven't been able to find what I'm looking for. It could be that I'm searching wrong as my English isn't the best.
Anyways, here is my problem: I've created an installer and now there have to be some extra options. I have 4 sections and 4 fields which have to write in 2 files. A .txt file and a .cmd file. The first 2 fields aren't a problem as they need to be filled in always. But the last to 2 fields should be hidden or grayed-out when sec04 is unchecked. So SEC04 brings the .cmd file and then the last 2 fields are needed to fill in. PHP Code:
PHP Code:
Attached is a picture of the four fields I'm reffering to. I hope you can help me with my sucky english :-) If you have any questions left, let me know! |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
should be simple enough... use SectionGetFlags or the Sections header to check if section ${SEC04} is selected or not.
If it is not selected, then use EnableWindow <control hwnd> 0 or ShowWindow <control hwnd> 0 to disable/hide the two controls. Depending on what you use to build the custom page, getting the control hwnd is either as simple as accessing the variable (NSDialogs), or as 'complex' as using ReadIniStr for InstallOptions(2/Ex), to completely fudging it yourself using GetDlgItem <parent dialog> <control id>. Edit: Quick example (NSDialogs) code: Last edited by Animaether; 5th January 2009 at 14:01. |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Instead of using labels, just use LogicLib:
code: Also make sure you put this code after you define the section in your script - Animaether's code references a section with an id of ${Hello} before the actual section is defined in the script. This will not work. I should also point out that (although if you use LogicLib, then this doesn't matter) Animaether has used the wrong operator with IntOp. It should be a single ampersand (&) and not two (&&). Two ampersands being a logical AND rather than a binary AND. Stu |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
I've tried the following options:
PHP Code:
PHP Code:
Am I doing something wrong. I already had LogicLib included. |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Have you got this code after the section declaration in your script?
At what point are you running this code? Before the install options page is shown? Stu |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
whoops - mea culpa on the single vs double ampersands; adjusting post.
Oddly enough the code does work despite the section being declared after the function, though o_O |
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Yes if you give SectionGetFlags/SectionGetText an invalid index (in this case the string "${Hello}") then it gets the flags/text of the first section in your script.
Stu |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
I've used your hint, however I can't PM at. It contains to many characters.
I've got the code behind the section declaration in the Function declaration. |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Mail to afrowuk tiscali co uk
Stu |
|
|
|
|
|
#11 | |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Code looks fine. Try putting a MessageBox in your If branch to see if it gets displayed depending on the section state.
Stu |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Jan 2009
Posts: 6
|
I think I have found one of the problems. If you look at the code I send you, what I was talking about was line: 338 t/m 342
How ever, if I'd look a few row's down where my ini files get called, should I do something there? |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|