Generally.  I'll avoid details about what methods to call and stuff and give 
you more high level advice.

I've found it useful to design code like this to be driven off of XML.   For 
example I might right something like

<ActionRef Id="ActionICareAbout" Condition="MyNewCondition"/>

This allows me to write methods that do the work and methods that parse the XML 
and call the first methods.  It's almost like creating my own DSL and it's very 
scalable.  In fact much of my work involves parsing WiX fragments and calling 
into InstallShield automation to build up projects.

Or if you only have a few things you need to do  the above element could also 
be 
used to generate a simple update statement.

Christopher Painter, Author of Deployment Engineering Blog
Have a hot tip, know a secret or read a really good thread that deserves 
attention? E-Mail Me



----- Original Message ----
From: "Castro, Edwin G. (Hillsboro)" <edwin.cas...@fiserv.com>
To: "General discussion for Windows Installer XML toolset. 
(wix-users@lists.sourceforge.net)" <wix-users@lists.sourceforge.net>
Sent: Mon, January 17, 2011 7:05:53 PM
Subject: [WiX-users] Update InstallExecuteSequence Condition Programmatically 
using DTF

I’d like to write a program using DTF to open up a MSI package and 
programmatically update some Conditions in the InstallExecuteSequence table. 
This program be used to update MSI packages before installation. Here’s some 
pseudo code for what I have so far:

using (database = new Database(filePath, DatabaseOpenMode.Transact))
{
    query = database.Tables["InstallExecuteSequence"].SqlSelectString
    using (view = database.OpenView(query))
    {
        while (record = view.Fetch())
        {
            try
            {
                action = record.GetString("Action")
                if (action is the action I want)
                {
                    record.SetString("Condition", "new condition")
                }
            }
            finally
            {
                record.Close()
            }
        }
    }
    database.Commit()
}

I’m trying to implement this as a PowerShell script so my script doesn’t look 
exactly like the pseudo code above.

Is this going in the correct direction? I have a feeling that this isn’t quite 
right but I don’t know exactly what the missing piece is.

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



      

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to