Populating custom dialog field from a file - Advanced Installer Community
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Populating custom dialog field from a file

I have an installer that populates a config file with values that are prompted for during installation. This works really well by setting the xml values in the files and folders module, based on properties captured.

The only problem with this is that if the user wants to modify these settings then the obvious way would be to run the setup selecting the modify function. I was wondering if there is a way of getting these values back into the custom dialog from the config file.

Thanks
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Populating custom dialog field from a file

Hi,

In order to achieve this you can implement the solutions described in the "Saving context between installations" thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Populating custom dialog field from a file

Thanks for pointing me in that direction. I did try this but am not able to get it to work.

I built up the structure of my XML file but nothing is ever populated.

In the file path field, the default is [WindowsVolume]filename.exe.config

I tried with that (using my file name) and I then also tried [APPDIR]filename.exe.config (as this is where the file is stored) but neither appear to work. I put a property store on the top level but it does not find it.

Does it matter that my xml file has an extension of .config?
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Populating custom dialog field from a file

So I have narrowed down this a little.

If I put the whole exact path to the file then it works fine. For example if I put:

C:\Program Files (x86)\My App\MyApp.exe.config

Then it finds all the elements that I am searching for.

However I do not know the exact location of the file. It is located in the install directory. If I try any of the following

[APPDIR]MyApp.exe.config
[APPDIR]\MyApp.exe.config
[WindowsVolume]MyApp.exe.config
[WindowsVolume]\MyApp.exe.config

it does not work.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Populating custom dialog field from a file

Hi,
Does it matter that my xml file has an extension of .config?
No, it does not matter as long as the XML file structure is respected.

Regarding the file path problem that you encounter you can read the "Problem with Search XML: backup some installed file tags" thread where a solution for this issue is suggested.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”