Thank you very much for your response.

I always want to restore the inner text of element to "false".  XmlConfig 
element doesn't seem to support "setvalue" Action as does the XmlFile element. 
So I tried to do this in 2 steps:
1. Delete the <Enabled></Enabled> node during uninstall using XmlConfig and set 
the sequence to 1.
2. Create the <Enabled>false</Enabled> node during uninstall using XmlConfig 
and set the sequence to 2.

<util:XmlConfig Id="DeleteDlpEnabled"
                        Action ="delete"
                        ElementPath="/Configuration/System/DLPSettings"
                        File="[TARGETDATA]Configuration.xml"
                        VerifyPath="Enabled"
                        Node="element"
                        On="uninstall"
                        Sequence="1"/>

        <util:XmlConfig Id="CreateDlpEnabled"
                        Action="create"
                        ElementPath="/Configuration/System/DLPSettings"
                        File="[TARGETDATA]Configuration.xml"
                        Node="element"
                        Name="Enabled"
                        Value="false"
                        On="uninstall"
                        Sequence="2"/>


This transforms the  config during uninstall from:
<Settings>
           <Enabled></Enabled>
            <Engines>
          <Engine Name="... ">
              <Enabled>false</Enabled>
                  </Engine>
                  <Engine Name="...">
                      <Enabled>false</Enabled>
                  </Engine>
            </Engines>
  </Settings>

To the following
<Settings>
            <Engines>
                <Engine Name=" ...">
                    <Enabled>false</Enabled>
                </Engine>
                <Engine Name="... ">
                    <Enabled>false</Enabled>
                </Engine>
            </Engines>
        <Enabled xmlns="">false</Enabled>
</Settings>

This does not help because of two reasons:
1. "Create" Action of XmlConfig element creates the new node as the last child 
of parent. Adding the node as the end would break the schema validation. Is it 
possible to add the node as the first child of parent element.
2. The node has an additional "xmlns=" attribute, original xml did not have it. 
I can probably delete this additional attribute by using another xmlconfig 
element to delete this attribute. Is it possible to not have it in the first 
place?

Best Regards,
Deepika

-----Original Message-----
From: Pally Sandher [mailto:pally.sand...@iesve.com]
Sent: Friday, November 19, 2010 5:42 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Is there a way to restore original xml after 
uninstalling a component that sets value using XmlFile?

If you always want to restore it to "false", XMLConfig can be used to set a 
value on uninstall. See 
http://wix.sourceforge.net/manual-wix3/util_xsd_xmlconfig.htm

If you want to store what it is before installation & then restore that value, 
you'll need to use a Custom Action to read it then use a RegistryValue to store 
it, a RegistrySearch to retrieve it during it uninstall & XMLConfig to set it 
back. Rob M. wrote a blog post on how to store & retrieve Properties 
http://robmensching.com/blog/posts/2010/5/2/The-WiX-toolsets-Remember-Pr
operty-pattern which you'd only need to expand with your XML reading Custom 
Action.

Palbinder Sandher
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500
F: +44 (0) 141 945 8501

http://www.iesve.com
**Design, Simulate + Innovate with the <Virtual Environment>** Integrated 
Environmental Solutions Limited. Registered in Scotland No.
SC151456
Registered Office - Helix Building, West Of Scotland Science Park, Glasgow G20 
0SP Email Disclaimer

-----Original Message-----
From: Deepika Gakhar [mailto:deepi...@microsoft.com]
Sent: 18 November 2010 19:20
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Is there a way to restore original xml after uninstalling 
a component that sets value using XmlFile?

Hi,

One of our product features has a component that uses  util:XmlFile to set the 
inner text of an element in config file to "true". The original value is false.

Original state of element : <Enabled>false</Enabled> After the feature is 
installed, state of the element : <Enabled>true</Enabled>

When I just uninstall that feature by using "Change" option in "Add Remove 
Programs",  the inner text gets removed completely and the state of element 
looks like: <Enabled> </Enabled>. This is undesirable in our case as this 
invalidates the xml against the xsd and will puncture the whole system.

Is there a way to restore the old value after uninstalling the feature?

You help will be much appreciated. Thanks in advance.

Best Regards,
Deepika
------------------------------------------------------------------------
------
Beautiful is writing same markup. Internet Explorer 9 supports standards for 
HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great 
experiences on the web. Be a part of the beta today 
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net<mailto:WiX-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for 
HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great 
experiences on the web. Be a part of the beta today 
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net<mailto:WiX-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to