Archive: hard disk drive letter


hard disk drive letter
Hi all,

I have a problem in my NSIS Script. I have to install my software in a specific directory and so, I don't need to use the macro MUI_PAGE_DIRECTORY. But I want to let the user choose his hard disk letter such c:,d:,e: ....
I found in your examples a fonction which return every drive letters I need. It's very practise to use it.
I would like to put the result of this function in a droplist in an install options screen which is described in a .ini file. The problem is that the droplist is initialized when I compile my script and I would like to initialize it at the run time of my script. Is it possible ?
Or is there another solution to let the user choose the hard disk drive letter ?

Thanks a lot for your answer.


In your custom page, before you invoke InstallOptions::initDialog, use WriteINIStr to the entry in the correct field for the DropList


...
Page Custom Pre Post
...
Function Pre
Call FindDrives ; Finds drive letters
Pop $R0 ; Has drive letters formatted for list box
WriteINIStr "$PLUGINSDIR\droplist.ini" "Field 1" "State" "$R0"
InstallOptions::initDialog /NOUNLOAD
...
FunctionEnd
...


[Settings]
NumFields=1
[Field 1]
Type=DropList
Top=
Bottom=
Left=
Right=
Height=
Width=

Thanks a lot goldy !!!
Your idea seems very good. I try it !!!