- NSIS Discussion
- Turn off read-only, hidden section
Archive: Turn off read-only, hidden section
NHOCSUNG
15th December 2004 13:15 UTC
Turn off read-only, hidden section
my code look like this
section "something" SEC01
SectionIn RO
...
sectionend
section "-hidden" SEC02
SectionEnd
Function .onInit
FunctionEnd
Function CustomPage
/////// I'm trying to turn SEC01 and SEC02 with macro in
//////// Sections.nsh but it didn't work
FunctionEnd
kichik
16th December 2004 18:17 UTC
There are not enough details in your example to understand what's wrong.
Afrow UK
16th December 2004 20:50 UTC
Use SectionSetText ${SEC02} "text" to make the section visible on the components page.
-Stu
NHOCSUNG
18th December 2004 18:03 UTC
here the code
!macro OFFSEC NUMBER
StrCpy $R1 "1"
loop:
StrCpy $R1 $R1 + 1
!insertmacro SetSectionFlag ${SEC0$R1} ${SECTION_OFF}
IntCmp $R1 "$NUMBER" +2 0
Goto loop
!macroend
thank you guy i found down how to turn this off, i got another trouble, with this code
Afrow UK
18th December 2004 18:19 UTC
You are confusing run-time commands with compile-time commands.
You must do this:
!macro OFFSEC
!insertmacro SetSectionFlag ${SEC01} ${SECTION_OFF}
!insertmacro SetSectionFlag ${SEC02} ${SECTION_OFF}
!insertmacro SetSectionFlag ${SEC03} ${SECTION_OFF}
...etc
!macroend
-Stu
kichik
19th December 2004 16:05 UTC
There is a way to do it in a loop. If it is known that the sections are sequential then it is known their ids are also sequential. So, if you have:
Section "one" SEC1
SectionEnd
Section "two" SEC2
SectionEnd
Section "three" SEC3
SectionEnd
Something like the following should work:
StrCpy $0 ${SEC1}
loop: IntOp $0 $0 + 1
IntCmp $0 ${SEC3} 0 0 end
!insertmacro UnselectSection $0
Goto loop
end:
NHOCSUNG
22nd December 2004 14:07 UTC
thanks you guy
i know how to turn all the section off, there something wrong, this is real code
Section "-Uninstall"
Call Uninstall
SectionEnd
Section SEC1
SectionEnd
Section SEC2
SectionEnd
Section SEC3
SectionEnd
Function CustomPageLeave
Modify:
Repair:
Uninstall:
Turn off SEC1, SEC2, SEC3
The Uninstall working, but the ProgressBar have been stop in the middle,
If I turn off with no loop the progreeabar go to complete.
FunctionEnd
Function Uninstall
GetFlags .....
FunctionEnd
Afrow UK
22nd December 2004 16:13 UTC
Sounds like you've got something infinately looping (ie a Goto).
-Stu
NHOCSUNG
27th December 2004 21:13 UTC
i think section set flags section can't be loop or use any macro....
SetionSetFlags ${SEC02} "0"
normally unselected a section we have to put this command under sections ... if include macro Section.nsh then the complier can't recognize which section to set.... am i right you guy???
kichik
4th January 2005 15:16 UTC
As SEC02 is a define, it must be used after the section is declared.