PDA

View Full Version : How do I set the path inside an ini-file?


Stein Inge
03-11-2007, 02:58 PM
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;

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

Leigh W
03-11-2007, 05:58 PM
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;

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-

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

Good luck,

Leigh
from sunny Melbourne, Australia.

JXBURNS
03-12-2007, 06:42 AM
Using Leigh's suggestion I would also wrap it around the first %AppFolder% thus:

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

Rgds John