Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    2

    Cannot get %AppFolder% in .ini value field

    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.i ni", "ProgramDownload", "LocalDir", "%AppFolder%\\Program Updates")

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

    and
    cString = <concatenated string>

    INIFile.SetValue("%AppFolder%\\SoftwareFTPConfig.i ni", "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

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    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
    Code:
    folder = SessionVar.Expand("%AppFolder%");
    INIFile.SetValue(folder .. "\\SoftwareFTPConfig.ini", ...
    or
    Code:
    INIFile.SetValue(SessionVar.Expand("%AppFolder%\\SoftwareFTPConfig.ini"), ...
    This is well explained in the documentation, examples, and here.

    Ulrich

  3. #3
    Join Date
    Oct 2009
    Posts
    2

    Cannot get %AppFolder% in .ini value field

    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.in i", "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

  4. #4
    Join Date
    Apr 2005
    Location
    Ottawa, CA
    Posts
    27
    Quote Originally Posted by Kolo View Post
    cVal = SessionVar.Expand("%AppFolder%");
    INIFile.SetValue("%AppFolder%\\ProductFTPConfig.in i", "ProductDownload", "LocalDir", cVar.."\Table Updates");
    You've used two different variable names for the folder string (highlighted in red).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts