Use section index in .nsh header file?
As the question says: I´m trying to use the section i开发者_运维技巧ndex in a .nsh file which configures pages and includes custom pages. I´m trying to do so with the function SectionSetInstTypes.
When I try to get the INST Type with SectionGetInstTypes it´s not working the output is always 7.
This is my code in the header file for the inst type:
*SectionSetInstTypes ${Section2} 1 SectionGetInstTypes ${Section2} $R4 messagebox mb_ok "$R4"*
Is there no or any possibility to get the index in the .nsh files?
NSIS does not really care if the code is in a .nsh or your main .nsi but a section index is only valid after the section!
Section
SectionGetText ${mysec} $0 ;will generate compiler warning
DetailPrint $0 ;$0 is ""
SectionEnd
Section "Hello" mysec
SectionEnd
Section
SectionGetText ${mysec} $0
DetailPrint $0
SectionEnd
So your sections need to be above your !include in your .nsi...
精彩评论