We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Editing an INI file question

Hey guys,

How can I do this?:

I have an INI with a section that has a bunch of lines commented, I want to have a Dialog show me this commented lines as options to uncomment if needed.

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Editing an INI file question

Hello,

In order to achieve this you can use our "Text File Updates" support. For example you can add a text replace operation like this:
  • Find:
    ;key=value

    Replace:
    key=value
Then, you can add a checkbox (UNCOMMENT_PROPERTY) on your dialogs and use its associated property (UNCOMMENT_PROPERTY) in the "Condition" field of the component containing the text replace operation.

Let us know if this helped, otherwise please give us more details about your scenario (maybe exemplify).

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

That one I kind of knew, but how fo I link it to a Dialog with all the commented lines in it and make it uncomment the ones selected in this dialog?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Editing an INI file question

Hello,

I'm afraid I don't fully understand the scenario you want to implement. Can you please give us more details about this (maybe exemplify or attach some screenshots)?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

Basically, what I need is instructions on how to do it, like what controls do I put in the Dialog, how do I populate the control that has the checkboxes, etc.

And of course, once I have the Dialog, how do I create the condition for the change in the INI file.

Did I make myself clear now?

Sorry if I wasn't clear before.

Thanks,
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

Oh and by the way I have multiple entries (at least 15) in the INI file that the installer needs to ask if the person installing it wants to enable, so it has to be a control that can scroll up/down with the checkboxes in it.
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

OK I just found the Checklist control and populated it with the lines commented in the INI file, now how can I make the changes to the INI file with the checkboxes checked in this dialog?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Editing an INI file question

Hello,

I've attached a sample created with version 11.3 of Advanced Installer which implements a similar scenario. Just place the archived "test.ini" file on the [WindowsVolume] location on target machine and, then build and run the setup project.
sample.zip
(4.45 KiB) Downloaded 275 times
Basically, you need to create a dummy component (add a dummy registry value in "Registry" page) for every line you want to update in the target INI file. Then, go to "Files and Folders" page and create a text replace operation for every line you want to update in the INI file and assign them correspondingly to the components of the dummy registries. As you can not create two or more text replace operations which target the same file, you should add sub-folders under parent folder of the INI file containing each one a text replace operation targeting the same filename. Also, you should enable for all created sub-folder the "Install folder content into the parent folder" option from "Folder Properties" tab. Next, you should condition the components containing the text replaces, from "Organization" page, to be installed only when the check list control associated property contains a specific value.

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

I'm a little confused, why use folders/registry keys?

Is there a way to use the Data in the checklist for this purpose?

I don't want the installer to create unneeded folder/registry keys just to uncomment lines in an INI file.

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Editing an INI file question

Hello,

Unfortunately, you cannot condition a text replace operation without conditioning its containing component. When adding, a text replace operation will be inserted in a component from "Organization" page. Also, considering that every component has a key resource that can be only a file, a folder, a registry key or value or a data source, then a text replace operation can only be added under an existing component. So, the only workaround is to create dummy components under which will be added your text replace operations or to add the replace operations under existing components which will be conditioned using the replace operations conditions.

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfha73
Posts: 14
Joined: Tue Jun 03, 2014 10:13 pm

Re: Editing an INI file question

Too bad,

It seemed so easy to do without using files/filders/registry keys, but I guess not.

Thanks anyway.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Editing an INI file question

You're welcome. Unfortunately, this is our default implementation.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”