Ah, I see that now. I saw your reply and realized the part of the question that I missed. I've actually done a lot with persisting data across sessions over the years as I am not a beleiver in `configuration data is a pain`. :-) I've even been known to tie into custom AD schema extensions to allow managing configuration data in a generic manner across an enterprise. Very interesting stuff that I don't understand why it's not built into MSI proper.
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 --- On Mon, 6/16/08, Jason Ginchereau <[EMAIL PROTECTED]> wrote: > From: Jason Ginchereau <[EMAIL PROTECTED]> > Subject: RE: [WiX-users] DTF: Saving data in deffered custom action > To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>, "General discussion for Windows > Installer XML toolset." <wix-users@lists.sourceforge.net> > Date: Monday, June 16, 2008, 6:52 PM > >> maybe I'm missing something but the constructor > choices for the CustomActionData class could probably be a > little better. The CustomActionData property is always > `CustomActionData` so maybe there should be an overload > that takes the session class as an argument and > automatically gets the CustomActionData property. > > I guess you missed it. From a deferred CA, the > session.CustomActionData property will get that data more > easily. > > However I think Phil's question was not about passing > data from immediate to deferred, hence my other reply. > > -Jason- > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Christopher Painter > Sent: Monday, June 16, 2008 4:46 PM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] DTF: Saving data in deffered > custom action > > If you wire up an installer class CA in VDPROJ and edit the > resultant MSI in Orca you'll see that you are actually > getting 2 CA's for each CA. Was is a Type 51 CA > that's setting a property with the same name as the > second deferred CA. This is the serialization of > properties that the installcontext is deserializing for > you. > > So for DTF, whether it's WiX or InstallShield or > whatever, you need an immeadiate CA that serializes and > sets the property that will become CustomActionData and > then in your deferred CA you need to deserialize it. > > The serialization looks something like this: ( shoot from > hip coding, not tested ) > > CustomActionData cad = new CustomActionData(); > cad.Add( new > KeyValuePair<"PROPA","VALUEA"); > session["DeferredCustomActionName"] = > cad.ToString(); > > The deserialization looks something like this: > > CustomActionData cad = new > CustomActionData(session["CustomActionData"]); > string valuea = cad["PROPA"]; > > BTW, in case Jason is reading, maybe I'm missing > something but the constructor choices for the > CustomActionData class could probably be a little better. > The CustomActionData property is always `CustomActionData` > so maybe there should be an overload that takes the session > class as an argument and automatically gets the > CustomActionData property. > > I hope that helps. > > Regards, > Chris > > > 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 > > > --- On Mon, 6/16/08, Phil H <[EMAIL PROTECTED]> > wrote: > > > From: Phil H <[EMAIL PROTECTED]> > > Subject: [WiX-users] DTF: Saving data in deffered > custom action > > To: wix-users@lists.sourceforge.net > > Date: Monday, June 16, 2008, 6:34 PM > > I have inherited some WIX code (ie I am a newbie) and > have > > moved the managed > > custom action over to DTF (which is very nice BTW). > > > > Previously the CA did something along these lines: > > > > public class MyInstaller : > > System.Configuration.Install.Installer > > { > > public override void > > Install(System.Collections.IDictionary stateSaver) > > { > > base.Install (stateSaver); > > stateSaver.Add(SS_KEY_INSTALLED_PROFILE, > AddProfile()); > > : > > } > > > > public override void > > Uninstall(System.Collections.IDictionary savedState) > > { > > : > > bool didInstallProfile = > > (bool)savedState[SS_KEY_INSTALLED_PROFILE]; > > : > > } > > } > > > > > > Using DTF how can I store a value during the install > that I > > can retrieve in > > the uninstall? Note that I am using a deferred custom > > action so the Database > > etc properties of the DTF Session object aren't > > available. > > > > Out of hope I tried session.CustomActionData but that > > doesn't seem to > > persist. > > > > TIA, > > > > Phil > > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users