Skip to content
⌘ NSIS Forum Archive

Load a droplist

4 posts

Korrd#

Load a droplist

Hello.

Is there a way to load a "DropList" from a variable?
I need to load the list from a registry key in the following format : "element1|element2|element3|...|elementN" I think that is the right format for the "listitems" property of the control.

I'm writing a patch that reads that value from the registry, which was written by the installer.

I know how to work with the registry. The only thing I don't know is how to send the content of the var to the "DropList".

I searched the forums, but didn't find anything.

Help would be appreciated.
Thanks.
Korrd#
Thanks. I've tried both options:
Function EmpresaIN ;Funcion de entrada de la Pagina de empresas. Se ejecuta justo antes de entrar a la pagina.
  readregstr $0 HKCU "SOFTWARE\SRVP" "Sistemas" ;Formato: elem1|elem2|elem3|...|elemN
  !insertmacro MUI_INSTALLOPTIONS_WRITE "EmpSel.ini" "Field 3" "ListItems" $0
  ;writeinistr "Empsel.ini" "Field 3" "ListItems" "1|2|3" ;para ver si funciona...
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "EmpSel"
FunctionEnd 
Still, the DropList appears empty.
For what I've seen, the function just writes an ini file in "C:\windows\temp" directory...
But what i need is to load the DropList on runtime from a registry key. Is there any way to do that?
kichik#
With MUI_INSTALLOPTIONS_DISPLAY, you're displaying EmpSel, however you modify EmpSel.ini with MUI_INSTALLOPTIONS_WRITE.