PDA

View Full Version : For InstallShiled 10.5 project I need a function code to modify properties.txt file.



vattipalli
12-20-2004, 06:35 AM
Hi,
This is for InstallShield 10.5 project.
I have a properties.txt file which looks like this:
********************************
[Crypkey9X]
required0=Crypkey9X\Crypkey
SELECTED=Yes
FILENEED=STANDARD
HTTPLOCATION=
STATUS=Installing system files...
UNINSTALLABLE=Yes
TARGET=<TARGETDIR>
member0=Crypkey9X\Crypkey
FTPLOCATION=
VISIBLE=No
DESCRIPTION=
DISPLAYTEXT=
IMAGE=
DEFSELECTION=Yes
filegroup0=CRYPKEY_9X
COMMENT=
INCLUDEINBUILD=
INSTALLATION=NEWERVERSION\NEWERDATE
COMPRESSIFSEPARATE=No
MISC=
ENCRYPT=No
DISK=ANYDISK
TARGETDIRCDROM=
PASSWORD=
TARGETHIDDEN=General Application Destination

[Gateway_ET]
required0=Gateway_ET\Debranding Files
SELECTED=Yes
FILENEED=STANDARD
required1=Gateway_ET\Lang_Files\English\English_Data
HTTPLOCATION=
STATUS=Installing program files...
UNINSTALLABLE=Yes
TARGET=<TARGETDIR>\Data
member0=Gateway_ET\Lang_Files
FTPLOCATION=
member1=Gateway_ET\Program
VISIBLE=Yes
DESCRIPTION=
member2=Gateway_ET\Debranding Files
DISPLAYTEXT=
IMAGE=
DEFSELECTION=Yes
filegroup0=Debrand_DATA
COMMENT=
INCLUDEINBUILD=
INSTALLATION=ALWAYSOVERWRITE
COMPRESSIFSEPARATE=No
MISC=
ENCRYPT=No
DISK=ANYDISK
TARGETDIRCDROM=
PASSWORD=
TARGETHIDDEN=General Application Destination\Data

*****************************************

I need to write a function in setup.rul file which will modify this file.The prototype of this function will be
ParseFile( "C:\properties.txt", "[Crypkey9X]", "Yes")

this function should modify the Option
INCLUDEINBUILD=Yes
Like this i will pass yes or no parameters to all components based on whether they are required or not.
If i pass yes then it should be
INCLUDEINBUILD=Yes.
If i pass No then it should be
INCLUDEINBUILD=No

Please provide me the function code to achieve the above purpose.

regards,
vattipalli.

MichaelU
12-20-2004, 11:17 AM
That looks a lot like INI format. Perhaps the functions GetProfString, WriteProfString, ReplaceProfString, and/or AddProfString may be of use. Their interface is much like you've described. Please find documentation on them in the InstallScript Language Reference, or at http://support.installshield.com/