4

There is a WCF service which is running under IIS. This service accesses the files in its folder, it accesses a SQL Server database and it writes messages to the EventLog.

The deployment platform is Windows Server 2008 in some datacenter. I developed the service, but I'm really still a beginner.

The deployment will causes the creation of a new Windows user account and, possibly, a role that is assigned to that user. This is needed to start the service from a separate account with strictly defined rights (as I understand, this approach is recommended, but not to start the service from NT Service account).

Obviously, the deployment needs to run scripts to create database, tables, scheduling of tasks.

What tools could you advice to accomplish such a deployment? Maybe I can use the standard Setup Project? Or some third-party tools such as WiX Toolset? Should I use PowerShell to create windows user account and role?

There is also a question: should I pull the prerequisites, such as .NET framework installer, SQL Server installer?

EngineerSpock
  • 2,575
  • 4
  • 35
  • 57

2 Answers2

2

You can rely on Windows installer using tools like WIX, InstallShield or Advanced Installer. WIX is the only free one albeit it has a higher learner curve. There are other free windows installation software solutions available as well such as NSIS. You can also write your own scripts such as in Powershell to create the IIS virtual directory, application pool and connect to the RDBMS to create the schema. You'll probably also would like to have an undeployment solution so you can uninstall it and upgrade it in the future. The Windows installer based tools almost gives you uninstall for free because it maintains a database of everything that was done during installation sans the custom actions you write such as the database schema setup.

For the user configuration part, some of these tools such as Advanced Installer can create new user accounts. However to define user rights assignment you might have to rely on a custom script using ntrights.exe from the Windows resource kit.

Andy Arismendi
  • 50,577
  • 16
  • 107
  • 124
  • And what about Inno Setup? Does WiX or NSIS provide the ability to execute .NET code and PowerShell scripts? – EngineerSpock Dec 25 '11 at 11:37
  • Wix can run .NET code by calling it in a custom action. Here's an [example](http://www.advancedinstaller.com/user-guide/qa-c-sharp-ca.html) of how to structure your c#. The custom action code will reside in a DLL called from the Windows installer engine. I've never used NSIS or Inno but just looking at the feature set and some of the doucmentation it looks like you'll have to create a c# console app and shell invoke it. It also looks like they have their own engines and don't use the Windows installer engine. Wix has extensions for working with databases and creating user accounts. – Andy Arismendi Dec 26 '11 at 00:23
1

As of my knowledge there is no automated deployment tool available for WCF because its require lots of manual configuration.

But you can try Octopus for .NET applications

http://www.paulstovell.com/octopus/intro

Anand
  • 717
  • 6
  • 20
  • There is automated deployment tool for WCF in VS2010. VS can create a deployment package consists of a WCF service and scripts you need to create a database. The problem is in custom settings which I need to configure. – EngineerSpock Dec 24 '11 at 15:26