Here’s my current scenario which is specifically what i’d like to discuss as a case study, however I want this to be open enough to address other deployment practices for .NET projects.
I have a .NET WPF Application written to perform manufacturing functional tests. Currently this software is deployed by copying the executable and it’s dependancies to the target system. The slave communications systems are installed similarly, but installutil needs to be used to register a WCF windows service. This is all being done manually. Furthermore, configuration files are being read from custom xml data sources that are local to the application folder. No app.config is being used.
I think we can all agree this scenario is sub-par, and definately fails to even come close to an ideal launch condition
My questions are as follows:
- What should be used for setup and deployment? Setup and Deployment Wizard? Click-Once Deployment?
- How should I go about automating the installation of the windows service? Best way to specify custom username/password for the afforementioned service?
- What should be done about configuration if mutable application folder storage is considered harmful, how should I go about this? Isolated Application Storage?
Article links for any of the above would be ideal.
If you really want minimize risk of any deployment stuff ups due to human error, I’d be using WIX (http://wix.sourceforge.net/) to create separate msi installers for both the client WFP application and the windows service. WIX can be quite painful at times, but pretty much anything in terms of deployment can be achieved. There is a special WIX visual studio project available once WIX has been installed on your PC.
Enterprise IT guys I have worked with in the past have successfully used SMS or Active Directory to install any msi’s I have created for them in the past using WIX rather than click-once. This really has nothing to do with WIX though.
There are many articles on the web explaining how to install a windows service using WIX such as this one – Installing and starting a Windows Service using WiX.
Using WIX you can set custom username/password parameters to be provided at install time. These parameters can be set via an MST file, or via the commandline using the msiexec.exe command.
Using WIX, mutable configuration files can become a thing of the past as xml config settings files for various environments including production can live in separate MST files controlled by system administrators only. Added security for passwords and the like that live in secure key-safe repositories, these can be added via the commandline as described in the previous answer.
The settings parameters are passed at install to time to generated various configuration files that can then be set a readonly or even encrypted – Using WiX to fix up XML files when deploying to different environments.