NetInverse Developers Blog

April 4, 2009
Category: WiX — Tags: , , , — admin @ 11:43 pm

What you need to do is write a VBS custom action to read the Xml configuration parameters and set them as MSI properties. See the customization VBS example below.

WiX CustomAction: SetProperties.vbs

    Sub SetProperties
       strXmlConfigFile = Session.Property("XMLCONFIG")
       Set objDoc = CreateObject("msxml2.DOMDocument.3.0")
       objDoc.Load(strXmlConfigFile)
       Session.Property("MYFUNKYPROP") = objDoc.selectSingleNode("/root/Parameter[@name='Something']").text
       Set objDoc = Nothing
    End Sub

WiX fragment example:

   <Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
       <Fragment Id="SetProperties"> 

           <Binary Id="SETPROPERTIES" SourceFile="SetProperties.vbs" />
           <CustomAction Id="SetProperties" BinaryKey="SETPROPERTIES" VBScriptCall="SetProperties" Execute="immediate" />
           <InstallExecuteSequence>
               <Custom Action="SetProperties" After="LaunchConditions" />
           </InstallExecuteSequence>
       </Fragment>
    </Wix>

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

©2009 NetInverse. All rights reserved. Powered by WordPress