Archive: Defaul value for DropList


Defaul value for DropList
Hello,

I have a custom page with more 'DropList's; the "ListItems" string for eachone is "None|0|1|2|3". Prior I read from the registry their possible DWord values if present and I would show them in the droplist (as default current value). I have used the following not working code:

!insertmacro mui_installoptions_write ... "ListItems" "None|0|1|2|3"

ReadRegDWORD $0 HKLM ...

!insertmacro mui_installoptions_write ... "state" $0

When showing the custom page, in the droplist a white bar appears in place of the variable $0 instead of the right value (a number from 1 to 3):

can you give me the right code ?


The value of state needs to be correctly referred in ListItems.
In your case must be either none or 1 or 2 or 3.
I'd suggest debug your script with a massagebox to verify what actually $0 carries out.


STATE should set the value of the droplist, so your code should be working. But, you may need to make sure that (1) you are inserting the code in the right place and (2) that $0 is actually getting a valid value.

(And I assume that you are getting the right file/field name in your MUI_INSTALLOPTIONS_WRITE statement?)

PS: Looks like RedWine has beat me to it as usual! :D


I have found: in effect I had mistyped the $0 variable by $1, now it works!