Reputation: 80744
I have an ASP.NET MVC application. And I need a way to deploy it.
BUT
I don't need to just copy it to my own web server. It's not meant to be a website that it available on the Internet. No.
Instead, I need my users to be able to install it on their own server. Which may or may not be visible from the Internet.
That is, I need to create an MSI package (or EXE self-extracting installer, or whatever) that my customer can just double-click on, and the MVC app should get installed on their local IIS.
I can, of course, just plain write some code that would extract the files, copy them to the local hard drive, and then create a website or a virtual directory in IIS, blah-blah-blah. But something tells me there should be an easier way. Like, say, a WiX extension that already does that. Or something.
Note: the application is very simple. No need for databases, special privileges, SMTP server configuration... Or, in fact, any kind of configuration at all. Just copy the files and create IIS app.
Upvotes: 8
Views: 6226
Reputation: 8540
What about web platform installer? Some links that may help by using web platform installer for your product:
Upvotes: 1
Reputation: 3682
This might need some coding but (if you need a pretty presentable UI) there is a feature in Visual Studio build deployment package.
Where it will build you a package that your customer can run to create all the necessary things in IIS, so IIS settings are applied as well. Scott Hanselman has a series of posts about it. You can change the default settings from package/publish settings.
. To deploy the packages you must have
msdeploy.exe
. You could send the zipped folder and when your customers run the .cmd file they will be up and running in no time. However if you want to put pretty bows around the package you can run it from a C# application ther will be some coding required but I'm sure that wont take more than 15 minutes.
Usage:
--------------------------
{0} [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...]
All you basically have to do is
System.Diagnostics.Process proc = new System.Diagnostics.Process();
const string filename = @"/*some file location*/";
proc.StartInfo.FileName = filename;
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
proc.WaitForExit();
Upvotes: 6
Reputation: 51
Whenever I run into the need for a complex install I always turn to WiX.
You can use WiX to install your MVC based website and then use the IIS Extension (http://wix.sourceforge.net/manual-wix3/iis_xsd_index.htm) to create a new app pool and site for it to run under.
A few issues I can think of that you might want to look into deeper would be:
Other than those points I think WiX + the IISExtension will easilly cover your basic, copy files and create website requirement.
Upvotes: 1
Reputation: 42125
There are web-specific setup projects in Visual Studio that you can use, though I believe the various deployment project types are being discontinued in favour of WiX at some point.
I don't know much about WiX, but I'd definitely look at that first to see if it'll do what you want. I imagine I'd end up with a WiX package that extracted the files to the place the user asked for them, and then executed a PowerShell script (deployed in the package) to configure IIS etc as necessary.
Upvotes: 0