Sie sind auf Seite 1von 45

Designer

Designer
forVisual
for VisualStudio
StudioWiX
WiXSetup
SetupProjects
Projects
Designer for Visual Studio WiX Setup Projects Designer for Visual Studio WiX Setup Projects

Designer for Visual Studio WiX Setup Projects


Revised on 22-May-15

Copyright © Add-in Express Ltd. All rights reserved.

Add-in Express, ADX Extensions, ADX Toolbar Controls, Afalina, AfalinaSoft and Afalina Software are trademarks or registered trademarks of Add-in Express
Ltd. in the United States and/or other countries.

THIS SOFTWARE IS PROVIDED "AS IS" AND ADD-IN EXPRESS LTD. MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY
WAY OF EXAMPLE, BUT NOT LIMITATION, ADD-IN EXPRESS LTD. MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE, DATABASE OR DOCUMENTATION WILL NOT
INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS

2 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Table of Contents

Table of Contents

Designer for Visual Studio WiX Setup Projects .................................. 2


Introduction ......................................................................................... 5
Why WiX Designer? ........................................................................................................................................ 6
System Requirements .................................................................................................................................... 6
Technical Support ........................................................................................................................................... 6
Installing and Activating................................................................................................................................. 6
Activation Basics ......................................................................................................................................................... 6
Setup Package Contents............................................................................................................................................. 7
Solving Installation Problems ...................................................................................................................................... 8
Add-in Express Products ............................................................................................................................... 8

Getting Started .................................................................................... 9


Your First Standard Setup Project .............................................................................................................. 10
Step #1 – Adding a WiX Setup Project ...................................................................................................................... 10
Step #2 – Setup Project File...................................................................................................................................... 11
Step #3 – Specifying the Target Folder ..................................................................................................................... 12
Step #4 – Application Project Outputs ....................................................................................................................... 13
Step #5 – Creating a Folder Hierarchy and Deploying Files...................................................................................... 14
Step #6 – Creating Registry Entries .......................................................................................................................... 15
Step #7 – Creating the Installer UI ............................................................................................................................ 16
Step #8 – Specifying Custom Actions ....................................................................................................................... 18
Your First Web Setup Project ...................................................................................................................... 20
Step #1 – Adding a WiX Setup Project ...................................................................................................................... 20
Step #2 – Setup Project file ....................................................................................................................................... 21
Step #3 – Specifying the Target Folder ..................................................................................................................... 22
Step #4 – Web Application Project Outputs .............................................................................................................. 24
Step #5 – Creating a Folder Hierarchy and Deploying Files...................................................................................... 24
Step #6 – Creating Registry Entries .......................................................................................................................... 25
Step #7 – Creating the Installer UI ............................................................................................................................ 26
Step #8 – Specifying Custom Actions ....................................................................................................................... 27

How To ............................................................................................. 29
How to add merge module reference to merge module project............................................................... 29
How to add merge module to setup project ............................................................................................... 32
How to make the setup project localizable................................................................................................. 34
Localizing the setup project: quick start..................................................................................................................... 34
Behind the scenes ..................................................................................................................................................... 36
Supported and non-supported languages ................................................................................................................. 37
Editing language-specific files ................................................................................................................................... 37
Testing multiple-language installer ............................................................................................................................ 38
Language-specific prerequisites ................................................................................................................................ 39

3 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Table of Contents

How to prevent running Install and Uninstall custom actions during upgrade ..................................... 40

Tips and Notes .................................................................................. 41


Web Setup ...................................................................................................................................................... 41
Configuring IIS .......................................................................................................................................................... 41
Prerequisites ................................................................................................................................................. 41
Deploying prerequisites ............................................................................................................................................. 41
The Prerequisites dialog............................................................................................................................................ 42
Merge Modules .............................................................................................................................................. 44

Finally ............................................................................................... 45

4 Add-in Express™
www.add-in-express.com
Add-in Express
Designer forStudio
for Visual OfficeWiX
andSetup
.net Projects Introduction

Introduction

WiX Designer is a development tool designed to simplify and speed up the creation of

WiX setup projects in Visual Studio. It provides the UI familiar for developers who created

setup projects using Visual Studio Installer.

5 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Installing and Activating

Why WiX Designer?


Microsoft introduced Visual Studio Installer many years ago. In Visual Studio 2012, they discontinued it in favor
of WiX – Windows Installer XML, a free software toolset that builds Windows Installer packages from XML code.

WiX is a flexible tool that provides an XML interface to features provided by Windows Installer (previously known
as Microsoft Installer). Still the Windows Installer concepts create difficulties for developers. Even with the XML
interface of WiX. This becomes evident in the typical case of "creating a simple installer". Although the concrete
meaning of the term "simple" varies, most developers agree that "seeing the picture" is often more productive
than "reading the text file".

"Seeing the picture" is what Visual Studio Installer provided for developers. With slightly more than a couple of
dialogs, Visual Studio Installer allowed the developers create the "simple" installer they craved for. Now with
Visual Studio Installer withdrawn, WiX Designer fills the gap.

System Requirements
WiX Designer supports creating WiX projects in Visual Studio 2010, 2012, 2013 and 2015.

WiX 3.6 or above must be installed.

Express editions of Visual Studio are not supported.

Technical Support
WiX Designer is developed and supported by the Add-in Express Team, a branch of Add-in Express Ltd. The
Add-in Express web site at www.add-in-express.com provides a wealth of information and software downloads.
In particular, see our technical blog it provides the recent information for WiX Designer developers.

For technical support use our forums or email us at support@add-in-express.com. Urgent problems can be
reported by email or using the Escalate To buttons on the forums.

Installing and Activating


There are two main points in the WiX Designer installation. First off, you have to specify the development
environments in which you are going to use WiX Designer (see System Requirements). Second, you need to
activate the product.

Activation Basics

During the activation process, the activation wizard prompts you to enter your license key. The key is a 30-
character alphanumeric code shown in six groups of five characters each (for example, AXN4M-GBFTK-3UN78-

6 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Installing and Activating

MKF8G-T8GTY-NQS8R). Keep the license key in a safe location and do not share it with others. This license key
forms the basis for your ability to use the software.

For purposes of product activation only, a non-unique hardware identifier is created from general information that
is included in the system components. At no time are files on the hard drive scanned, nor is personally identifiable
information of any kind used to create the hardware identifier. Product activation is completely anonymous. To
ensure your privacy, the hardware identifier is created by what is known as a "one-way hash". To produce a one-
way hash, information is processed through an algorithm to create a new alphanumeric string. It is impossible to
calculate the original information from the resulting string.

Your license key and a hardware identifier are the only pieces of information required to activate the
product. No other information is collected from your PC or sent to the activation server.

If you choose the Automatic Activation option of the activation wizard, the wizard attempts to establish an online
connection to the activation server, www.activatenow.com . If the connection is established, the wizard sends
both the license key and the hardware identifier over the Internet. The activation service generates an activation
code using this information and sends it back to the activation wizard. The wizard saves the activation code to
the registry.

If an online connection cannot be established (or you choose the Manual Activation option), you can activate the
software using your web browser. In this case, you will be prompted to enter the license key and a hardware
identifier on a web page, and you will get an activation code. This process finishes with saving the activation code
to the registry.

Activation is completely anonymous; no personally identifiable information is required. The activation code can
be used to activate the product on that computer an unlimited number of times. However, if you need to install
the product on several computers, you will need to perform the activation process again on every PC. Please
refer to your end-user license agreement for information about the number of computers you can install the
software on.

Setup Package Contents

The WiX Designer setup program installs the following folders on your PC:

 Bin – WiX Designer binary files

 Docs – WiX Designer documentation including class reference

WiX Designer setup program installs the following text files on your PC:

 licence.txt – EULA

 readme.txt – short description of the product, support addresses and such

 whatsnew.txt – this file contains the latest information on the product features added and bugs fixed.

7 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Add-in Express Products

Solving Installation Problems

Make sure you are an administrator on the PC.

On Vista, Windows 7 - 8 and Windows 2008 Server, set UAC to its default level.

In Control Panel | System | Advanced | Performance | Settings | Data Execution Prevention, set the "... for
essential Windows programs and services only" flag.

Remove the following registry key, if it exists:

HKEY_CURRENT_USER\Software\Add-in Express\{product identifier} {version}


{package}

Run setup.exe, not .MSI. If this is applicable, run setup.exe by right clicking it and choosing “Run as administrator”
in the context menu.

Finally, use the Automatic Activation option in the installer windows.

Add-in Express Products


Add-in Express provides a number of products for developers on its web site.

 Add-in Express for Microsoft Office and .NET

It allows creating version-neutral managed COM add-ins, smart tags, Excel Automation add-ins, XLL add-ins and
RTD servers in Visual Studio. See http://www.add-in-express.com/add-in-net/ .

 Add-in Express for Microsoft Office and CodeGear VCL

It allows creating fast version-neutral native-code COM add-ins, smart tags, Excel automation add-ins, and RTD
servers in Delphi. See http://www.add-in-express.com/add-in-delphi/ .

 Add-in Express for Internet Explorer and .NET

It allows developing add-ons for IE in Visual Studio. Custom toolbars, sidebars and BHOs are on board. See
http://www.add-in-express.com/programming-internet-explorer/ .

 Security Manager for Microsoft Outlook

This is a product designed for Outlook solution developers. It allows controlling the Outlook e-mail security guard
by turning it off and on in order to suppress unwanted Outlook security warnings. See http://www.add-in-
express.com/outlook-security/ .

8 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Getting Started

Here we guide you through developing of a WiX setup project using WiX Designer:

 Your First Standard Setup Project

 Your First Web Setup Project

9 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Your First Standard Setup Project


Here we demonstrate creating a standard setup project on an example of an existing Windows Forms application.

Make sure WiX Toolset is installed on your machine and registered with your Visual Studio. If WiX is not
listed in the About dialog of Visual Studio, install the WiX version supporting the Visual Studio version
that you use.

Step #1 – Adding a WiX Setup Project

In Visual Studio, open your solution, and add a WiX project to it: go to the Visual Studio main menu and click File
-> Add -> New Project to open the Add New Project dialog.

10 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Choose the Setup Project item in the Windows Installer XML node, specify the project name and click OK. Visual
Studio will add the setup project to the solution and open the Product.wxs file.

Step #2 – Setup Project File

Product.wxs is the source file of your setup project. A newly created project contains the XML code shown below.

<?xml version="1.0" encoding="UTF-8"?>


<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0"
Manufacturer="" UpgradeCode="aa918e08-bbdd-49fc-a9f2-fef05b153069">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is


already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="SetupProject1" Level="1">


<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef
below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
</Wix>

We suggest that you modify the file as described below.

As you can see in the code fragment above, the Manufacturer attribute is empty. Checking your project against
the WiX schema will generate an error message so you may want to set this attribute right now.

Pay attention to the MediaTemplate tag: by adding the EmbedCab="yes" attribute, you create a single .MSI file
as opposed to getting a CAB file along with the .MSI.

11 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #3 – Specifying the Target Folder

TARGETDIR is a special Windows Installer property (see here ) that specifies the root destination directory to
which the installer delivers the files on the target machine. In fact, TARGETDIR is the main entity of the Windows
Installer architecture. To specify it, you open the File System Editor.

Essential. The File System Editor reveals the fact that WiX pre-creates two folder entries: Application Folder and
Program Files Folder. You need to delete the Program Files Folder entry.

Now specify the DefaultLocation property:

12 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

The DefaultLocation property accepts all Windows Installer properties listed in Windows Installer Property
Reference at MSDN. Here is a couple of examples:

 [LocalAppDataFolder][Manufacturer]\[ProductName] - typical for installing per-user things

 [ProgramFilesFolder][Manufacturer]\[ProductName] - typical for installing 32-bit per-machine programs

 [ProgramFiles64Folder][Manufacturer]\[ProductName] - typical for installing 64-bit per-machine programs

Step #4 – Application Project Outputs

Add all required project outputs to the Application Folder. Adding the Primary Output is required for delivering the
binary form of your code to the target PC.

13 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

In the current version of WiX designer, adding the Primary Output doesn't add dependency assemblies required
by the application. You need to add such assemblies manually. Adding an assembly belonging to the .NET
Framework version (edition) that you currently use is not required.

Step #5 – Creating a Folder Hierarchy and Deploying Files

You use the File System Editor to specify how and where to create folders and files required for your program.

To refer to system folders such as User's Desktop or Global Assembly Cache Folder, right-click the File System
on Target Machine node and choose Add Special Folder on the context menu:

14 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #6 – Creating Registry Entries

You use the Registry Editor to create new and modify existing registry keys and values required for your program.

15 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #7 – Creating the Installer UI

WiX Designer provides a number of pre-created dialogs that you use to create the UI of the installer. If you need
your installer to support multiple languages, see How to make the setup project localizable.

Open the User Interface Editor and add required dialogs.

16 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

17 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #8 – Specifying Custom Actions

Use the Custom Actions Editor to specify the custom actions for your setup project.

18 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

19 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Your First Web Setup Project


Here we demonstrate creating a standard setup project on an example of an existing Web application.

Make sure WiX Toolset is installed on your machine and registered with your Visual Studio. If WiX is not
listed in the About dialog of Visual Studio, install the WiX version supporting the Visual Studio version
that you use.

Step #1 – Adding a WiX Setup Project

In Visual Studio, open your solution and add a WiX project to it: go to the Visual Studio main menu and click File
-> Add -> New Project to open the Add New Project dialog.

Choose the Setup Project item in the Windows Installer XML node, specify the project name and click OK.

Visual Studio will add the setup project to the solution and open the Product.wxs file.

20 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #2 – Setup Project file

Product.wxs is the source file of your setup project. A newly created project contains the XML code shown below.

<?xml version="1.0" encoding="UTF-8"?>


<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0"
Manufacturer="" UpgradeCode="aa918e08-bbdd-49fc-a9f2-fef05b153069">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is


already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="SetupProject1" Level="1">


<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef
below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
</Wix>

We suggest that you modify the file as described below.

As you can see in the code fragment above, the Manufacturer attribute is empty. When checking your project,
the WiX schema will generate an error message so you may want to set this attribute right now.

Pay attention to the MediaTemplate tag: by adding the EmbedCab="yes" attribute, you create a single .MSI file
as opposed to getting a CAB file along with the .MSI.

21 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #3 – Specifying the Target Folder

TARGETDIR is a special Windows Installer property (see here ) that specifies the root destination directory to
which the installer delivers the files on the target machine. In fact, TARGETDIR is the main entity of the Windows
Installer architecture. To specify it, you open the File System Editor.

Essential. The File System Editor reveals the fact that WiX pre-creates two folder entries: Application Folder and
Program Files Folder. You need to delete the Program Files Folder entry.

Now convert the Application Folder item to Web Application Folder:

22 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Now, you set the properties of the Web Application Folder as required.

23 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #4 – Web Application Project Outputs

 Add the Content Files project output to the Web Application Folder:

 Add the Primary Output to the bin subfolder of the Web Application Folder:

 In the current version of WiX designer, adding the Primary Output doesn't add dependency assemblies
required by the application. You need to add such assemblies manually. Adding an assembly belonging to
the .NET Framework version (edition) that you currently use is not required.

Step #5 – Creating a Folder Hierarchy and Deploying Files

You use the File System Editor to specify how and where to create folders and files required for your application.

To refer to system folders such as User's Program Menu or Global Assembly Cache Folder, right-click the File
System on Target Machine node and choose Add Special Folder on the context menu:

24 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #6 – Creating Registry Entries

You use the Registry Editor to create new and modify existing registry keys and values required for your program.

25 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #7 – Creating the Installer UI

WiX Designer provides a number of pre-created dialogs that you use to provide the UI of the installer. If you need
your installer to support multiple languages, see How to make the setup project localizable.

Open the User Interface Editor and add required dialogs.

26 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

Step #8 – Specifying Custom Actions

Use the Custom Actions Editor to specify custom actions for your setup project.

In the screenshot below, the Primary Output of the CustomAction project is already added to the bin subfolder:

27 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started

28 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

How To

How to add merge module reference to merge module project


In the Solution Explorer window, select a merge module project, choose View | View WiX Editors | File System
Editor on the main menu, right-click the root entry (File System on Target Machine) and choose Add Merge
Module Reference on the context menu:

This opens a FileOpen dialog. Select a merge module and add it to your project:

29 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

30 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

Here's the merge module reference added:

The files and merge modules the referenced merge module provides are listed in the Files and
ModuleDependencies properties; see the screenshot above.

31 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

How to add merge module to setup project


In the Solution Explorer window, select a merge module project, choose View | View WiX Editors | File System
Editor on the main menu, right-click the root entry (File System on Target Machine) and choose Add Merge
Module on the context menu:

This opens a FileOpen dialog. Select a merge module and add it to your project:

32 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

Here's the merge module added:

Adding a module also adds all merge modules referenced by the merge module. The entry
policy_8_0_Microsoft_VC80_MFC_x86.msm is shown in the screenshot above because the
Microsoft_VC80_MFC_x86.msm merge module references it.

Note that a merge module cannot be moved into a custom folder. In all scenarios you always have it on the level
right below the root node. Should you need to deploy a .MSM file as a file (rather than a source of files and folders,
registry entries and custom actions), you add it to a folder by right-clicking the folder and choosing Add | File on
the context menu.

If however you need to specify the folder where you want the merge module to install its files, you use the Module
Retargetable Folder property of the merge module. Note that merge modules supplied by Microsoft are mostly
preconfigured so that modifications of the Module Retargetable Folder property do not apply and the files that the
merge module provides (see the Files property of the merge module) are delivered to preconfigured system
folders.

33 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

How to make the setup project localizable


We suggest that you create a copy of your setup project before performing the steps below.

Localizing the setup project: quick start

The UI forms of your setup project use text strings that WiX Designer combines into language-specific sets of
strings. Localizing means specifying what language(s) to use in the UI forms of your setup project.

In the Solution Explorer, right-click the setup project and choose View WiX Editors | User Interface Editor.

In the User Interface Editor, right-click the Install or Administrative Install entry and choose Make project
localizable on the context menu. Note, this command is disabled if any form is added to the UI editor. To get it
enabled, you must delete all forms.

34 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

The most obvious result of selecting this command is the language files (.WXL) added to the setup project:

There are at least two .WXL files:

 StandardUI_neutral.wxl – a set of language-independent text strings; it is used when the installer supporting
a given set of languages starts on a machine where none of the languages is supported.

 StandardUI_{language identifier}-{country identifier}.wxl – a set of language-dependent text strings; it is used


when the installer supporting a given set of languages starts on a machine where the language identified
using the combination of {language identifier} and {country identifier} is installed.

35 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

When such a setup project is built, you see the following folder structure in the project's output folder:

The language-specific folders contain .MSI files built for the corresponding language. They are used to build the
resulting .MSI; it supports all of the specified languages.

Behind the scenes

Choosing the Make project localizable command and specifying the supported languages modifies the WiX as
follows:

36 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

<!-- Before: -->


<Product Language="1033" > Other attributes skipped -->
<Package /> <!-- Attributes skipped -->
<!-- Other tags skipped -->
</Product>

<!-- After: -->


<Product Language="!(loc.ID)"> <!-- Other attributes skipped -->
<Package Languages="1029,1031,1033,1049,3072" /> <!-- Other attributes skipped -->
<!-- Other tags skipped -->
</Product>

This modification of the Language attribute also modifies the meaning of the setup project's Localization property.
Before the Make project localizable command is chosen, the Localizable property lets you specify what language
to use for the installer's UI and prerequisites. After choosing this command, the Localizable property allows
choosing the current language for the user interface at design time (while you create the setup project); at the
same time this property specifies the language used for the prerequisites at run time (when the installer created
using this setup project is run).

Supported and non-supported languages

We call a language supported if the WiX Designer provides


text strings specific to this language. The text strings are
bundled to a language-specific file (.WXL), which is then
added to the setup project. In the Languages property, we
mark supported languages with an asterisk. For example, the
screenshot shows that of all the Chinese languages listed,
only the following two are supported:

 Chinese (Simplified, PRC)

 Chinese (Traditional, Taiwan)

All other languages shown in the screenshot aren't supported.


Choosing a non-supported language adds a file containing text strings from the language-neutral set of text
strings; see also Editing language-specific files.

Editing language-specific files

You can open a language-specific .WXL file in any text editor to edit it. Alternatively, you can edit the text strings
available for a given UI form in the Properties window: use the Localization property to choose a language
selected using the Languages property.

37 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

Testing multiple-language installer

You can start your .MSI for a specific language using this command line:

Msiexec.exe /i MyInstaller.MSI TRANSFORMS=":{language identifier}"

You take a value for the {language identifier} above form the Languages attribute (see the Package tag in
Product.wxs), for example 1033.

Another way is to set the required language using the Format drop down on the Region and Language dialog
(see Control Panel) and then start the MSI.

38 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

Language-specific prerequisites

The language that you specify using the Localization property is also used for the prerequisites if they are
specified in your project. If you need to have language-specific prerequisites, see (google for) section Building
Installation Package Bundles in the WiX manual.

39 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects How To

How to prevent running Install and Uninstall custom actions during


upgrade
To prevent running an Install custom action when the product is being upgraded, you can specify the following
criteria in the Condition property of the custom action:

NOT (Installed OR OLDPRODUCTFOUND)

The Installed property is described here. As to the OLDPRODUCTFOUND property, you need to define it yourself.
Here's an example:

<Upgrade Id="{%YOURGUID%}">
<UpgradeVersion Minimum="1.12.0" Property="NEWPRODUCTFOUND" OnlyDetect="yes"
IncludeMinimum="no" Language="1033" />
<UpgradeVersion Maximum="1.12.0" Property="OLDPRODUCTFOUND" OnlyDetect="no"
IncludeMinimum="yes" IncludeMaximum="no" Language="1033" />
</Upgrade>

To prevent running an Uninstall custom action when the program is upgraded, you specify the following criteria
in the Condition property of the custom action:

NOT UPGRADINGPRODUCTCODE

The UPGRADINGPRODUCTCODE property is described here.

40 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Tips and Notes

Tips and Notes

Web Setup

Configuring IIS

Here's a citation from this page on msdn.microsoft.com:

When you create a Web Setup deployment project in Visual Studio 2005 on Windows Vista, you have to
turn on the "Windows IIS Metabase and IIS 6 configuration compatibility" feature. You also have to be
logged on as an Administrator; otherwise you will be unable to run setup.exe to install the project.

Prerequisites

Deploying prerequisites

To ensure that your application will install and run successfully, you must first ensure that all components upon
which your application is dependent are already installed on the target computer. An example of such a
component is the .NET Framework; the correct version of the common language runtime must be present on the
destination computer before the application is installed.

To install the .NET Framework and other redistributables as a part of your installation, you can select these
prerequisites in the Prerequisites dialog box; see the Prerequisites property of the setup project. This practice is
known as bootstrapping. Next, Visual Studio generates a Windows executable program named Setup.exe, also
known as a bootstrapper. The bootstrapper is responsible for installing these prerequisites before your application
runs.

Each prerequisite is a bootstrapper package. A bootstrapper package is a group of directories and files that
contain manifest files that describe how the prerequisite should be installed. If your application prerequisites are
not listed in the Prerequisites dialog box, you can create custom bootstrapper packages and add them to Visual
Studio. Then you can select the prerequisites in the Prerequisites dialog box. For more information, see Creating
Bootstrapper Packages .

41 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Tips and Notes

The Prerequisites dialog

To open the Prerequisites dialog, see the Prerequisites property of the setup project.

42 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Tips and Notes

Create setup program to install Includes the prerequisite components in your application's Setup program
prerequisite components (Setup.exe) so that they will be installed before your application, in order of
dependency. By default, this option is selected. If it is not selected, no
Setup.exe is created.

Choose which prerequisites to Specifies whether to install components. For example, by selecting the
install check box next to Microsoft .NET Framework 4 (x86 and x64), you specify
that the Setup program verify whether this component is installed on the
target computer and install it if it is not already installed.

Download prerequisites from the Specifies that the prerequisite components be installed from the vendor's
component vendor's web site Web site. This is the default option.

Download prerequisites from the Specifies that the prerequisite components be installed from the same
same location as my application location as the application. This copies all the prerequisite packages to the
publish location. For this option to work, the prerequisite packages must be
on the development computer.

Download prerequisites from the Specifies that the prerequisite components be installed from the location
following location that you select. You can use the Browse button to select a location.

43 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects

Merge Modules
Merge modules are used when creating a modular structure of a setup project. A merge module can deploy files
and folders to the target machine, create registry entries, specify file types, and deliver/run custom action
executables.

When using WiX, you create a merge module project by choosing the project template called Merge Module
Project under the Windows Installer XML node in the New Project dialog window of Visual Studio.

A merge module may depend on other merge modules. To create a dependency see How to add merge module
reference to merge module project. To consume a merge module in a setup project see How to add merge module
to setup project.

Note that your setup project may produce warnings after you add a merge module. Some of the warnings are
expected; please refer to this page on wixtoolset.org.

44 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Finally

Finally

WiX Resources:

 Web site: http://wixtoolset.org/

 Documentation: http://wixtoolset.org/documentation/

 Downloads: http://wixtoolset.org/releases/

Add-in Express resources:

 Forums: http://www.add-in-express.com/forum/

 Blog: http://www.add-in-express.com/creating-addins-blog/

 Support email address: support@add-in-express.com

45 Add-in Express™
www.add-in-express.com

Das könnte Ihnen auch gefallen