Old 10th October 2006, 14:31   #1
Korrd
Junior Member
 
Join Date: Oct 2006
Posts: 2
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 is offline   Reply With Quote
Old 10th October 2006, 16:55   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
WriteINIStr or MUI_INSTALLOPTIONS_WRITE before displaying the page.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th October 2006, 17:38   #3
Korrd
Junior Member
 
Join Date: Oct 2006
Posts: 2
Thanks. I've tried both options:
PHP Code:
Function EmpresaIN ;Funcion de entrada de la Pagina de empresasSe ejecuta justo antes de entrar a la pagina.
  
readregstr $0 HKCU "SOFTWARE\SRVP" "Sistemas" ;Formatoelem1|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?
Korrd is offline   Reply With Quote
Old 15th October 2006, 17:07   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
With MUI_INSTALLOPTIONS_DISPLAY, you're displaying EmpSel, however you modify EmpSel.ini with MUI_INSTALLOPTIONS_WRITE.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump