hans
Posts: 11
Joined: Mon Mar 14, 2011 3:41 pm

add ini file properties conditionally

Is it possible to add ini properties conditionally?

E.g.
Our application has default values for many settings.
I don't wish for these settings to be specified in the ini file unless they're overriding the default values
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: add ini file properties conditionally

Hi,

It is possible by using a custom action in this way:
- on the Files and Folders page, in your INI file, add one key with the value [MYVALUE].
Also, you can specify the action taken during the installation for this INI entry.
- in your Dialogs page to the Published Events tab add a SetProperty event where you can specify a condition to set or not a value in [MYVALUE] property.

Regards,
Ciprian
__________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hans
Posts: 11
Joined: Mon Mar 14, 2011 3:41 pm

Re: add ini file properties conditionally

Right,
but I wan't to avoid setting some the key at all i have some key
title=[MYVALUE]

how do avoid setting title?

If i don't specify MYVALUE the ini file will still contain:
title=

I would like to only include the title key if some other condition is true (like if NON_DEFAULT_TITLE=1), since otherwise the value will be "" (empty string)
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: add ini file properties conditionally

Hi,

In an INI Entry Dialog you have the possibility to choose the component which will contain the INI entry.
After that, you can condition the component chosen from Component Properties in Organization Page.

Regards,
Ciprian
__________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hans
Posts: 11
Joined: Mon Mar 14, 2011 3:41 pm

Re: add ini file properties conditionally

Am I misunderstanding something?

I mean, as i understand it a component has to be tied to to a file

That essentially means that we would have to include some otherwise irrelevant files (files that our application don't use or need).
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: add ini file properties conditionally

Hello,

You can create dummy files or registry entries which you can remove by adding removal operations. You can add removal operations in the Files and Folders page and in the Registry page from the context menu:
http://www.advancedinstaller.com/user-g ... ialog.html
http://www.advancedinstaller.com/user-g ... ialog.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”