Re: [WiX-users] C# Custom Action, change some files during installation
That will only work if the target file is not in a per-machine directory or you ran your entire MSI elevated (icky, icky, icky). Adr!an Serafin wrote: > Hi! > > Thank's for the response :) I need my own CA for some other things to ;) > Besides I found solution. If anyone needs it: > > Overridable="no"> > > where After="InstallFinalize" is the key ;) > > Adrian > > 2009/9/11 John Nannenga > > >> You likely don't need your own CA for this, check out XmlConfig or XmlFile. >> >> Your problem here is likely that you get a FileNotFoundException or >> something similar which is due to the fact you have your CA scheduled to >> execute in the "immediate" sequence and scheduled after "InstallFiles" which >> doesn't put any files onto the machine until the "deferred" sequence. >> >> >> >> ________________ >> From: Adrian Serafin [abus...@gmail.com] >> Sent: Thursday, September 10, 2009 9:10 AM >> To: wix-users@lists.sourceforge.net >> Subject: [WiX-users] C# Custom Action, change some files during >> installation >> >> Hi! >> >> I'm struggling with this for some time now... I'm trying to make my custom >> action to modify applications config.exe file but no success. Maybe someone >> can help?? >> >> >Id="EditConfig" >>BinaryKey="EditConfigDLL" >>DllEntry="EditCPConfig" >>Execute="immediate" >>Return="ignore" /> >> >> >> >> >> >> And here is c# code: >> >> public static ActionResult EditCPAConfig(Session session) >>{ >>string db_user = session["DB_USER"]; >>string db_password = session["DB_PASSWORD"]; >>string u_profile = "localSU"; >> >>string installdir = session["INSTALLDIR"]; >> >>System.Xml.XmlDocument xml_doc = new System.Xml.XmlDocument(); >>System.Diagnostics.Debugger.Launch(); >>xml_doc.Load(installdir + "Cairo.Producer.Admin.exe.config"); >>System.Diagnostics.Debugger.Launch(); >>System.Xml.XmlElement conf_elem = xml_doc.DocumentElement; >>System.Xml.XmlElement conn_string = >> (System.Xml.XmlElement)conf_elem.FirstChild; >>System.Xml.XmlElement add_conn = xml_doc.CreateElement("add"); >> >>add_conn.SetAttribute("name", u_profile); >>add_conn.SetAttribute("connectionString", "something"); >>add_conn.SetAttribute("providerName", "Npgsql"); >> >>conn_string.AppendChild(add_conn); >>xml_doc.Save(installdir + "Cairo.Producer.exe.config"); >>System.Diagnostics.Debugger.Launch(); >> >>return ActionResult.Success; >>} >> >> Code works when i put files in installfolder on my computer... >> -- >> View this message in context: >> http://n2.nabble.com/C-Custom-Action-change-some-files-during-installation-tp3617476p3617476.html >> Sent from the wix-users mailing list archive at Nabble.com. >> >> >> -- >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> ___ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> -- >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> ___ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> > ---
Re: [WiX-users] C# Custom Action, change some files during installation
Hi! Thank's for the response :) I need my own CA for some other things to ;) Besides I found solution. If anyone needs it: where After="InstallFinalize" is the key ;) Adrian 2009/9/11 John Nannenga > You likely don't need your own CA for this, check out XmlConfig or XmlFile. > > Your problem here is likely that you get a FileNotFoundException or > something similar which is due to the fact you have your CA scheduled to > execute in the "immediate" sequence and scheduled after "InstallFiles" which > doesn't put any files onto the machine until the "deferred" sequence. > > > > > From: Adrian Serafin [abus...@gmail.com] > Sent: Thursday, September 10, 2009 9:10 AM > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] C# Custom Action, change some files during > installation > > Hi! > > I'm struggling with this for some time now... I'm trying to make my custom > action to modify applications config.exe file but no success. Maybe someone > can help?? > > Id="EditConfig" >BinaryKey="EditConfigDLL" >DllEntry="EditCPConfig" >Execute="immediate" >Return="ignore" /> > > > > > > And here is c# code: > > public static ActionResult EditCPAConfig(Session session) >{ >string db_user = session["DB_USER"]; >string db_password = session["DB_PASSWORD"]; >string u_profile = "localSU"; > >string installdir = session["INSTALLDIR"]; > >System.Xml.XmlDocument xml_doc = new System.Xml.XmlDocument(); >System.Diagnostics.Debugger.Launch(); >xml_doc.Load(installdir + "Cairo.Producer.Admin.exe.config"); >System.Diagnostics.Debugger.Launch(); >System.Xml.XmlElement conf_elem = xml_doc.DocumentElement; >System.Xml.XmlElement conn_string = > (System.Xml.XmlElement)conf_elem.FirstChild; >System.Xml.XmlElement add_conn = xml_doc.CreateElement("add"); > >add_conn.SetAttribute("name", u_profile); >add_conn.SetAttribute("connectionString", "something"); >add_conn.SetAttribute("providerName", "Npgsql"); > >conn_string.AppendChild(add_conn); >xml_doc.Save(installdir + "Cairo.Producer.exe.config"); >System.Diagnostics.Debugger.Launch(); > >return ActionResult.Success; >} > > Code works when i put files in installfolder on my computer... > -- > View this message in context: > http://n2.nabble.com/C-Custom-Action-change-some-files-during-installation-tp3617476p3617476.html > Sent from the wix-users mailing list archive at Nabble.com. > > > -- > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ___ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > -- > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ___ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
Re: [WiX-users] C# Custom Action, change some files during installation
You likely don't need your own CA for this, check out XmlConfig or XmlFile. Your problem here is likely that you get a FileNotFoundException or something similar which is due to the fact you have your CA scheduled to execute in the "immediate" sequence and scheduled after "InstallFiles" which doesn't put any files onto the machine until the "deferred" sequence. From: Adrian Serafin [abus...@gmail.com] Sent: Thursday, September 10, 2009 9:10 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] C# Custom Action, change some files during installation Hi! I'm struggling with this for some time now... I'm trying to make my custom action to modify applications config.exe file but no success. Maybe someone can help?? And here is c# code: public static ActionResult EditCPAConfig(Session session) { string db_user = session["DB_USER"]; string db_password = session["DB_PASSWORD"]; string u_profile = "localSU"; string installdir = session["INSTALLDIR"]; System.Xml.XmlDocument xml_doc = new System.Xml.XmlDocument(); System.Diagnostics.Debugger.Launch(); xml_doc.Load(installdir + "Cairo.Producer.Admin.exe.config"); System.Diagnostics.Debugger.Launch(); System.Xml.XmlElement conf_elem = xml_doc.DocumentElement; System.Xml.XmlElement conn_string = (System.Xml.XmlElement)conf_elem.FirstChild; System.Xml.XmlElement add_conn = xml_doc.CreateElement("add"); add_conn.SetAttribute("name", u_profile); add_conn.SetAttribute("connectionString", "something"); add_conn.SetAttribute("providerName", "Npgsql"); conn_string.AppendChild(add_conn); xml_doc.Save(installdir + "Cairo.Producer.exe.config"); System.Diagnostics.Debugger.Launch(); return ActionResult.Success; } Code works when i put files in installfolder on my computer... -- View this message in context: http://n2.nabble.com/C-Custom-Action-change-some-files-during-installation-tp3617476p3617476.html Sent from the wix-users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
[WiX-users] C# Custom Action, change some files during installation
Hi! I'm struggling with this for some time now... I'm trying to make my custom action to modify applications config.exe file but no success. Maybe someone can help?? And here is c# code: public static ActionResult EditCPAConfig(Session session) { string db_user = session["DB_USER"]; string db_password = session["DB_PASSWORD"]; string u_profile = "localSU"; string installdir = session["INSTALLDIR"]; System.Xml.XmlDocument xml_doc = new System.Xml.XmlDocument(); System.Diagnostics.Debugger.Launch(); xml_doc.Load(installdir + "Cairo.Producer.Admin.exe.config"); System.Diagnostics.Debugger.Launch(); System.Xml.XmlElement conf_elem = xml_doc.DocumentElement; System.Xml.XmlElement conn_string = (System.Xml.XmlElement)conf_elem.FirstChild; System.Xml.XmlElement add_conn = xml_doc.CreateElement("add"); add_conn.SetAttribute("name", u_profile); add_conn.SetAttribute("connectionString", "something"); add_conn.SetAttribute("providerName", "Npgsql"); conn_string.AppendChild(add_conn); xml_doc.Save(installdir + "Cairo.Producer.exe.config"); System.Diagnostics.Debugger.Launch(); return ActionResult.Success; } Code works when i put files in installfolder on my computer... -- View this message in context: http://n2.nabble.com/C-Custom-Action-change-some-files-during-installation-tp3617476p3617476.html Sent from the wix-users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users