1

I have created a Web service. I need to add the ability to install it from the command line.

I created the installer for the web service like this:

I created a new Web Setup Project and added my web service to it. An installer user interface has been automatically created. It included a form for entering the parameters "Site", "Virtual directory" and "Application Pool". I added another form for typing two text parameters. Then I created a new project and called it "Deployment". In this project, I created the class "InstallAction". In it, I redefined the Install method to process my text parameters.

Now I need to add the ability to run the installer from the command line (Cmd.exe). The user interface should not be displayed! All parameters (including "Site", "Virtual directory" and "Application Pool") should be passed as parameters to the command. How to do this?

franiis
  • 1,292
  • 1
  • 15
  • 29
FaceHoof
  • 13
  • 3

1 Answers1

0

VS Setup Projects: Visual Studio Setup projects are limited. There are many alternative MSI tools. WiX is free and open source. Advanced Installer has great IIS features.


Parameters: I just commented on setup parameters in another question. Essentially your fields in your dialogs should have PUBLIC properties assigned to them (only PUBLIC - or UPPERCASE properties can be set at the command line). You must also mark these properties secure by adding them to the SecureCustomProperties list.

These pre-existing answers contain more detailed descriptions of how to deal with parameter passing:

Mock-Up: for your case, maybe something like this:

msiexec.exe /i setup.msi SITE="mysite.com" VIRTUALDIR="mysite.com" APPPOOL="mysite.com" /qn
Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140