Archive: DirRequest, I can't get dir


DirRequest, I can't get dir
I've made an Install Options file that's basically a few labels and a DirRequest.

After the user has pressed Next, I want to get a string of the dir that they chose.

I'm not sure which entry name I'm supposed to be checking, so I've been trying to get something from State or Text, but seem to be getting nothing back.

Also I've tried using insertmacro and ReadINIStr but neither work.

  !insertmacro MUI_INSTALLOPTIONS_READ $ChosenDir1 "$PLUGINSDIR\ChooseInstallDir.ini" "Field 3" "State";  
ReadINIStr $ChosenDir2 "$PLUGINSDIR\ChooseInstallDir.ini" "Field 3" "Text"

MessageBox MB_OK "Values are = $ChosenDir1 and $ChosenDir2"


This message box just gives me "Values are = and "

Any ideas of what I'm doing wrong?

MUI_INSTALLOPTIONS_READ does not need the full path IIRC

where are you reading, you probably have to do the reading in the leave callback

if you put a messagebox in the leave function, you can inspect the .ini in you temp folder to make sure you are reading the right value and that you have the correct field id


Thanks for the reply Anders.

I was already trying to read the value in the Leave function.

I think you're right about MUI_INSTALLOPTIONS_READ, it doesn't seem to get the path.

But I've got ReadINIStr working now, thanks to your idea of using a MessageBox to display the filename.
It turned out I was using the wrong field number and the wrong filename (got 2 very similar ones).
Also it was the State that needed reading.

Thanks for helping me to find my stupid mistakes.


MUI_INSTALLOPTIONS_READ requires a path relative to $PLUGINSDIR.

Stu