How do I read and store the values of two page field values to an INI file? I created two key pairs at the INI section using ISTool. Now how do I link this up?
The INI Section looks like this:
[INI]
Filename: {app}\prefs.ini; Section: AUTH; Key: USERNAME; String:
Filename: {app}\prefs.ini; Section: AUTH; Key: PASSWORD; String:
Page is created like this:
AuthPage := CreateInputQueryPage(wpWelcome,
'Account Information', 'Please enter your Account Information',
'');
AuthPage.Add('Username:', False);
AuthPage.Add('Password:', True);
EDIT:
I made the following additions. It doesn't work for some reason:
SetIniString('AUTH', 'USERNAME', AuthPage.Values[0], '{app}\prefs.ini')
SetIniString('AUTH', 'PASSWORD', AuthPage.Values[1], '{app}\prefs.ini')
This should work:
Use a scripted constant from
[INI]
section entries:If a logic of transforming user-entered values into the INI file entries is complex, you may rather want to use
SetIniString
from[Code]
section. Typically fromCurStepChanged
event function:I believe you need to write
ExpandConstant('{app}\prefs.ini')
to expand the{app}
constant.