Creating a WIX Installer for ASP. NET Web Applications. Example of creating a WIX installer for an ASP. NET Web application. Table of Contents. Introduction. A couple of months ago I started to write an installer for a web application. I decided to learn how to write it in WIX because I've heard positive reviews about it.
It wasn't so easy at the very beginning but the time I've spent in that platform is very valuable for me. Since then I realized that having an installer is an important part of the software delivery process.
This step-by-step tip shows how to create an installation for a VB.NET application by using Visual Installer's import wizard.
After writing an installer for a few projects, this activity became easy and fast. In this article, I will introduce code for creating an installer for a web application in WIX and I will show you how to compile it using commands from the command line. I will also introduce an msbuild script for creating an installer for a web application, starting from publishing a web application through harvesting the application content and finishing by compiling the installer. You will understand the process and thus you will be able to extend it according to the demands of your web application. Why do we need an installer for a web application?
In my professional career, I've been mostly developing ASP. NET web applications. Not all of them, but most of them. The software delivery process was always pushed to be a secondary activity and therefore underestimated by almost all of the team members. Not only in the early days but even today I meet good programmers with the vision that building an installer is not necessary.
Installer v0.50a Downloads: 4,630,282 | All Versions: 448,245,578 Download This application installs or updates eMule by a setup routine interactively, containing all languages and help files. Binaries v0.50a Downloads. MinGW Package Download and Installation Tool ===== $Id: readme.txt,v e70f37efc80b 2013/10/04 11:03:38 keithmarshall $ Description ----- mingw-get is a tool to assist. MinGW - Minimalist GNU for Windows download. MinGW - Minimalist GNU for Windows 2016-03-22 20:52:57 free download. MinGW - Minimalist GNU for Windows A native Windows port of the GNU Compiler Collection (GCC).
Xcopy (robocopy) will always work well, and raised issues will be solved ad- hoc in the production environment. But that's not professional, is it? Well, if you are creating a blog page for you or a friend of yours which should be deployed to a hosting service, then you probably don't need an installer for it. You will probably have no option to execute the installer on the hosting service because of lacking privileges. The only thing you will have available is FTP access.
So, why do we need to write an installer for a web application anyway? I would consider writing an installer for a web application which should be installed more than once and by someone else than the author of the web application. I would also consider writing an installer for a web application if there is continuous integration or a continuous delivery process as the part of the development. To be clear about that, have a look at the two following figures.
Figure B0. 1Figure B0. Developers create software and administrators take care of the servers. They don't know each other and the company has high fluctuation. In this case, administrators get an installer from developers and install software with no coordination with developers. If the installer is written really well, then minimum documentation for administrators is required. If a server crash occurs after a year, the administrator will be able to easily install the application again and won't have to contact the developer who is probably working somewhere else because he/she got a better offer.
Another example where the installer is a great option is when doing continuous integration. In that case, you usually want to redeploy your application during night side by side with a nightly build. This situation is shown by Figure B0.
OpenSSH for Windows. OpenSSH for Windows. OpenSSH for Windows is a free package that installs a minimal OpenSSH server and client utilities in the Cygwin package without needing the full Cygwin installation. The OpenSSH for.
Figure B0. 2A little theory at the beginning of the article has been fulfilled, so let's see some code. Creating a web application. The installer needs something as its input.
For that reason, we need to create a simple web application. Of course, I have created one. You can find it in the My. Web directory in the source code. It's very simple, contains just a single web page. Despite its simplicity, I placed the web application into a solution file of Visual Studio in order to be easily extended by custom libraries. The code for creating an installer is expecting a solution with a web application as an input.
Creating WIX code. In this section, I will introduce code for creating an installer in WIX. I am using version 3. WIX. I found this code being very universal during several projects I've been developing. I mean this is the template I always start with. As in many things, nothing's perfect, so I modify this template from project to project to be better and better. I do not say that the current version is the best, but works well for me.
I'm expecting to alter the code in this article in future if I modify some part to be written better. The installer for a web application is like any other and could not be written universally for all web applications. Though, take it as an example which could be extended according to the demands of your web application. I don't want to repeat what is already written in other well written articles, thus I will not go into the very details of the WIX code. I'm expecting the reader to know the basics of writing an installer using WIX.
A very nice resource for WIX is the official tutorial [1]. The source code contains comments for better orientation. The template I'm going to introduce now is divided into five files, as you can see in Figure C0.
Figure C0. 1 - Block scheme of the source files for an installer. File Name. Description. Configuration. Initialize. Declaration of variables used in installer. Product. Main file.
Defining the target directory structure, main UI, features, and so on. IISConfiguration. Does the demanded changes in IIS. UIDialogs. Definition of custom UI screens.
My. Web. UIDefinition of the order of the UI screens. Web. Site. Content. Generated code. Definition of the files from the web application output. Before describing the code, I should say what the installer exactly does. The visual representation could be seen on Figure C0. Figure C0. 2 - Steps done by the installer.
As you can see from Figure C0. It is obvious you need to copy your application to some directory on the target computer. You of course need to set up IIS in order to make the web application available for clients. The step about registering the web site to run under ASP. NET 2 is requested especially when you are deploying on IIS 6, and finally changing the configuration string is a feature that I have always needed in every web application I have ever written. The described actions need input information gathered from the person who processes the installation.
Therefore as part of the installer is a set of UI screens which have to be filled before the installer begins processing the installation. Note: As you may have noticed, the installer creates an application pool. For that action, the installer asks for an account under which the pool will be executed. Please read [6] for understanding what the account needs. It took me some minutes to figure out why the application pool created by the installer fails to start on particular servers. Configuration. Initialize. Definition of variables.
This file is an include file, thus the structure is quite a bit different from the others.="1. Include> -- > < Property. Id="VIRTUAL_DIR_VAL"Value="My. Web"/> -- > < Property. Id="WEB_APP_NAME"Value="My. Web"/> -- > < Property.
Id="WEB_APP_POOL_IDENTITY_DOMAIN"Value="POOL_DOMAIN"/> < Property. Id="WEB_APP_POOL_IDENTITY_NAME"Value="account- name"/> < Property. Id="WEB_APP_POOL_IDENTITY_PWD"Hidden="yes"/> -- > < Property. Id="CONNECTION_STRING"Value="Data Source=|SERVER|; Initial Catalog=|Database name|. User Id=|LOGIN|; Password=|PASSWORD|; Persist Security Info=True"/> < /Include> Listing C0. Configuration. Initialize.
As you can see on the previous listing, the file contains just an ID/VALUE collection of variables with default values. These values could be customized directly from the command line when you are launching the installation.
The main reason for having those is for mapping to UI dialogs and using them for parameterization of the installation. For example, the connection string will be prompted to be specified by the user during the installation and finally written into the configuration file.
Product. wxs - the main code of the installer. This code is the main code of the installer. It could be seen in Listing C0.
UTF- 8"< Wixxmlns="http: //schemas. IIs. Extension"xmlns: util="http: //schemas. Util. Extension"xmlns: netfx="http: //schemas. Net. Fx. Extension"> < Product.
Id="{FA1. B9. 33. B6. F6- 4. 13e- B6. F- 8. 6CA8. BCED6. E8}"Name="My. Web. Setup"Language="1. Version="1. 0. 0.
Manufacturer="My. Web. Setup"Upgrade. Code="{E5. C9. F3. E6- D1. A4. A9. 1D2.
D}"> < Package. Installer. Version="2. Compressed="yes"/> < Media.
Id="1"Cabinet="My. Web. cab"Embed. Cab="yes"/> -- > -- > < Property. Ref. Id="NETFRAMEWORK3.
SP_LEVEL"/> < Property. Id="WIXUI_INSTALLDIR"Value="INSTALLLOCATION"/> -- > < Directory. Id="TARGETDIR"Name="Source. Dir"> -- > < Directory. Id="Program. Files.
Folder"> -- > < Directory. Id="INSTALLLOCATION"Name="My. Web"> -- > < Directory. Id="MYWEBWEBSITE"Name="Website"> -- > < /Directory> -- > < /Directory> < /Directory> < /Directory> -- > < Feature. Id="Complete"Title="My. Web - My awesome web"Level="1"Display="expand"Configurable.
Directory="INSTALLLOCATION"> -- > < Feature. Id="Main. Content"Title="My. Web Website"Description="The website content"Level="1"> -- > < Component. Group. Ref. Id="My. Web. Iss. Configuration"/> -- > < Component. Group. Ref. Id="My. Web. Web. Components"/> -- > < Component.
Ref. Id="Web. Config. Cmp"/> < /Feature> < /Feature> < Directory. Ref. Id="MYWEBWEBSITE"> -- > < Component. Id="Web. Config. Cmp"Guid=""> -- > < File. Id="Web. Config. File"Key. Path="yes"Source="$(var. Dir)\Web. config"Vital="yes"/> < util: Xml.
File. Id="Modify. Connection. String"Action="set. Value"Permanent="yes"Element. Path="/configuration/connection. Strings/. add[\[]@name='My. Connection. String'[\]]"Name="connection.
String"File="[#Web. Config. File]"Value="[CONNECTION_STRING]"Selection.
Min. GW - Minimalist GNU for Windows. Min. GW Package Download and Installation Tool. Id: readme. txt,v e. Min. GW and MSYS. Configured via an online XML database, which is.
The XML database provides maintainers with a mechanism for the. Licensing Terms. - -- -- -- -- -- -- -- . Permission is granted to copy, modify and.
GNU General. Public License, Version 3, (or, at your option, any later version), as. Free Software Foundation; see the file COPYING, which. Note, in particular, that mingw- get is provided "as is", in the hope. WITHOUT WARRANTY OF ANY KIND; not even an. WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR. PURPOSE. Under no circumstances will the author, or the Min. GW Project. accept liability for any damages, however caused, arising from the use.
The information presented below describes the user visible changes. The online version of this. NEWS file, which is included in the source code package. Release date: 2. 01. This is a further bug fix release; it addresses the following issues: -- .
Min. GW- Feature #2. CLI and GUI. clients. Users are advised to review the changes which have been made. Min. GW- Bug #2. 02. Min. GW- Bug #2. 05. GUI's package list display.
Min. GW- Bug #2. 05. LUA_PATH environment variable is now. CLI and GUI clients. Min. GW- Bug #2. 05. Min. GW- Bug #2. 05. Lua interpreter now. Windows Scripting Host, to run any JScript or VBScript helper.
Windows Console. - The "Apply Changes" dialogue now assigns default focus to the "Apply". Release date: 2. 01. This is a bug fix release; it corrects a potential buffer overrun issue.
GUI client, as identified. Min. GW- Bug #2. 02. In addition to fixing the fundamental buffer overrun issue, the. Improved diagnosis of possible file collisions, resulting from the. No entry is now recorded in the installation manifest, for any file.
Min. GW #2. 02. 6). Carriage returns are now handled appropriately, when emitted to the. GUI client's diagnostic message handler pseudo- terminal windows.
All users of mingw- get- 0. Release date: 2. 01. This is the first release to incorporate a working prototype for the. GUI client, together with the integrated mingw- get- setup. With the advent of these additional capabilities, the existing. With this release of mingw- get- setup.
Installation Instructions" for further information. In addition to the addition of the GUI client, and the simplified first.
New "preferences" section in profile. See the comments within. The output from "mingw- get - -help" has been revised, to provide a.
The "gui. exe" subsidiary program has been renamed as "guistub. GUI from the command line. GUI support has been installed.
Such GUI support is now. Internal "globbing" of command line arguments is now explicitly. MSYS' sh. exe and. For users wishing to follow development at the source code level, the. CVS, to a new. git repository at git: //git.
INSTALL file, in the current source distribution. Release date: 2. 01. This is an emergency bug- fix release; it provides an immediate interim. It also incorporates the correction for bug #3. Release date: 2. 01. This milestone release marks the point at which the code base, for the. CLI implementation, is deemed to have progressed from alpha to beta (or.
It corrects several packaging deficiencies within the. The following bugs are fixed by this release: -- . Specifically, in the case of application of the - -reinstall option to. This is now. corrected, such that the - -reinstall action is applied recursively to. When performing the "install" action, with the - -reinstall option. This anomaly has now been corrected; when specified with. The following new features have been implemented: -- .
Forced installation of a specified (non- current) release. The package name specified as the predicate of any "install" or. In the case of any package. In each of the above command forms, "package- name" represents the. For example, if GCC has already been installed at version. Note that, particularly in the case of the inequality qualifiers, the.
Also note that any explicit *inclusive* version range, such as. Support for package maintainer scripted installation hooks. An embedded script interpreter, based on Lua version 5. Lua scripts embedded within. XML catalogue entry. This capability is further supported by the provision of Lua modules. MS- Windows shell.
New option: "- -desktop". Grants permission, to package maintainer specified scripts, to create. New option: "- -start- menu". Grants permission, to package maintainer specified scripts, to create. Installation Instructions.
The information which follows describes the procedure for installing and. The. online version of this document is an abridged form, focussing on the. INSTALL", within the source code. Please report bugs as directed at http: //mingw. Reporting_Bugs. First Time Installation of a Current Binary Release.
Note that, as of release 0. The installation instructions which. Windows, please refer to the following section.
First Time Installation of a Legacy Binary Release". To install mingw- get, visit the Min. GW files repository at. Installer" folder, download and run mingw- get- setup.
When this has completed, you will then be offered the option. Min. GW packages [**]. If you do choose to continue with package. GUI application, (regardless of whether you have accepted or.
GUI); to complete your initial. Select individual packages, within the upper right hand "list- view". GUI window. - From the "Package" menu, (which also appears as a pop- up, when you. Mark for Installation", in respect of each package. Having so marked all packages which you wish to install, from the. Installation" menu select the "Apply Changes" option, to complete.
After you have completed the installation of mingw- get, as described. Specifying the Configuration", for details. By default, mingw- get- setup. C: \Min. GW" directory. You are *strongly* recommended to adopt this. In. particular, those who choose to ignore this advice, and install Min. GW. into some subdirectory of (for example) C: \Program Files", usually.
The set of packages offered, as the foundation for a basic. Unlike mingw- get- inst. GCC. compiler suite. You are free to install it, or not, at your own option. First Time Installation of a Legacy Binary Release. The instructions which follow relate to the installation of mingw- get. Windows may not permit you to run.
For installation of release 0. First Time Installation of a Current Binary. To install mingw- get, visit the Min. GW files repository at.
Installer/mingw- get- < version> -< class> -< release> " folder. Whichever of these you choose to download, you should unpack it into the. Min. GW installation; (we. C: \Min. GW [*], unless. C: \Min. GW\bin) to your PATH; (this should. PATH assignment).
Having completed this phase of installation, you may then wish to review. Finally, to initialise the. C: \> mingw- get install mingw- get. If you insist on adopting a different directory from the recommended. Min. GW into some subdirectory of (for. C: \Program Files", usually discover to their cost that certain. This document will refer to files as though installed in the recommended.
C: \Min. GW. If, having read the. C: \Min. GW. [**] If you have chosen mingw- get- 0. C: \Min. GW\var\cache\mingw- get\packages.
C: \Min. GW prefix. You may then move the. Specifying the Configuration. When you invoke mingw- get, it will attempt to read configuration data.
C: \Min. GW\var\lib\mingw- get\data\profile. C: \Min. GW installation prefix, as.
C: \Min. GW\var\lib\mingw- get\data\defaults. Of this pair of files, profile. It is a liberally. XML file, which you are advised to copy to create profile.
At the present time, the only entries you should consider changing are. You probably want to make the path for the "mingw. R" notation, used in. C: \Min. GW, or an alternative location).
The recommendation to copy defaults. Upgrading an Existing Installation to a Newer Binary Release. Once you have completed a first- time installation of mingw- get, whether. Unless. you insist on *always* installing from source, (in which case each. C: \> mingw- get install mingw- get. C: \> mingw- get update. C: \> mingw- get upgrade mingw- get.
Otherwise, if you have a previously unfinalised installation, i. C: \> mingw- get install mingw- get. C: \> mingw- get update. C: \> mingw- get install mingw- get. Alternatively, any previous installation of mingw- get may be upgraded by.
Document: readme. Source: readme. txt, updated 2.