Graying out Section (define mandatory sections): Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
 
(simpler method)
Line 22: Line 22:
* Manual: 4.9.13.1 (Section Management) at http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.13
* Manual: 4.9.13.1 (Section Management) at http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.13


== Other methods ==
It's also possible to simply include the following in the section code:<highlight-nsis>
SectionIn RO
</highlight-nsis>--[[User:Kichik|kichik]] 03:59, 8 September 2006 (PDT)


[[Category:Code Examples]]
[[Category:Code Examples]]

Revision as of 10:59, 8 September 2006

Author: ssp (talk, contrib)


Description

When creating my first installer recently I wondered if it was possible to define section mandatory, so that the user can not unselect them (e.g. needed components as shared libraries).

So I stumbled across SectionSetFlags


Procedure

Just add

    SectionSetFlags ${SEC0000} 17

to

Function .onInit.

17 by the way means SF_SELECTED & SF_RO, what tells windows select the checkbox before Section SEC0000 and make it read-only. To get to know all possible SF_ flags, look at the given reference.

References

Other methods

It's also possible to simply include the following in the section code:

SectionIn RO

--kichik 03:59, 8 September 2006 (PDT)