Loading custom properties from disk in a msi dialog? - Advanced Installer Community
dmeatte
Posts: 4
Joined: Tue Jan 10, 2012 4:38 pm

Loading custom properties from disk in a msi dialog?

I have an installer that is doing a major upgrade on a .net application. I'd like to be able to read some settings out of a config file in the install's target directory and load it into a custom property that I can use in one of the msi's dialogs. How can I get this to work?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Loading custom properties from disk in a msi dialog?

Hi and welcome to our forums,

I assume the config file is a standard XML one? If so, here is a tutorial that explains how to get the values into public properties.

After this just assign those public properties the edit controls from the MSI dialog.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dmeatte
Posts: 4
Joined: Tue Jan 10, 2012 4:38 pm

Re: Loading custom properties from disk in a msi dialog?

I can get the xml search to work for me (thanks for pointing out the link), but I'm a bit confounded as to how it's supposed to work with an xml structure that I already have in my software.

How am I supposed to set up an xml locator if I store my settings in xml like

Code: Select all

<Settings>
   <MyDataPath>c:\DataPath</MyDataPath>
   <ShouldDoStuff>true</ShouldDoStuff>
</Settings>
or like

Code: Select all

<Settings>
   <Setting name="MyDataPath" value="c:\DataPath"/>
   <Setting name="ShouldDoStuff" value="true"/>
</Settings>
I was able to get it to work by using a dedicated xml file like <Settings myDataPath="c:\DataPath" shouldDoStuff="true"/>, but ideally, I'd like to avoid duplicating the setting to another file just for the msi. What am i missing? Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Loading custom properties from disk in a msi dialog?

Hello,

The XML structures you posted can also be found using the locator, it's just a matter of settings combinations. To get a hint of how to set the locators you need, you can import the XML in Windows Installer format in the Files and Folders page( context menu -> Import -> XML Files... ).

This way you will get a clear idea of the combination to set so you'll get what you need from the XML:
http://www.advancedinstaller.com/user-g ... cator.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Loading custom properties from disk in a msi dialog?

Hello,

Here's a thread with a sample project to help you with this.

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

Return to “Common Problems”