Archive: prerequisites before install


prerequisites before install
I have an .onInit Function that query the user computer registry. How can I skip one of the Section of code? I try to make an if statement around the section but it only ways to be in the section. If I have it in the section then it still will be display on the Choose componects page. Any help will be great


http://nsis.sourceforge.net/Skipping_Pages


The IF-test should indeed be within the Section... e.g.


Section mySection mySec
If the registry value was not okay goto _skip
[section code]
_skip:
SectionEnd


At the same time, after you check the registry, you can hide the section from the install options list by settings its text blank:


4.9.13.3 SectionSetText
section_index section_text
Sets the description for the section section_index. If the text is set to "" then the section will be hidden. The error flag will be set if an out of range section is specified.


e.g.


SectionSetText ${mySec} ""


So...
1. hide the section from the list
2. make the section code ignored based on the IF-test

I am not sure how to set the description for the section to "". This is the code I have where would I put and where would I set the sectionSetText ${mySec} ""?

Function .onInit
ReadRegStr $R1 HKLM "SOFTWARE\Anoto\penDirector\settings" "padName"
FunctionEnd

Section "RoutePen"
${If} $R1 <> 'penDispatcher.pad'
messageBox MB_OK 'InstallSoftware'
${EndIf}
SectionEnd