Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   prerequisites before install (http://forums.winamp.com/showthread.php?t=300558)

tjmcdevitt 2nd December 2008 20:29

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

Yathosho 2nd December 2008 21:03

http://nsis.sourceforge.net/Skipping_Pages

Animaether 2nd December 2008 23:49

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

code:

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:

code:

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.

code:

SectionSetText ${mySec} ""



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

tjmcdevitt 4th December 2008 13:38

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


All times are GMT. The time now is 04:42.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.