Roman
Posts: 12
Joined: Mon Jan 15, 2018 3:48 pm

Set installer property from a file

I'm creating a project to update a web service. One more configuration file is added to the already installed one. Can I read an existing .conf file to set property and use it to create another configuration file?
For example:
File example.conf already installed by previous installation and it looks like:

Code: Select all

<DatabaseConnection>Server=127.0.0.1;User Id=example_user;Password=example_pass;port=1234;Database=example_database</DatabaseConnection>
I need to create another file with different syntax, but it contains the same values:

Code: Select all

  "ConnectionStrings": {
    "DefaultConnection": "Server=127.0.0.1;User Id=example_user;Password=example_pass;port=1234;Database=example_database"
  }
Also, i have a little problem with advansed installer interface: i lost all icons on folders (delete, synchronize etc). Repair and reinstall doesnt help.
Image

Thank you.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Set installer property from a file

Hello Roman,
Can I read an existing .conf file to set property and use it to create another configuration file?
Unfortunately, we do not have predefined support for such a task. However, this may be achieved through a custom action. For instance, you can have a script that does what you want (e.g. a PowerShell script).

However, few things need to be considered here:

1. by default, this custom action should be scheduled after your config file is copied on the target machine (i.e. after the "Add resources" action group, with its execution time being of "When the system is being modified (deferred)")

Unfortunately, it is not possible to set a property during the deferred stage of the installation sequence.

2. a workaround to this would be to add your config file as a temporary file and execute the script during the "Immediate" stage of the installation sequence.

In what regards this:
Also, i have a little problem with advansed installer interface: i lost all icons on folders (delete, synchronize etc). Repair and reinstall doesnt help.
This is pretty strange. In order for me to further investigate this, could you please forward me a copy of your .AIP file by e-mail at support at advancedinstaller dot com?

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”