|
|
#1 |
|
Junior Member
Join Date: May 2003
Posts: 9
|
ReadINIStr problem
I have a very simple call in a section. My ini file is a custom page, displayed earlier in the install. Field 2 is a radio button, flags set to group (there are two rbuttons). When selected, the state should be 1:
ReadINIStr $3 "CustomPageINI.ini" "Field 2" "State" StrCmp $3 "1" 0 +2 Call MyFunction ;Do some other stuff If selected, MyFunction does not get called. What am I missing here? |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Specify a full path for the INI file or use the MUI macro if you have used another MUI macro to extract the INI.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2003
Posts: 9
|
I've basically modified the the IO example script. So, I'm using
ReserveFile "Myini.ini" ;doesn't this extract? To where? $INSTDIR? Using that statement, what path would I use with the ReadINIStr call? |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
As Joost said: "ReserveFile only changes the position of a file in the datablock."
If the page shows and you haven't used File then you have probably used the MUI macro MUI_INSTALLOPTIONS_EXTRACT. Therefore you have to use the MUI macro to read too as the example shows: code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2003
Posts: 9
|
So, if I commit to the MUI_* macros in the beginning, then I have to stick with them?
That worked, by the way. Thanks so much for your time. I think I'd really enjoy this installer if I wasn't such an MFC hack. |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You don't have to but it's recommended. The macros put the INI file in $PLUGINSDIR which is an automatically generated temporary directory that is also automatically deleted when the installer quits.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2003
Posts: 9
|
Cool. Thanks.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|