views:

475

answers:

6

I am researching various options for deploying a batch of .Net applications. Deployment is more than just copying files, we need to stop/start services, call an exe that executes database scripts, initiate a number of setup.exe installs, etc.

These scripts will be given to a third-party who will apply various application updates to our various customers servers.

The two best options appear to be CS-Script and Powershell, but I'll let the voting decide.

UPDATE: Based on the responses so far I feel like I should clarify. First, the people applying the updates will be system administrator types; not end users. So, in this case, a full-blown installer Wix, Wise, etc. is probably overkill.

Second, it IS safe to assume that .Net 2.0 and even Powershell (or CS-Script, or whatever) will be installed on these machines. We are creating the images so we can specify what gets installed. The trouble is once we decide on an image, outside of the application updates we will be scripting it will be very difficult to install "new" applications.

Thanks.

A: 

It really all depends on what you are comfortable with and how the end user if any will be using it. All scripting languages will allow you to do what you want. You could even use a simple batch script to accomplish this.

If there are going to be end users involved and they are not expected to be system administrators I would suggest going with a full installer. This way they are graphically told what is being done. If it is for system administrators or just for your self use what ever scripting language lets you get it done first even if it is VBS.

Adam Peck
A: 

The downside to using PowerShell as a scripiting envorinment for deployment is that you have to ensure that target computers have .Net Framework 2.0 and PowerShell. To do this you'll need a script and hence you're back to the original question minus powershell.

I love PowerShell as a scripting environment. It's easy to use, flexible and can easily handle deployment scenarios. Also, since it runs on .Net and you're deploying .Net, there is less overhead for internal people to look at and debug the script.

Personally, I would take the hit to have a bootstrap script that ensures PowerShell is installed and then use PowerShell as the actual deployment script.

JaredPar
A: 

it sounds like you're looking to make a wrapper package for installing and setting up a number of other things...

as a former windows installer developer, i can highly recommend NSIS for an easy to create and fully script driven installer process. there are tons of plugins available for NSIS that will allow you to run external programs, start and stop services, capture command line output, and basically do anything you can imagine within their scripting language

link for NSIS: http://nsis.sourceforge.net/Main_Page

bwknight877
+3  A: 

I recommend WiX for creating installers. It has all the power needed to get good jobs done, and it is free, supported by microsoft, declarative and extensible. It nicely integrates into VisualStudio and the MSBuild-Process as well.

BeowulfOF
A: 

We've taken a variety of approaches. In the end, what has been working well for us is:

  • Normal Executables with good command line handling.
  • Libraries exposed to scripting (F#, IronPython, CS-Script) for operations.
  • msbuild (calling exexcutables, sometimes custom tasks, sometimes scripts)

Speculative: Consider using MS Deploy (at RC1). It does most of what you need to do. I'm evaluating now.

What works poorly: Having a hodgepodge of the above + batch files. As time goes on, everything will tend to moves into executables and installation libraries as it is the technology that can handle all tasks and scale. Mandatory user interface steps are evil and force manual installation.

CS-Script and Powershell both have drawbacks. CS-Script - clunky assembly referencing schemes. Powershell: few people can stand to look at it. Do a proof of concept in each before going with these - maybe you'll like them better than I did. My experience is light for these - after proof of concept I switched off to IronPython.

Precipitous
+1  A: 

Comparing csscript and PowerShell, here are some advantages of csscript over PowerShell:

  • csscript is lighter-weight, easier to deploy. http://www.csscript.net/help/Deployment.html says: "distribute the script engine executable (cscs.exe/csws.exe) along with the script itself".
  • C# is a widely accepted language with an easily-accessible debugger. Powershell is yet-another-language to learn.
  • C# can optionally be compiled
Jim Fred