Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Read an INI file


5 replies to this topic

Thomas Eskesen

Thomas Eskesen
  • Members
  • 86 posts

Posted 09 April 2001 - 11:02

Hi

I can not get the function
GetProfString(SRCDIR^"License.ini", "License", KeyName, svResult);
to work?!?!?

After I have builded my ISWI project to a CD i copy a License.ini file to the disk image - at runtime I would like to read data from the ini file... it doen't work!?!?!? Has anyone tried this?

In my case I copy the License.ini til the diskimages\disk1\
I try to read useing this function:

function ReadLicenseFile(KeyName, RdString, MaxLen)
NUMBERnvFileOut;
STRING svResult;
begin
GetProfString(SRCDIR^"License.ini", "License", KeyName, svResult);

if StrLength(svResult) > MaxLen then
StrSub(RdString, svResult, 0, MaxLen);
else
RdString = svResult;
endif;
end;    

Thanking You in anticipation
Thomas Eskesen


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 09 April 2001 - 23:41

What error messages are you getting back?

Thomas Eskesen

Thomas Eskesen
  • Members
  • 86 posts

Posted 10 April 2001 - 07:29

I located the problem: It is the SRCDIR. It is not working in CustonAction Scripts i version 2.03!!!

The Solution is:
In the PowerEditor go to Directory and create new Directory:
| SOURCEDISKDIR | ....Leavefree.... | SOURCEDIR |
...and make sure that you insert the StanardAction "ResolveSource" after "CostInitialize"
(I got this solution from Erkan, Erkanc@gmx.de)

Regards,
Thomas Eskesen


Donald Bristol

Donald Bristol
  • Members
  • 35 posts

Posted 21 June 2001 - 16:37

Thomas,
I tried following you reply, but my CA is not reading the SRCDIR.  Are we suppose to use "SRCDIR or SOURCDIR".   I'm running my installation silently, if I place the IN I  file in the WINDOWS directory, it works.  If I place the IN I file in the Source directory, it doesn't work.
This is the order in the Execute Sequence:
1. LaunchConditions
2.etc.


5.CostInitialize
6. ResolveSource
7. My CA


Thomas Eskesen

Thomas Eskesen
  • Members
  • 86 posts

Posted 22 June 2001 - 08:28

Hi

Mine woks fine...
I use ISWI version 2.03.
I have made a entry in the Power Editor,  Directory:
SOURCEDISK <empty> DIRSOURCEDIR

In my CA I just use: GetProfString(SRCDIR^"License.dat", "License", KeyName, svResult);

My action is placed in the UserInterface sequence just before the "CostFinalize" and after the "ResolveSource"

And in the Execute Sequence just after InstallValidate

Regards,
Thomas


Donald Bristol

Donald Bristol
  • Members
  • 35 posts

Posted 22 June 2001 - 20:04

thanks, it's working now.
Donald