If I were you I would use option 4. I would write an immediate CA that
retrieves and decrypts the account and password that I would schedule in
InstallExecuteSequence running sometime before the InstallServices action (I
would probably sequence it before CostInitialize, but that is just me).

That CA you write you should write using DTF if you need to use managed
code. Don't depend on a file you are installing being present in that CA and
don't depend on anything you will be adding to the GAC, which means you may
need to copy your code OR add assemblies to your CA to be used "locally" as
described in the DTF documentation for creating custom actions.

Each of your other options (including the second part of option 4) are all
forms of "self-registration" which are considered evil when it comes to
reliably being able to perform upgrades, repairs, rollbacks, removals, etc.
Please don't do them: self-registration is probably the MOST frequent cause
of MSI errors globally.

Professional deployment engineers tend to hate the VS-supplied deployment
solutions because they produce fragile installation packages that cause more
maintenance headaches than the generally solve. They are NOT a good example
to follow.

-----Original Message-----
From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] 
Sent: Saturday, October 10, 2009 12:58 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


------------------------------------------------------------------------------
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

Reply via email to