cowwoc
2nd May 2005 15:48 UTC
Dynamically set "Required Section"?
Hi,
I want to conditionally set a section as "required" (user shouldn't be able to deselect it) depending upon runtime conditions. So for example in my .onInit function, I will verify whether the user already have a JRE installed or not and if he does not, I want the JRE installation to be a required section.
So far I found that adding "SectionIn R0" is supposed to make a section required, but this occurs at compile-time. Is there a way to set this flag at runtime?
Thanks,
Gili
glory_man
2nd May 2005 16:52 UTC
You can use SectionSetFlags instruction:
the fifth bit represents whether the section is read-only
So you must set this bit if JRE is not installed, and clear it if installed.
cowwoc
2nd May 2005 17:44 UTC
glory_man,
Care to elaborate? Are you saying this is configurable using SectionSetFlags? The documentation does not mention "section is required" as one of the possible bits you can set.
Gili
cowwoc
2nd May 2005 17:48 UTC
Oops, is this the fifth bit?
"the fifth bit represents whether the section is read-only"
Does "read-only" mean the same thing as "required"?
Thanks! :)
Gili
glory_man
2nd May 2005 17:48 UTC
There are no required sections in NSIS. All required sections are present in author's head. "SectionIn R0" set read-only attrib for section. So if you want to create "required" section you can make it read-only (user cann't change it status).
cowwoc
2nd May 2005 17:55 UTC
Originally posted by glory_man
There are no required sections in NSIS. All required sections are present in author's head. "SectionIn R0" set read-only attrib for section. So if you want to create "required" section you can make it read-only (user cann't change it status).
Makes sense. Thanks a lot!
Gili