MichaelFlya
3rd June 2005 18:54 UTC
Custom checkbox page help.
Can anyone help me figure this out.
I have a custom checkbox page I have made. I need two
things to happen. One is when I check 1 out of 4 of the
checkboxes the other 3 go to "State 0".
My second question is and let me start off by saying, all
the options are going to a pacific directory. Although I
want to give the user the option to choose the directory
if one of the options are chose. So basically how do I make
it so the 'Choose Directory' page only comes up when the
user checks one of the boxes given?
Here is some of the code I figure most of what it will take
to help me with.
Function CheckboxInstallationPage_Function
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "CheckboxInstallationPage.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "CheckboxInstallationPage.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R2 "CheckboxInstallationPage.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R3 "CheckboxInstallationPage.ini" "Field 5" "State"
StrCmp $R0 "1" 0 +2
MESSAGEBOX MB_OK "CheckBox 1"
StrCmp $R1 "1" 0 +2
MESSAGEBOX MB_OK "CheckBox 2"
StrCmp $R2 "1" 0 +2
MESSAGEBOX MB_OK "CheckBox 3"
StrCmp $R3 "1" 0 +2
MESSAGEBOX MB_OK "CheckBox 4"
FunctionEnd
Also I am attaching the whole script and the ".ini" file.
Thanks for any help anyone can be.
-MichaelFlya-
MichaelFlya
4th June 2005 19:31 UTC
As far as getting only one check box to be selected at
one time, well it would be similar to the components page
function for .onSelChange with RadioButtons and with $1
set. Altho this isn't the components page, this is a custom
page. Can anyone help?
-MichaelFlya-
Afrow UK
7th June 2005 13:39 UTC
Why don't you use Type=Radio rather than Type=CheckBox?
You can skip the directory page by calling Abort in the page's Pre function.
-Stu
MichaelFlya
7th June 2005 18:24 UTC
Ahh Thanks a lot Afrow Uk,
Ok I used Type=Radiobutton, using just Type=Radio didn't work.
And as for the directory check. I added this code below, but the
button tells the user "Next" when in fact it is going to (Install). How
do I get the button to say "Install" when only choosing 1, 2, & 3?
; Pages For Installer
;--------------
Page Custom CheckboxInstallationPage
!define MUI_PAGE_CUSTOMFUNCTION_PRE Directorybuttoncheck
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckboxInstallationPage_Function
!insertmacro MUI_PAGE_INSTFILES
Function Directorybuttoncheck
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "CheckboxInstallationPage.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "CheckboxInstallationPage.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R2 "CheckboxInstallationPage.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R3 "CheckboxInstallationPage.ini" "Field 5" "State"
StrCmp $R0 "1" 0 +2
abort
StrCmp $R1 "1" 0 +2
abort
StrCmp $R2 "1" 0 +2
abort
StrCmp $R3 "1" 0 +1
FunctionEnd