Creating files/etc. are things called state changes, which are supposed to be performed by deferred actions run between InstallInitialize and InstallFinalize and accompanied by rollback actions that undo the action in the case of an installation failure.
One of the more reliable ways to do those from your perspective would be to populate other tables such that between the actions already built into Windows Installer and the ones WiX supplies the activities of creating and populating the file(s) will be performed for you. Otherwise, you would need to use your action result to populate a property that a deferred custom action you would need to create that would use the content of the property to write the file. -----Original Message----- From: danimian [mailto:miand...@gmail.com] Sent: Tuesday, October 06, 2009 5:11 AM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] write custom action in csharp for storing information I am writing a custom action with the following code. The Challenge is save information during installation. [CustomAction] public static ActionResult MyCA(Session session) { DBInformation obj_DBInformation = new DBInformation(); obj_DBInformation.Server = session["SERVERNAMEPROP"]; DBConfigurator.AddDatabaseToCollection(obj_DBInformation); DBConfigurator.StoreConfig("C:\myOutput.xml"); return ActionResult.Success; } now in Product.wxs: <Property Id="SERVERNAMEPROP"></Property> <CustomAction Id="CAStoreInfo" BinaryKey="MyCA" DllEntry="MyCA" /> <Binary Id="MyCA" SourceFile="SaveInformation.dll" /> and in myConnectionDlg.wxs <Control Id="ServerEdit" Type="Edit" X="45" Y="84" Width="220" Height="15" Property="SERVERNAMEPROP" Text="{80}"> This code is not working, i mean not creating a .xml file as output (myOutput.xml). In myOutput.xml the entries must come which user give during installation. Please help me to accomplish it. Thanks Best Regards Adnan Kusuma Sudheer Kumar (Tata Consultancy Services) wrote: > > Session properties are the way to store the information. > I can create some properties in my Wix code and update the values like > session["PROPERTY1"]="jjjjj"; > > Can you provide more info as what are you planning to perform? > > Thanks, > Sudheer > BGE Build Team (X 34482) > > > -----Original Message----- > From: danimian [mailto:miand...@gmail.com] > Sent: Tuesday, October 06, 2009 2:41 PM > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] write custom action in csharp for storing information > > > Hi, > in tutorial there is an example of csharp custom action for checking Key > which look like this > public class SampleCheckPID > { > > [CustomAction] > public static ActionResult CheckPID(Session session) > { > string Pid = session["PIDKEY"]; > session["PIDACCEPTED"] = Pid.StartsWith("1") ? "1" : "0"; > return ActionResult.Success; > } > > But how to write a custom action in csharp for storing information during > installation? or which changes need to be done in the above code? > > Best Regards > Adnan > > -- > View this message in context: > http://n2.nabble.com/write-custom-action-in-csharp-for-storing-information-t p3773873p3773873.html > Sent from the wix-users mailing list archive at Nabble.com. > > ---------------------------------------------------------------------------- -- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > ---------------------------------------------------------------------------- -- > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > -- View this message in context: http://n2.nabble.com/write-custom-action-in-csharp-for-storing-information-t p3773873p3774591.html Sent from the wix-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users