jdjames13
Posts: 3
Joined: Fri Jan 05, 2018 3:57 pm

Searching a path inside a ini file using IF statement?

Hi Guys

I am trying to work out how to search a path of a .ini file based on certain rules.

Below is the ini file extract.
------------------------------------------
[Configuration]
Current=ff

[ff]
Internal units=8
External units=3
Data=c:\data\UK\data\
DataN=
Jobs=c:\data\UK\jobs\
Programs=c:\data\UK\programs\
Man.var=Loc
DataDef=Loc
Mi2000.ini=Loc
DB:Act=Loc
DB:Arch=Loc
DB:Temp=Loc
DB:Tran=Loc
DB:Rep=Loc
Uid.seq=Loc
[Message Exclusions]
Adobe Reader=1
Acrobat IEHelper=1

[xx]
Internal units=other paths
-------------------------------------------------
So i want to read the "Current" path first, in this instance being "ff" , then i want to do the following:

IF DB:Act=Loc THEN USE Data path (C:\folder\uk\data) ELSE USE DataN Path


This is critical for us to do before we made our minds up about purchasing Advanced Installer.
jdjames13
Posts: 3
Joined: Fri Jan 05, 2018 3:57 pm

Re: Searching a path inside a ini file using IF statement?

Hi

Does anyone know if this is possible?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Searching a path inside a ini file using IF statement?

Hi,

Yes, you can search for any INI value using the "INI Location" search from the "Search" page. However, I'm not sure where you want to use the "Data" and "DataN" paths.

Supposing that you want to set a property with the value of one of them, then you can go in the "Custom Actions" page and use the "Set installer property" custom action to set a property with their value based on a condition.

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”