View Full Version : very urgent

05-26-2005, 09:31 AM
hi all
Is anybody know how can I read strings from embeded setup.ini? Is it possible to safe them in String Table (somewhere where I can )

My situation:
I created webdeploy installation which has got setup.exe and a branch of .cab files that are located on the server. I need to automate installer creation, by compiling my installation and passing custom parameters to it. So, I created setup.ini inside my installation as I understand it should be embeded inside setup.exe. My need is as soon as user download setup.exe it should read from this setup.ini some data embeded there (like server name, some settings data, etc) and then continue installation.
Now I need somehow read keys/values from this setup.ini (from the documentation I found that it is possible to read .ini files that are on the destination computer - it's not OK for my case).

Any idea, exemples, links???
Thank you in advance.

06-22-2005, 05:06 AM
(I use IS ver 10, but i expect situation is the same in ver. 11)

What you can do is add your INI file to the Language Independent file list in the Support Files view of the IDE.
In the script you can access this file through the SUPPORTDIR variable.
I use it for DLLs, but the same applies to any file:

nReturn = UseDLL ( sgDLL );
After this you can parse the file as you would any INI file:

/* these functions read files in the format:
... */
GetProfString ( sFile, sSection, sKey, sReturnValue ); // for String values
GetProfInt ( sFile, sSection, sKey, nReturnValue ); // for Numeric values
I think this will be better than setting\reading from String Tables, which you can do with the LoadStringFromStringTable(...) function.

Hope this helps,