This project is read-only.
Setup projects How-To

General information

Whenever a new version of the product has to be released to clients for installation, you have to do the following:
1. Generate 2 new Product Id’s, one for the server setup and another for the client setup. These Id’s can be generated with the Visual Studio “Create GUID” tool. You update the Product Id attribute in Product.wxs file for each one of the setup projects, server and client. Copy and paste the GUID without the enclosing brackets.
2. Increment the Product version number in Product.wxs for each one of the setup projects. You have to increment at least one of the first 3 version parts, for example from to or or
Note: Never change the UpgradeCode attribute! Otherwise the new setup package will not be able to detect if a previous version of the product is installed.

File Contents

Product.wxs: contains the main definition of the client and server products. Here you maintain the basic properties of the product, version numbers, features, components, directories, files etc.
License.rtf: contains the license agreement displayed to the user during the setup.
en-us.wxl: contains localizable strings
WixUI_XERPClient|Server.wxs: contains the user interface definitions for the setup dialogs. All custom dialogs as well as the sequence of dialogs to display when pressing Back/Next buttons are defined here.
HeatTransform.xslt: contains an XSL template to use for automatically adding web site creation for each WCF service. This template is also used to modify the configuration files of each WCF service to use a central configuration file XERPServerConfig.xml under the Config directory.

How to add new server or client modules to the setup projects.

Server modules
Each WCF project under Server.Service must be added to the server setup. The referenced DAL projects will be automatically included in the server setup, so there is no need to add them manually.
To add a service project to XERP.ServerSetup complete the following steps:
1. Add a project reference to the WCF project: Right-click References node under XERP.ServerSetup, click Add Reference, click Projects tab, select the XERP.Server.Service.XXXXXX project and add it to the references. Confirm that the properties of the reference are the following:
Name: XERP.Server.Service.XXXXXXX
Harvest: False
2. In Product.wxs find the section <Feature Id="XERP.Server.Service" … and add a new ComponentGroupRef:
<ComponentGroupRef Id="XERP.Server.Service.XXXXXXXX" />
This line will include the output files of the WCF and DAL projects to the setup package.
3. Find the section <DirectoryRef Id="INSTALLFOLDER" > and add a new Directory:
<Directory Id="XERP.Server.Service.XXXXXXX" Name="Service.XXXXXXX"/>
This line creates a directory under the installation folder to contain the output files of the WCF/DAL projects.
4. Add a property declaration for the port number of the WCF service:
<Property Id="XERP.Server.Service.XXXXXXXXX.Port" Value="9999"/>
This will be the port used by the WCF service
The server setup package will create separate folders for each WCF service under the root installation folder. It will also create separate IIS web sites for each WCF service. Each web site will listen to the assigned port.
A new IIS application pool named “XERP.Server.Service” will be created and it will be assigned to all the created WCF services. The setup creates a Windows user account for the application pool. The application pool credentials are entered by the user during the setup.
The user running the setup can select or not to create a database by selecting or deselecting the feature named “XERP.Database” at the feature selection setup dialog. If the user selects to install the database, the setup will also add a login for the application pool user account to SQL Server and give to it owner permissions to the created database. The connection between WCF services and SQL Server will use integrated security. A Config folder will be created under the installation folder. The setup places there a file named XERPServerConfig.xml containing the database connection string.
The installation folder can be customized by selecting the feature named “XERP.Server.Service” at the feature selection dialog and specifying an installation path.
At uninstallation time all the web sites and the application pool are removed. The database is not removed because there may have been data entered and the user should decide if he wants to delete the database manually. The windows user account for the application pool is also not removed to avoid need for reboot in case of reinstallation of the XERP Server (there is a bug of IIS that appears when you delete and recreate a windows user account and then reuse it for an application pool).
If the server setup detects that a database with the same name already exists, it displays a warning and gives the opportunity to cancel the setup or proceed and run the database creation sql script over the existing database. If the application pool user account already exists, its password is updated.

Client modules
All client and domain projects must be added as project references to XERP.ClientSetup
To add a client or domain project to XERP.ClientSetup only the following step is needed:
1. Add a project reference to the client or domain project: Right-click References node under XERP.ClientSetup, click Add Reference, click Projects tab, select the client or domain project and add it to the references. Confirm that the properties of the reference are the following:
Harvest: True
Project Output Groups: Binaries
The client setup will put all files (exe, dll and XERPClientConfig.xml) under the same installation folder. It will also create a Start menu and desktop shortcut for running XERP.Client.WPF.StartUp.exe
The base URI for connecting to the WCF services can be defined by the user at the setup dialog.
Client and server can be installed at different machines.

Permission Requirements

Both setup packages (client and server) must be run by a user with administrative privileges.

Wix Features

Server setup uses a manually modified wixproj file. You can view it by right-clicking XERP.ServerSetup project and selecting Unload. Then right-click again and select Edit to view the file as text.
There are two tasks defined in section <Target Name="BeforeBuild"> near the bottom of the file. MSBuild task builds and deploys all the referenced WCF projects in a temporary folder. Then the HeatDirectory task reads this folder and generates wxs files containing definitions for all the deployed files. An XML transformation is used to modify the wxs files so that web site and configuration file definition is performed automatically. The XML transformation is defined in HeatTransform.xslt. The resulting wxs files are included in the compilation and linkage of the setup package with appropriate settings in the setup project properties (right-click XERP.ServerSetupPropertiesTool SettingsAdditional Parameters for compiler and linker)
Client setup uses project harvesting to generate definitions of files from the client and domain projects.

Last edited Sep 23, 2013 at 3:02 PM by MattPaulson, version 1


No comments yet.