Archive: Installation from ini file


Installation from ini file
Hi guys,

I have a ini file that looks like this:

[ComponentName1]
PathOfTheExecutableToRun1 = c:\setup1.exe
PathOfTheExecutableToRun2 = c:\setup2.exe
[ComponentName2]
PathOfTheExecutableToRun3 = c:\setup3.exe
PathOfTheExecutableToRun4 = c:\setup4.exe

I would like to know if it is possible to create a script that shows the [ComponentNameX] as component and run each Executable from the section if the component is choosed.

Thanks for your help.


Sure it is possible but particularly easy. The number of sections are defined at compile time so either you need to add a lot and only show some or you should think about making your own components page. Also ReadINIStr isn't much good until you know all the section names in your INI file - it would be better to use [Section #] and you can then enumerate through them using a loop until the error flag is set.

Stu