PhilB
Posts: 95
Joined: Fri Jul 06, 2007 4:13 pm

Problems editing XML config file

Hi,
My installation installs an xml config file with a particular value set to false. Depending on whether a component is installed or not, I need to set this value to true. The config file is similar to the following:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <assemblySettings>
    <!-- The dataset for audit data-->
    <add key="AuditDataset" value=""/>
    <!-- Enable the adapter -->
    <add key="Adapter" value="false"/>
    <!-- Enable logging to the tray icon application -->
    <add key="TrayAppLogging" value="true"/>    
  </assemblySettings>
</configuration>
I need to set the Adapter key value true.
I have read the post http://www.advancedinstaller.com/forums ... 72&start=0 which suggests that this is possible, however I don't seem to be able to get it to work. I either end up with the line in twice (once set to true and once to false) or overwriting the previous key. Either something is broken or I'm failing to understand correctly - I suspect the latter! Can anyone assist me?

Phil
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Problems editing XML config file

Hello Phil,

I have attached a sample that sets the value to true or false depending on whether a checkbox is ticked or not on the WelcomeDlg. This is similar to what you need.
Note the custom action from the "Custom Actions" page and the XML from the "Files and Folders" page.

If you are still encountering issues with the problem, please send your aip project file to support at advancedinstaller dot com so we may further assist you with the problem.

Regards,
Gabriel
Attachments
test.aip
(11.9 KiB) Downloaded 542 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
X-Rider
Posts: 1
Joined: Fri Jan 21, 2011 10:38 am

Re: Problems editing XML config file

Hi, is there any way in the current version that the XML file edited can define the property to true if the chackbox is checked and false if the checkbox is not checked?

In the sample the property value gets value="" if the checkbox is not checked instead of value="false"
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problems editing XML config file

Hello and welcome to the Advanced Installer Forums,

You can replace the "" with "false" but that means that the property's value will still be set and it won't make a difference in a Windows Installer boolean conditional statement. Here is why.

Also, the UI behavior of the Check Box control is that its attached property specified in the Property Name field will be set to the value specified in the Value field from the Properties pane when the checkbox is checked. When the checkbox is in an unchecked state, its attached property won't be set( its value will be "" ).

If you need to set a property with different values from user interaction, you should use a Radio Button Group control.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”