The patch sequence information is stored in a table in the MSP directly; unlike 
the rest of the stuff in the MSP it does NOT get applied to the target product 
database. So, to get at that table for an installed patch you first need to get 
the PatchInstallation.LocalPackage, open that package as a Database, then query 
the MsiPatchSequence table if it exists. (Some patches might not have this 
table).

Something like this (I have not tested this code)...

PatchInstallation p = ...
if (File.Exists(p.LocalPackage))
{
        using (Database patchDb = new Database(p.LocalPackage))
        {
                if (patchDb.Tables.Contains("MsiPatchSequence"))
                {
                        // Query the sequence table.
                        // Note there may be multiple rows for different 
product codes/patch families.
                }
        }
}


-----Original Message-----
From: Tony Juricic [mailto:tjuri...@tradestation.com] 
Sent: Monday, June 15, 2009 12:39 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How much of patch pcp database makes it into msp?

Thanks Bob but this, unfortunately, does not seem to be true.

I am using DTF and code very simple test code:
        public void ShowPatches()
      {
         using (Session ses = Installer.OpenProduct(productCode))
         {
            Database db = ses.Database;
            TableCollection tc = db.Tables;
            if (tc.Contains("Media"))
            {
               IList<string> res = db.ExecuteStringQuery("SELECT Source
FROM Media");
            }
         }
      }

and I see that Source string from 2 of my applied patches is some string
constructed by installer and in the following format:

MSPSRC<Patch GUID with no spaces or - chars>

This is certainly not what I had put in MediaSrcPropName.

What I am really trying to do is the following: say I have 3 patches
applied to my product. I want to know their sequence numbers. I could
read it from the patch msp files, if they were available, but in this
case they are not.

DTF has very useful public static IEnumerable<PatchInstallation>
GetPatches() method but PatchInstallation object contains just about
everything about the patch except the sequence number.

Thus I am forced to create and maintain an external file mapping patch
Guids to corresponding sequence numbers.
All I want is to display applied patches in order of their sequence #
:(






-----Original Message-----
From: Bob Arnson [mailto:b...@joyofsetup.com] 
Sent: Monday, June 15, 2009 7:40 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How much of patch pcp database makes it into
msp?

Tony Juricic wrote:
> In particular, can I somehow get MediaSrcPropName value, from *.pcp
> ImageFamilies table, using DTF on my patch *.msp file?
>   

The doc says:

The value entered into the Source field of the new Media table entry of 
the upgraded image.

So it's available. But only very indirectly, since the Media table is in

your .msi packages and modified using a patch transform.

-- 
sig://boB
http://joyofsetup.com/





TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) 
of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, 
FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and 
subscription company, and TradeStation Europe Limited, a United Kingdom, 
FSA-authorized introducing brokerage firm. None of these companies provides 
trading or investment advice, recommendations or endorsements of any kind. The 
information transmitted is intended only for the person or entity to which it 
is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete the material from any computer.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to