Beruflich Dokumente
Kultur Dokumente
Designer
forVisual
for VisualStudio
StudioWiX
WiXSetup
SetupProjects
Projects
Designer for Visual Studio WiX Setup Projects Designer for Visual Studio WiX Setup Projects
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
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
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
5 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Installing and Activating
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.
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.
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.
The WiX Designer setup program installs the following folders on your PC:
WiX Designer setup program installs the following text files on your PC:
licence.txt – EULA
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
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.
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.
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/ .
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/ .
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/ .
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:
9 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started
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.
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.
Product.wxs is the source file of your setup project. A newly created project contains the XML code shown below.
<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>
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
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.
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:
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.
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
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
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.
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
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
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.
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
Product.wxs is the source file of your setup project. A newly created project contains the XML code shown below.
<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>
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
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.
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
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.
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
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
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.
26 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Getting Started
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
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
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
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
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
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:
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.
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.
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
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).
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
You can start your .MSI for a specific language using this command line:
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
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
40 Add-in Express™
www.add-in-express.com
Designer for Visual Studio WiX Setup Projects Tips and Notes
Web Setup
Configuring IIS
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
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:
Documentation: http://wixtoolset.org/documentation/
Downloads: http://wixtoolset.org/releases/
Forums: http://www.add-in-express.com/forum/
Blog: http://www.add-in-express.com/creating-addins-blog/
45 Add-in Express™
www.add-in-express.com