hungryOrb
19th March 2008 17:32 UTC
Radio button values
Ehm.. please could I ask what the default and selected values of radio buttons are?
May I also ask how to refer to the fields from a custom page in an IF statement? atm I have something like this:
If MUI_INSTALLOPTIONS_READ "Custom" "Field 4" "selected"
!insertmacro MUI_INSTALLOPTIONS_READ $Autoupdate "Custom" "Field 4" "State"
Endif
If MUI_INSTALLOPTIONS_READ "Custom" "Field 4" "selected"
!insertmacro MUI_INSTALLOPTIONS_READ $Autoupdate "Custom" "Field 5" "State"
Endif
That's gotta be so wrong ;D
Red Wine
19th March 2008 17:39 UTC
You set the default values when you're editing the INI. 1 means selected 0 means unselected.
As for the code snippet above, doesn't look like NSIS coding :)
You better explain what exactly you're trying to achieve.
hungryOrb
19th March 2008 17:45 UTC
:] Thanks RW
well, i'd like to make an auto update function which just sends a selected or not variable to registry. I thought If's might be the way to go ^.^
Red Wine
19th March 2008 17:57 UTC
I guess you mean LogicLib's ${If} statement, certainly you have to examine included examples and documentation.
However, I'm just guessing that field 4 is radio button and you want to get user's input. In this case there must be at least a second grouped radio button, otherwise you should add a checkbox instead.
!include LogicLib.nsh
;.......
;.......
!insertmacro INSTALLOPTIONS_READ $Autoupdate "Custom" "Field 4" "State"
${If} $Autoupdate = 1 ;control is selected
;do actions regarding to selected
${Else}
;do actions regarding to unselected
;or do nothing
${EndIf}
hungryOrb
19th March 2008 18:11 UTC
OH thankyou RW!
Yeah, i'm like a kitten trying to be a lion atm :/
But that does make sense, so I'm learning :)