PDA

View Full Version : Cannot get %AppFolder% in .ini value field


Kolo
10-10-2009, 09:35 AM
I am creating an .ini file during the post-install and one of the settings is for a Local Directory. This of course is based on where the installer chose to install the app.
I've tried ...
INIFile.SetValue("%AppFolder%\\SoftwareFTPConfig.ini", "ProgramDownload", "LocalDir", "%AppFolder%\\Program Updates")

and...
INIFile.SetValue("%AppFolder%\\SoftwareFTPConfig.ini", "ProgramDownload", "LocalDir", _AppFolder.."\Program Updates")

and
cString = <concatenated string>

INIFile.SetValue("%AppFolder%\\SoftwareFTPConfig.ini", "ProgramDownload", "LocalDir", cString)

None of these work - I get a literal representation of the value (e.g. "%AppFolder\...") every time.

Can anyone help?

Thank you , Kathy

Ulrich
10-10-2009, 10:25 AM
Hello,

Of course you have to expand the session variable before you can use it. You are using "%AppFolder%" as a string, not as a session variable. To get the contents, use

folder = SessionVar.Expand("%AppFolder%");
INIFile.SetValue(folder .. "\\SoftwareFTPConfig.ini", ...

or

INIFile.SetValue(SessionVar.Expand("%AppFolder%\\SoftwareFTPConfig.ini"), ...


This is well explained in the documentation, examples, and here (http://www.indigorose.com/forums/showthread.php?p=120414).

Ulrich

Kolo
10-11-2009, 06:25 AM
Thank you for your reply.
However, I still have an issue.
The issue is not with the folder reference it is with the value of the .ini property.

When I try
cVal = SessionVar.Expand("%AppFolder%");
INIFile.SetValue("%AppFolder%\\ProductFTPConfig.ini", "ProductDownload", "LocalDir", cVar.."\Table Updates");

on 'Post Install' I get this error at install time...
On Post install, line 10: attempt to concatenate global 'cVar' (a nil value)

Any suggestions?

Thanks again, Kathy

AdrianS
10-12-2009, 05:27 AM
cVal = SessionVar.Expand("%AppFolder%");
INIFile.SetValue("%AppFolder%\\ProductFTPConfig.ini", "ProductDownload", "LocalDir", cVar.."\Table Updates");


You've used two different variable names for the folder string (highlighted in red).