It would have helpe if I read the entire question. :-)

For persisting Data I take a multiple step approach that allows considering all 
the modes an install will run including interactive with custom dialogs for 
setting values and silent installs for passing values in.   The idea is the 
priority of values is

(Greatest to least)
1) Value set during UI
2) Value set from command line
3) Value harvested from statesaver
4) Default value from property table

I have found this pattern very bulletproof over the years and I can share a 
more detailed example if you like.

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, Jason Ginchereau <[EMAIL PROTECTED]> wrote:

> From: Jason Ginchereau <[EMAIL PROTECTED]>
> Subject: Re: [WiX-users] DTF: Saving data in deffered custom action
> To: "General discussion for Windows Installer XML toolset." 
> <wix-users@lists.sourceforge.net>
> Date: Monday, June 16, 2008, 6:47 PM
> Session.CustomActionData is primarily meant for passing data
> from immediate to deferred CAs.
> 
> DTF doesn't currently provide a built-in mechanism for
> persisting state across install sessions, though that might
> be a nice feature to add.
> 
> For now you'll need to stash the data either in a
> registry key or in a file. (The
> System.Configuration.Install.Installer
> "stateServer" data gets saved in a .installstate
> file in the same directory as the assembly.) I guess you
> could make use of the CustomActionData class here, since it
> provides a convenient way to serialize a string dictionary.
> 
> Just be careful to think about what happens to the data in
> all scenarios including rollback, repair, and
> upgrade/patching.
> 
> -Jason-
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Phil H
> Sent: Monday, June 16, 2008 4:35 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] DTF: Saving data in deffered custom
> action
> 
> 
> 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


      

-------------------------------------------------------------------------
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

Reply via email to