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!

alext72
Posts: 11
Joined: Fri Nov 18, 2016 9:56 am

Create registry key based on Ini file passed as property

Hello,

Is there a way to do the following ?

Let's say I want to build an MSI. This MSI should create some registry keys based on the content of an ini file ?
Ini sample :
[keys]
1 = 192.168.1.1
2 = 192.168.1.10
...

The goal is to create the following keys :

HKLM\SOFTWARE\MyApp\Conf\
Name : 1 Value : 192.168.1.1
Name : 2 Value : 192.168.1.10
...

And maybe call the MSI with a public property accepting the ini file as an entry ?
MSIEXEC /I MyApp.msi INIFILE="PathToIni.ini" /qb
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Create registry key based on Ini file passed as property

Hello Alex,

In order to achieve that, you can create a search for the respective element of the INI file and then use that search as a condition for the component assigned to your registry entry.

You can condition the installation of the component by going to "Registry" page --> right click on your registry entry --> "Go to component".

If the property that stores the result of your search is, for instance, named RESULT_PROPERTY, the condition may look as it follows:

Code: Select all

RESULT_PROPERTY
This way, the component will only be installed (and the registry created) if the search succeeded (i.e. the element exists in the INI file)

Hope this helps!

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

Return to “Building Installers”