Archive: custom page checkbox dependencies


custom page checkbox dependencies
Stupid question maybe.
I saw a lot of code the last few days.
So i'm lost here.

I have a custompage (ioEx) and a lot of checkboxes.

Is it possible when checkbox1 is enabled (from state=0 to 1) checkbox2 gets enabled and inputbox6 disabled.

Second question. I have a inputbox with "some text"
and the flag=disabled. Is it possible when a checkbox is enabled to update the text with some other text.
I got it almost working. I think. cause everything is changed in the ini file. Only the dialog is showing the first statement .


Thx Michel


Q1
Yes it is. If you set in your INI file Notify=ONCLICK for each check box that you want to control another one, then you will get notification and the page's Validate function will be called. Read the value of the State field (from the Settings section of the INI) and it will contain the number of the Field whose checkbox state just changed. Assuming that [Field 9] and [Field 10] are both checkbox fields and you want to check/uncheck [Field 9] IF [Field 10] is checked/unchecked then use something like this in your validate function:

Function ValidatePage
ReadINIStr $0 "$PLUGINSDIR\<your_ini_file>" "Settings" "State"
${If} $0 = 9
ReadINIStr $0 "$PLUGINSDIR\<your_ini_file>" "Field 9" "State"
FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $R1 1209 ; checkbox 10
SendMessage $1 ${BM_SETCHECK} 1 $0
Abort
${ElseIf} $0 = 10
ReadINIStr $0 "$PLUGINSDIR\<your_ini_file>" "Field 10" "State"
FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $R1 1208 ; checkbox 9
SendMessage $1 ${BM_SETCHECK} 1 $0
Abort
${EndIf}

...

FunctionEnd


Q2
Yes. Same as above, you should check the State of the Settings section then if the checkbox is checked use WriteINIStr to set the State of the field that corresponds to the Input field.

Hope this helps
CF

PS check the examples that come with InstallOptions, in particular testnotify.nsi ([NSIS]\examples\installoptions)

Aaahh

I checked testnotify.nsi.
But i didn't get it to work. but I see in your code the $HWNDPARENT.
I forgot that one. :o

I'm trying to make a similar app you created @ msfn.org.
I'm using it since it exists.
But I want to create my own util for custom needs.

If possible can you help me to get a users password stored in the LsaStorePrivateData

Anyways thx for your info.


I was left with the impression that you wanted to develop your app in VB and not in NSIS :confused:

As for the LSA function, I posted a similar question a while ago on this thread. I also made a Wiki page about NetAPI functions for user/group manipulation, it is a good start :)

Hope this helps
CF


Thx.
And your'e right but i found out that with NSIS you can do more. I have an account creator app with build in installer for all my temp and script files (incl. drivepacks). I use makecab en the Dcrypt.Dll for security.

I'll read your Wiki page.

Thanks CF