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

Reply via email to