Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Location
    Norway
    Posts
    52

    How do I set the path inside an ini-file?

    Hi folks

    Looks like I need some help to get this ini-file correct.

    This is what I have entered into the "On Post Install" actions;

    Code:
    INIFile.SetValue("%AppFolder%\\Etterkommerbok.ini", "Report", "Cust_TitlePic","%AppFolder%\\backdrops\\Eika.jpg");
    I install a file called "Etterkommerbok.ini" into the AppFolder. Then I need to set the full path to the picture file "Eika.jpg". The picture file path is in a section called [Report] and the start of the line is "Cust_TitlePic=".

    The ini-file should look like this
    [Report]
    Cust_TitlePic=C:\Program files\My app\backdrops\Eika.jpg

    The above code almost works, but the path to the jpg file is not working. The ini-file looks like this;
    [Report]
    Cust_TitlePic=%AppFolder%\backdrops\Eika.jpg

    How can I get the actual path "C:\Program files\My app" into the ini-file and not the variable "%AppFolder%"?

    best regards
    Stein Inge Haaland

    From little Norway

  2. #2
    Join Date
    Feb 2007
    Location
    Melbourne, Australia.
    Posts
    16
    Quote Originally Posted by Stein Inge View Post
    Hi folks

    Looks like I need some help to get this ini-file correct.

    This is what I have entered into the "On Post Install" actions;

    Code:
    INIFile.SetValue("%AppFolder%\\Etterkommerbok.ini", "Report", "Cust_TitlePic","%AppFolder%\\backdrops\\Eika.jpg");
    I install a file called "Etterkommerbok.ini" into the AppFolder. Then I need to set the full path to the picture file "Eika.jpg". The picture file path is in a section called [Report] and the start of the line is "Cust_TitlePic=".

    The ini-file should look like this
    [Report]
    Cust_TitlePic=C:\Program files\My app\backdrops\Eika.jpg

    The above code almost works, but the path to the jpg file is not working. The ini-file looks like this;
    [Report]
    Cust_TitlePic=%AppFolder%\backdrops\Eika.jpg

    How can I get the actual path "C:\Program files\My app" into the ini-file and not the variable "%AppFolder%"?

    best regards
    Stein Inge Haaland

    From little Norway


    Hi Stein,

    Try wrapping SessionVar.Expand around "%AppFolder%\\backdrops\\Eika.jpg", so that you use-

    Code:
    INIFile.SetValue("%AppFolder%\\Etterkommerbok.ini", "Report", "Cust_TitlePic",SessionVar.Expand("%AppFolder%\\backdrops\\Eika.jpg"));
    Good luck,

    Leigh
    from sunny Melbourne, Australia.

  3. #3
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    Using Leigh's suggestion I would also wrap it around the first %AppFolder% thus:

    Code:
    INIFile.SetValue(SessionVar.Expand("%AppFolder%\\Etterkommerbok.ini"), "Report", "Cust_TitlePic",SessionVar.Expand("%AppFolder%\\backdrops\\Eika.jpg"));
    Rgds John

Similar Threads

  1. set install path on network by finding unique file
    By Dane Lamb in forum Setup Factory 7.0
    Replies: 7
    Last Post: 02-16-2005, 12:14 PM
  2. Modifying INI file
    By StevenJ in forum Setup Factory 6.0
    Replies: 0
    Last Post: 11-10-2004, 01:36 PM
  3. INI file to populate a listbox
    By pjhiggins in forum AutoPlay Media Studio 5.0
    Replies: 17
    Last Post: 05-04-2004, 04:08 PM
  4. How to extract a file path from registry key?
    By skids in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 03-17-2002, 10:48 AM
  5. SUF6 -- Ini file update failure
    By jassing in forum Setup Factory 5.0
    Replies: 2
    Last Post: 11-20-2001, 11:48 PM

Posting Permissions

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