Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th May 2005, 20:25   #1
Reven
Junior Member
 
Join Date: Apr 2005
Posts: 12
Making checkboxes radio buttons

I've tried different combinations for hours with no results.

I have five install options:

1 is automatically installed, and uncheckable.
1 is optional extras
and of the last three, only one must be selected.

The attached script is what I've done, but it always makes checkboxes and I can't make the last three options into radio buttons. Sorry about the size.

When I compile the script it says that the variables I used are unknown, so maybe that's the problem but I built the script around the example One-Section and it worked for that...

Please take a look at the script and see if you can help. Any information is much appreciated.

Cheers.

PS. I've searched the forums and found some topics, but have had no luck with them.
Attached Files
File Type: nsi test.nsi (12.5 KB, 426 views)
Reven is offline   Reply With Quote
Old 31st May 2005, 14:51   #2
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
1. Move .onInit function after sections declaration.
2. Rename onInstSuccess to .onInstSuccess.
3. Add
code:
!include "Sections.nsh"

4. Make SEC03 and SEC05 optional (/o attrib)
5. Put
code:
StrCpy $2 ${SEC04}
in .onInit function
6. And put this code after .onInit function
code:
Function .onSelChange
!insertmacro StartRadioButtons $2
!insertmacro RadioButton ${SEC03}
!insertmacro RadioButton ${SEC04}
!insertmacro RadioButton ${SEC05}
!insertmacro EndRadioButtons
FunctionEnd

glory_man is offline   Reply With Quote
Old 31st May 2005, 15:23   #3
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
And remove /LANG=${LANG_ENGLISH} from VIAddVersionKey (all).
glory_man is offline   Reply With Quote
Old 3rd June 2005, 18:01   #4
Reven
Junior Member
 
Join Date: Apr 2005
Posts: 12
Thanks for all of that, I really appreciate it.

However I still get a compile error:

Function: ".onSelChange"
!insertmacro: StartRadioButtons
!insertmacro: macro named "StartRadioButtons" not found!
Error in script "C:\Documents and Settings\Sean\Desktop\FFUR\test-2.nsi" on line 285 -- aborting creation process

I've attached my edited version. I might have edited it wrong, but it says the problem is on line 285 which reads the following:

!insertmacro StartRadioButtons $2
Attached Files
File Type: nsi test-2.nsi (12.6 KB, 428 views)
Reven is offline   Reply With Quote
Old 4th June 2005, 17:58   #5
MichaelFlya
Member
 
MichaelFlya's Avatar
 
Join Date: May 2005
Location: U.S.A.
Posts: 91
Place this at the top of the script.

code:

!include "Sections.nsh"



It doesn't need to be in a function.
You had it in .onInstSuccess and that
is a function that doesn't get called
till the installation is finished properly.

-MichaelFlya-
MichaelFlya is offline   Reply With Quote
Old 4th June 2005, 19:45   #6
Reven
Junior Member
 
Join Date: Apr 2005
Posts: 12
Thanks alot - that has solved my problem. Excellent.
Reven is offline   Reply With Quote
Reply
Go Back   Winamp 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