Old 2nd December 2008, 20:29   #1
tjmcdevitt
Junior Member
 
Join Date: Dec 2008
Posts: 5
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
tjmcdevitt is offline   Reply With Quote
Old 2nd December 2008, 21:03   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
http://nsis.sourceforge.net/Skipping_Pages
Yathosho is offline   Reply With Quote
Old 2nd December 2008, 23:49   #3
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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
Animaether is offline   Reply With Quote
Old 4th December 2008, 13:38   #4
tjmcdevitt
Junior Member
 
Join Date: Dec 2008
Posts: 5
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
tjmcdevitt is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump