- NSIS Discussion
- section,strings and other adventures...
Archive: section,strings and other adventures...
Pyjamarama
20th November 2003 07:56 UTC
section,strings and other adventures...
Hi!
I have created a subsection (SubSection /e "databases" SEC01) which contains 4 sections(section "db1" db1,section "db2" db2 etc etc).
I used sectionsetflags "db1" 0 to have this section unselected but nothing happens.
Also I wanted to ask if there is a way to have some sections unselected when I select a certain section.
Finally (I hope u r not bored by now...) is there a string function equivelant to mid?
Thanx!!!!!
kichik
20th November 2003 09:56 UTC
SectionSetFlags doesn't work by the name of the section, its works by its index number. Both Section and SubSection have an extra parameter that allows you to add define with this number so you don't have to remember and change it everytime you add or remove sections. Remember, the compiler doesn't "guess ahead" values of defines, so the section definition must be above the usage of this define in the script.
See one-section.nsi for an example of unselecting sections according to another section's selection.
Use StrCpy and StrLen for all of your string processing needs.
Pyjamarama
20th November 2003 11:28 UTC
In the documentation I found this syntax
section [/e] [section_name] [section index output]
mine is
section "db1" db1
so shouldn't setsectionflags ${db1} 0 work?(make this section unselected I mean...).
kichik
20th November 2003 11:32 UTC
Yes, SetSectionFlags ${db1} 0 should work, but your earlier post said db1, not ${db1} ;)
If it still doesn't work, make sure the order in the script is right.
Section bla bla
SetSectionFlags ${bla} 0
should work, but:
SetSectionFlags ${bla} 0
Section bla bla
will not.
Pyjamarama
20th November 2003 11:53 UTC
thanx for the answer!!
But it still does not work.
sectionsetflags {db1} 0 does not have the section deselected!
In the section documentation I found something I cannot understand
...If section index output is specified, the parameter will be !defined with the section index (that can be used for SectionSetText etc)...
Should I do something more than give the section an index (eg db1)?
thanx..
kichik
20th November 2003 12:17 UTC
You're missing a dollar in that line.
Pyjamarama
20th November 2003 12:22 UTC
Sorry,I have include it in my code I just made a typo in the post...
should I define something as the section documentation states?
kichik
20th November 2003 12:23 UTC
No, it automatically defines it. Attach your script and I'll have a look.
Pyjamarama
20th November 2003 12:43 UTC
thank u very much Kichik.
The script was rather large...so I tried to cut it out.
The problem is in line 99.
i appreciate your concern
kichik
20th November 2003 12:53 UTC
Code that is in the section will run when the installation actually begins. This happens after the components page is shown which is probably why you don't see any change. I should have probably put some seperator between the two in my message, sorry.
I am begning to think that SectionSetFlags is not what you need here. Do you want to have all of the sections unselected by default? If that's the case, simply use the /o switch (only available in b4) for each section you don't want selected by default. If not, please explain when exactly you want to unselect it.
If you are still using b3, put the SectionSetFlags call in .onInit. But don't use it on the subsection, use it on every section that you don't want selected.
Pyjamarama
20th November 2003 13:08 UTC
thanx man!!!!!!
/o was what I needed.
I misinterpreted the documentation.sorry...