Angus Leeming
26th May 2005 11:05 UTC
toggle section read only status?
I would like to use the isUserAdmin function (http://nsis.sourceforge.net/archive/...php?pageid=275) to toggle the read only status of a section or, alternatively, to hide the section altogether if the user does not have admin privileges.
Is such a thing possible?
Angus
glory_man
26th May 2005 11:39 UTC
Use SectionIn RO inside section to install read-only attrib, if user does not have privileges.
..section..
Call IsUserAdmin
Pop $R0
StrCmp $R0 "true" ok 0
SectionIn RO
.. other actions ..
ok:
.....
Or use SectionSetFlags.
the fifth bit represents whether the section is read-only,
To hide section change the description using SectionSetText.
Angus Leeming
26th May 2005 12:48 UTC
Perfect. Just for info, here's the code.
Many thanks,
Angus
Afrow UK
26th May 2005 19:59 UTC
Or you can just change the Section's text with SectionSetText
If you set its name to nothing "" or "-blah" it will become hidden.
-Stu