Making an installer for a web app with database and a windows service - asp.net

I want to make an installer for a client which installs
a web app on IIS
a mssql db
a window service
I am totally naive to thinking of the solution for this automated deployment through an installer (msi or exe). The installer may hint the user for prerequisites for example MSSQL server and upgrading/installing IIS before the web app installation can proceed. Is it possible?

Yes, it is possible. You need to first select in an authoring tool for Windows Installer. Some examples are Windows Installer XML (WiX) and InstallShield (various editions from free to pricey). You'll have some kind of EXE bootstarpper/chainer where you can handle prerequisite installation such as windows features and database engines. Or you can choose to simply ship an MSI that detects and blocks if these are missing and put the effort on the user to manage their baseline environment. The actual MSI will then likely have features for web, service and sql. The web feature will install a bunch of files and configure the IIS meta. The windows service will install some files and create a windows service. The SQL feature will ask for connection string information, execute some sql scripts and possibly configure the web and service layers' connection strings.
Some of this can be deferred until after the installation and placed into a custom configuration utility to simplify the installer work.
There are various design decisions that can be made so it can't be answered in more detail in a simple question format.

Related

Complete installation of web aplication with data base and IIS

I have web form aplication in asp.net and i have to create (has to be easy to install)complex instalator, witch will install IIS server, deploy the app to it create a local database and sets everything up. So the user will just complete installation and then will just run the aplication with out and other setting(or as little as posible).
I have no idea what to use or if it is even posible. Coudl you help me with what to use and how to create such instalation?
Thanks.
In my opinion, you could try to use some extenstion tool to achieve your requirement.
Like Professional edition of Advanced Installer.
It support:
IIS web sites, app pools, web apps and virtual directories
Install windows features without writing any scripting

Standard approach to the server environment for the distributable asp.net package

For web application package vendors providing installer for some reason:
Would you share the "standard" approach to prepare fixed server environment for an asp.net application package? But some conditions I have:
1)My application requires iis, .net framework and sql server.
2)Windows Server itself, Sql Server licence and media is not provided by my company, end users provide them.(Usually standard edition.) When visiting end user site, Windows Os is already installed, but SQLserver media is not.
3)Install paths of sqlserver program, datas(mdf, ldf) can be changed by users according to server condition.
4)Users and my company officers don't want to change operational circumstances of endusers. Just want to change install procedure currently by manual manpower visiting physical sites of users.
5)Developper Environment:Visual Studio 2010.
6)We don't afford to buy Install Shield, or other non-free software.
I assume a concept that can be fulfilled by custom actions of WiX. But if such server environment should not be contained to a distributable installer which faces against the hostile circumstances of user servers ( install might fail for unknown reasons), I don't need uninstall function to my installer. But if WiX designers don't expect such installer, I might be in wrong path...
Any ideas?

How to deploy an ASP.NET project to Azure with WebDeploy

A little background (before I get downvoted to oblivion!)
I'm working on an intranet-hosted ASP.NET web application in a highly secure environment. At the moment it's deployed by building a package in Visual Studio, the zip file is copied onto the server and installed in IIS using WebDeploy (right-click -> Deploy -> Import Application).
What I'd like to do is deploy a sanitised version of this application to an Azure Web Site for demonstration purposes, however most of the standard Azure deployment methods do not apply to me because:
I work on a secure network so Visual Studio is blocked from connecting to Azure (rendering 95% of documentation irrelevant!)
installable software is strictly controlled on this network so I cannot install the Azure SDK needed to create Service Definitions, Configurations and Packages
The only machine I have access to which can connect to Azure is woefully underpowered and can only run puTTY, PowerShell and basic text editors.
At the moment, I have a Windows VM in Azure just running IIS and WebDeploy - this works but seems like overkill (and a good way to burn through my credit) when Web Apps in theory do everything I need.
What can I do?
Another option may be to checkin the WebDeploy package to a free subscription of Visual Studio Team Services (VSTS = TFS in the cloud) and then create a deployment pipeline in VSTS using the new Release Management features.
https://www.visualstudio.com/features/release-management-vs.aspx
in that case:
1) FTP from your machine using your own FTP client or i would recommend to use PSFTP from Putty package.
2) Still WebDeploy, but use that to generate the needed files, then you can use PowerShell like that.
You can also use https://www.microsoft.com/web/webmatrix/ to connect to azure websites. It works with HTTP, only problem could be a corporate proxy.

ALM - Application Lifecycle Management - Build and deployment challenge

I am stuck with a problem that I could use some feedback on to solve it in the best possible way.
The issue revolves around source control -> automated builds -> deployment. Basically ALM (Application Lifecycle Management).
We have a product – an ASP.NET Web application with a MS SQL database. This product is running on hundreds of websites with associated databases across multiple virtual machines in our production environment. At the moment the web applications and database are running on servers with IIS 7 and SQL Database Server 2008 R2. The product itself is source controlled in Team Foundation 2012.
For years the release of new versions of the product has been once or twice a year for years. Now we are going to focus on releasing more frequently and hence we need a strategy for the ALM for the product.
The deployment strategy now:
In the development period between the releases, the SQL update scripts has been created manually – each time a database change was made a script was updated. When the application is ready to be deployed it gets compiled on a developer machine. The database with all the changes used would be backed up into a .BAK file. The web application, the .BAK file and the update SQL script would be packaged (.zip) and uploaded to the production environment ready for deployment.
Update existing running products:
Copy/paste the web application in the target website physical folder.
Update the web.config file – connectionstring and application
variables. Run the update script via SQL Management Studio
This would be done for each and every customer – hundreds of times.
This is a very tedious and error prone task and I don’t like it at all!
What I would like to do instead is;
Source control the database as a Database Project in Team Foundation
Automatically build the web application with Team Foundation 2012
Build Server.
Deploy the output from the Build Server to the multiple websites of
the production environment along with automatically generated SQL
update scripts run against the SQL Server.
I have been googling my ass off - only finding bits and pieces regarding builds, deployment, automatic SQL update script etc.
What I think is partly the right direction is to source control the database and use the TFS Build Server. I am very confused on how to do the deployment itself in an easy and controlled way using the output from the TFS Build server.
Ideally I would want to the TFS Build server to create a package with the latest version of the Web application, the latest version of the database, post deployment script including an auto generated SQL Update script from the previous build to the current build. This could be contained in e.g. a nuget package. Then I would want to be able to create an additional web application which should manage the deployment – target, version, iis website, sql server, web.config connectionstrings etc.
Does anyone have any advice on how to achieve this? How do you do this?
You can use a release management tool to do this, no need to create an additional web application.
One such example is Deployment Manager, from Red Gate. (Disclaimer: I work there.) It has built-in deployment actions for ASP.NET apps and SQL Server databases. The command line tool RgPublish.exe can be used to create a package for the web app as you describe from TFS Build. The same can be done for the database using the sqlCI.exe command line and associated NANT/MSBuild scripts.
The same packages can then be deployed to each of your servers. You may run into scalability issues with 100s of websites though.
The database deployment works by generating the upgrade script automatically, though you can change the behaviour to put the upgrade script in the package, when the package is first built. These are called "dynamic" and "static" upgrade methods respectively.

ASP.NET Website installs/updates

I am looking for some ideas on how to offer a installation package for my ASP.NET website. Some things I need to be able to do is read/write Registry keys, get the database(s) information and test the connection and I must be able to overwrite the existing website without an uninstall and update the web config on new versions. I do not wish to uninstall the website and re-install it. I would like minimum downtime on upgrades. I think I am going to have to implement a custom solution and if this is true how can i include all the output of my web application into my custom solution?
EDIT: I am not installing this on my own system(s). This is for distribution to other clients who will be installing/upgrading the website. It is important that I be able to upgrade to the latest asp.net website without uninstalling. Ideally it would be overwriting the existing site and updating the web.config file.
Option 1. Create web application installation package
Use Web Setup Project for creating a web application installation package (.msi)
Creating or Adding a Setup Project at MSDN
You can create your installation the way it will offer user an Upgrate option of your application if it's already installed on his or her machine. That's not a problem.
Alternatives to Web Setup Project (all of them can handle upgrade scenarios):
Wise Installation Studio
InstallShield
Nullsoft Scriptable Install System - this one is free and open source
Optoin 2. Deploy web application on the server
You can use NAnt or MSBuild or IIS Web Deployment Tool for these tasks automation.
For example with NAnt of MSBuild you could specify tasks like these:
get project files from source repository
update .config file and maybe some other files if needed
compile you web application
update registry settings on the server
update database schema on the server
synchronize files (x-copy) between you build folder to IIS web folder
Web Deployment Blog
Option 3. Distribute your web applications via Web Plafrom Installer.
http://www.microsoft.com/web/
Have you looked into Web Deployment Projects or the IIS Web Deployment Tool?
I think you can build asp.net application into .msi package and install it. Is that what you are looking for? And then you can build all of your customization into pre-deployment and post-deployment scripts.
I use NAnt and NSIS with some small console apps where they can't easily do some manipulations I require.
Do you tried the new Microsoft Web Platform Installer (new! 2.0 beta)?

Resources