Old 1st May 2003, 19:29   #1
supertedusa
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?
supertedusa is offline   Reply With Quote
Old 1st May 2003, 19:36   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Old 1st May 2003, 19:40   #3
supertedusa
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?
supertedusa is offline   Reply With Quote
Old 1st May 2003, 19:45   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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:
!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP} "ioC.ini" "Field 2" "State"
StrCmp ${TEMP} "1" "" +2
;Checked
MessageBox MB_OK "A MessageBox..."


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
Old 1st May 2003, 19:50   #5
supertedusa
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.
supertedusa is offline   Reply With Quote
Old 1st May 2003, 19:52   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Old 1st May 2003, 21:09   #7
supertedusa
Junior Member
 
Join Date: May 2003
Posts: 9
Cool. Thanks.
supertedusa 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