If you have a bootstrapper that is marked in Vista as "requiresElevation" the entire MSI will be elevated since the MSI APIs will be called from that elevated context. There are several negative issues that can result from that (you may discover that the reason you need elevation causes repair or even uninstallation failures).
The series of blogs with the table of contents on this post (http://blogs.msdn.com/rflaming/archive/2006/10/01/uac-in-msi-notes-answers- to-questions-in-comments-from-earlier-blog-posts.aspx) is an excellent guide to understanding Rob's statement. I especially like this (http://blogs.msdn.com/rflaming/archive/2006/09/21/765586.aspx) post in the series to see what parts of the install run from the POV of the "installing user" and from LocalSystem. Note that the "installing user" will either be elevated or not depending on the context of whomever is calling the APIs. Note also that msiexec.exe runs "asInvoker", so it won't elevate by itself. This blog post (http://blogs.msdn.com/astebner/archive/2006/12/13/some-useful-things-i-have -learned-about-windows-installer-and-uac.aspx) is a good place to see how to adjust WiX authoring to fix these issues. -----Original Message----- From: Roy Chastain [mailto:r...@roychastain.org] Sent: Friday, September 11, 2009 3:57 AM To: General discussion for Windows Installer XML toolset. Subject: [WiX-users] Please explain - "ran your entire MSI elevated" Rob Mensching just made the reply below and I don't want to hi-jack that conversation, but I would like an explanation of that that statement. Do we have control over what part of the install is elevated and if so, how? ---------------------------------------------------------------------- Roy Chastain -----Original Message----- From: Rob Mensching [mailto:r...@wixtoolset.org] Sent: Friday, September 11, 2009 06:40 To: General discussion for Windows Installer XML toolset. Subject: 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: > > <Custom Action="EditConfig" After="InstallFinalize" > Overridable="no"></Custom> > > where After="InstallFinalize" is the key ;) > > Adrian > > 2009/9/11 John Nannenga <john.nanne...@microsoft.com> > > >> 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?? >> >> <CustomAction >> Id="EditConfig" >> BinaryKey="EditConfigDLL" >> DllEntry="EditCPConfig" >> Execute="immediate" >> Return="ignore" /> >> <Binary Id="EditConfigDLL" SourceFile="ConfigEditCA.CA.dll" /> >> <InstallExecuteSequence> <Custom Action="EditConfig" >> After="InstallFiles" Overridable="no"></Custom> >> </InstallExecuteSequence> >> >> 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-install >> ation-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 > ------------------------------------------------------------------------ ------ 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