Web setup project using wix
To get these extensions to work properly I had to work around a bug in the current build that causes the Cultures property to set incorrectly in the. Next I edited the default. This file sets up the basic install package structure. The iis:WebSite node is there just to provide a reference to the default web site on localhost. The Directory tags define the directory structure that will be created by the installer.
The Feature tag defines exactly which Component we are installing. In this case we are installing the group of Components called MyWebSite. We have not defined these yet, so lets add another. You should now have a setup project with a single Product.
Next, we need to add a reference to the TestService project. Adding a project reference to TestService , ensures the TestService.
It also generates a set of WiX preprocessor definitions that are required when configuring the Product. Also, you can find much more detailed documentation on each of the elements on the WiX Toolset website. What I will say, is if you use this Product. You will also need to change wherever it says var. TestService to the name of the service project you have referenced.
You will also need to add extra file elements for any extra files you need copied into the installation directory. You should now be able to right click on your TestService. Setup project and click Build. The Test Service. Running the Test Service. If you have used the project from the previous post, you should see a log. You can remove the service by going to Start , Control Panel , and then clicking on Uninstall a program.
Before we look at the product we must first add a reference to our. NET application we wish to create an installer for. Ensure that you adjust that reference to specify we want to harvest the files as below:. Now lets look at our Product. This is the file that the Wix binaries use to build the installation package. The main Product node is the installer; there is always exactly one of these: fill in the name, manufacturer and version to match your project. Ignore the Package and Media nodes, they will always stay like this until you start doing really complex stuff.
When you open the Product. First of all we'll want to alter the Product definition. The attributes in this tag will be familiar to anyone who has used the Visual Studio setup projects in the past we have Version , product name, upgrade code etc.
These are both GUIDs - the product code should be unique for every new product, even new versions of an existing product. The upgrade code should be unique for a related set of products i. Later this can be set to a specific GUID so you can control installing and unstalling websites on clients machines.
For this test , alter the name , your Manufacturer and add a media element as below. Setting EmbedCab to yes , using the EmbedCab attribute, we can decide whether we want the cabinet archive of our installation files to become part of the. Embedding is the usual decision for the final installation package thus resulting in a single, self-contained file for download or shipment on media.
If neither Cabinet nor EmbedCab is specified, the source files will be left untouched: they can then be copied directly on the distribution media, together with the installer. The directory section defines the structure of what we'll be installing and where it goes. Before tackling our directory structure lets have a think of what we're trying to achieve here.
The default Directory elements you get when you add a setup project assume you want to install into the ProgramFilesFolder. Obviously we dont want to do this for an IIS application, so what we're really looking for here is something like :. To Achieve this we can delete the current directory structure we get in the default product.
First off , we will have three nested directory elements as we see below under our main TARGETDIR , this is the root of the installer and we'll always have this in our product. This is where we want to begin our directory structure in the inetpub folder. Within our Directory structure we have our components.
You can have as many components here as you want here they could define what files or exes you want to include, they can define registry settings, IIS settings, service startup instructions -basically they are the bones of your application.
For this test ,since we want to install our basic website in IIS. In order to do so we will need to configure the some simple IIS elements under our components. Before we can do this , we need to add a reference in our Setup project to the WixIISExtension dll and include this file at the top of our product. We will only have one component in this simple setup project and it will be used to define our virtual directory.
Our component element is nested within our lowest level directory. We give our component element an id and a unique guid as an identifer. This component id will be used later on in the features section to tell the setup what we want installed.
Ensure you specify the path as your directory name specifed above. Next add a WebApplication element. As we can see above this sits within the WebVirtualDir as we'd expect.
0コメント