James Beninger
James Beninger

Reputation: 2317

MSDeploy - Prompt for Parameters

I've got a web deployment package I've built using Visual Studio 2010. I've defined a Parameters.xml file, which includes all of the parameters, descriptions, and default values.

When deploying a web application in IIS 7, it will automatically look at the parameters and build a GUI for the user, as seen here.

Does anyone know of any equivalent in IIS 6? We need to run the deployment locally, so Web Deploy isn't an option. Right now, I'm planning on using the generated ProductName.deploy.cmd file to install the package. But (as far as I can tell) the only way to set parameters with this method is to populate the ProductName.SetParameters.xml file. This file doesn't contain any of the descriptions from the original Parameters.xml file. It's just a set of key/value pairs.

Is there any way to prompt users for parameters - including the parameter descriptions - when running msdeploy? Or am I out of luck until I can use IIS 7?

Upvotes: 0

Views: 853

Answers (1)

Sayed Ibrahim Hashimi
Sayed Ibrahim Hashimi

Reputation: 44312

I don't think that there is a UI like what you are looking for targeting IIS 6.

With that being said I have just released a Nuget package which I think would be helpful to you, read more at http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx. To give you a summary of why I think that it will help you is that after installing the Nuget package when you create a package from the web project in VS there will be a .ps1 file generated. When you execute that .ps1 file it will walk you through a publish, and one aspect of that is prompting for the parameter values. It prompts for two types of values:

  1. MSDeploy endpoint info
  2. MSDeploy parameter values

Based on #2 if you had any parameters declared when you invoked a publish you would be prompted for them, and it will show you the default value. For example take a look at the image below (green text is the param name, cyan text is the default value).

enter image description here

Based on this thread I just realized that I'm not showing the description for the parameters, but I'm wondering if that would be too much info. Let me know if you have any thoughts in this area.

Note in order for this to work for you at this time you'll need the following installed on the machine running the publish:

  • Powershell v2
  • MSDeploy v2

To give some info how this is implemented in case you want to do something similar w/o using my extension here is the info. MSDeploy has a verb, getParameters, which can be used to determine all the parameters which exist for a package. For example we can execute the command

%msdeploy% -verb:getParameters -source:package=WebApplication1.zip

And the result would be what's shown below. enter image description here After you have that XML you can create whatever prompts/processes you want.

Upvotes: 1

Related Questions