Reven
30th May 2005 21:25 UTC
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.
glory_man
31st May 2005 15:51 UTC
1. Move .onInit function after sections declaration.
2. Rename onInstSuccess to .onInstSuccess.
3. Add
!include "Sections.nsh"
4. Make SEC03 and SEC05 optional (/o attrib)
5. Put
StrCpy $2 ${SEC04}
in .onInit function
6. And put this code after .onInit function
Function .onSelChange
!insertmacro StartRadioButtons $2
!insertmacro RadioButton ${SEC03}
!insertmacro RadioButton ${SEC04}
!insertmacro RadioButton ${SEC05}
!insertmacro EndRadioButtons
FunctionEnd
glory_man
31st May 2005 16:23 UTC
And remove /LANG=${LANG_ENGLISH} from VIAddVersionKey (all).
Reven
3rd June 2005 19:01 UTC
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
MichaelFlya
4th June 2005 18:58 UTC
Place this at the top of the script.
!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-
Reven
4th June 2005 20:45 UTC
Thanks alot - that has solved my problem. Excellent.