Why no use ServiceInstall etc to install the service, but then change the appropriate user info via the WiX registry calls?
That way MSI is in charge of correctly uninstalling and removing the appropriate registry settings. Dominique. -----Original Message----- From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] Sent: Sat 10/10/2009 8:57 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Which way to install a Windows service is best? I see at least 4 ways my windows service could be installed. My goal is to be able to call some custom code so that I can set the username and password for the service by looking up and decrypting a value from the registry. Therefore I do not think that <ServiceInstall> is an option. The remaining ways I see to do this are the following and would like any suggestions on what is best and can fully support install, uninstall, rollback and commit. Thanks, Dave 1. Run an imbedded installutil.dll like my original MSI file did and is suggested here http://avinashkt.blogspot.com/2007/05/how-to-create-installer-using-wix-whic h.html - this seems complete but if possible I would like to not carry the baggage of the extra dll in my msi file. Also it seems there are some typos in the later actions in regards to $TheService>2 rather than =2 but maybe this is correct? 2. Run installutil.exe from the .net directory as suggested here: http://www.dalun.com/wix/12.07.2006.htm but I am concerned about having to worry about that program actually being there and wonder if this method supports uninstall, commit or rollback. 3. Ideally I would like to sort of self install by calling a class method in my service assembly to instantiate the ProjectInstaller class that is already defined and based on System.Configuration.Install.Installer that was inserted into my VS service project and references the System.ServiceProcess assembly. My understanding is this SHOULD be everything I need to install my service if I can somehow call the code from WIX. I think this is possible and wonder if this would be the best way to go as long as I could have actions for supporting install, uninstall, rollback and commit which I don't understand how WIX supports all that. 4. Possibly use <ServiceInstall> something like this http://avinashkt.blogspot.com/2007/05/how-to-install-windows-service-using.h tml if I could earlier run a custom action that looks up a registry entry and decrypts it for the account and password and then set properties that would be used by the <ServiceInstall> element account and password tags. This CA would have to access my .NET code. And here also, I'm unclear about how or if WIX supports the additional service actions of uninstall, rollback and commit as they are not in this example but do seem to be in this one http://blog.vagmim.com/2004/09/installing-windows-services-created.html which seems much more confusing to me but is old so maybe wix3 does all that automagically now. I like idea #3 best only because there is some compatibility with the VS service project as well as installutil and I already have the code there but I don't know if that choice is possible or best practice. Thanks for any suggestions and guidance to a WIX newbie, Dave ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) 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/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users AMX AMX UK Auster Road Clifton Moor York, North Yorkshire United Kingdom YO30 4GD +44 (0) 1904 343100 office +44 (0) 1904 343101 fax AMX South 6th Floor Salisbury House London Wall London United Kingdom EC2M 5QQ +44 (0) 2076 529450 office +44 (0) 8701 991661 fax AMX Belgium Boerenkrijglaan, 96a B-2260 Westerlo Belgium + 32 (0) 1454 2763 office + 32 (0) 1454 2766 fax ###################################################################### Attention: This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. Any views or opinions presented are solely those of the author. This email was scanned and cleared by NetIQ MailMarshal. ###################################################################### ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) 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/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users