Because the project needs , Recent research Wix Packaged deployment , There's also something in the garden about wix The blog of , All aspects , There are different points . I'm also in the process of testing myself , Write down the process , For reference . The latest version WiX Toolset v3.7, I don't know how to install it , You can refer to

Packing concerns are 1).Net Version checking  2) Desktop and menu bar shortcuts 3) Change the icon screen , Progress bar  4) Automatic packaging  5) Automatically update the version .6) Installation directory and details Explore with questions , Welcome to add . Let's go through a simple Demo, Looking back at the concept .

first Wix set Up

1. Create a simple Winform Program

2. Right click in the solution to add a new project , choice Windows Installer XML( If you want to install wix Toolset v3.7), Re selection Setup Project, Modify project name , determine .

It looks like , There will be one more next to the solution Setup07 The engineering of , There is one below this project Product.wxs file , The default is on , This is a XML file , The configuration file of the project , For the first time, it seems that all kinds of elements don't know , I don't care , Three things need to be changed first , The first thing we need to do is introduce MyApplication,

In the third line there is a Product Elements , Need to be in Manfacturer Add your or your company's name to the list .

<Product Id="*" Name="Setup07" Language="1033" Version="" Manufacturer="RJStone" UpgradeCode="3486eddf-0957-45cf-8c26-3de8bceca2b4">

And there's one at the bottom Fragment Element block , It is amended as follows

Added a paragraph like this

<Component Id="ProductComponent">
<File Source="$(var.MyApplication.TargetPath)" />

When it's done , To generate a , So the first simple wix The package file is already in SetUp07 Of bin/debug Here we have .

Click on Setup07.msi It's ready to install . But this time the installation is fast , Because it's relatively simple, there won't be any progress bar , The next step is , After the installation, there are no icons on the desktop or on the menu bar , Because you haven't configured it to have . But in c On the plate Rrogram Files(X86) It can be found below Setup07 This folder , Open him up and there's Myapplication Of exe. It can be executed .

There's another problem , Just change this one time Myapplication , To regenerate the , Then the package file will automatically generate a new , If you haven't changed , It's just repeat point generation , Packaged files are not updated . This is actually with the help of MSBuild The mechanism of , Automatically generate packaging files . Of course, to uninstall this program, you need to manually uninstall it from the control panel .

A preliminary understanding Wix

1)MSBuild  yes Microsoft Build Engine Abbreviation , representative Microsoft and Visual Studio New generation platform for , Introduced a basis xml File format . He's responsible for generating exe file , You need to generate packaging files, you need wix, MSBuild A simple solution to the knowledge base of Yuanzi

wix The official document says : use Msbulid Generate wix, You need to create a .wixproj The file of , In fact, on this file Setup07 in VS It's automatically generated for us , Just open the folder to see .

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="">
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<Compile Include="Product.wxs" />
<ProjectReference Include="..\MyApplication\MyApplication.csproj">
<Import Project="$(WixTargetsPath)" />
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
<Target Name="AfterBuild">

2)XML Document elements

Wix Based on XML, So many specific elements are defined , At the beginning , Because it's easy to get dizzy if you're not familiar with it . It's just a preliminary understanding , In depth understanding still needs continuous testing in the future . If it's not comprehensive, you can go to the official documents .

* Product My father is only wix, Mainly by Id,Language, Equal attribute

Id: Of the product GUID,GUID Can use VS--> Tools ---> establish GUID There will be five formats to choose from , Here we use 4,5,6. Don't bracket .

Codepage: Refers to the code page of the region , It's used to distinguish regions

Language: The language used in the area , Number the numbers ,

Manufacturer: Manufacturers

Name: The product name

UpgradeCode: Product updates GUID

Version: Version number

  Here are some common area codes :
Language Language - Country Language Codepage
English en-us 1033 1252
Simplified Chinese zh-cn 2052 936
Traditional Chinese zh-tw 1028 950

*Package Record some installation package information

InstallerVersion: The minimum required to install this installation package is Windows Installer edition , use Windows Installer The main version of is multiplied by 100 add Window Installer A minor version of . such as “200” It stands for Windows Installer2.0, and 405 It stands for Windows Installer4.5.

Compressed: This is Yes Indicates that there is a compressed file in the source file , about Merge Module This property doesn't have to be set . Anyway, it's for NoType.

InstallPrivileges: It literally means installation priority , Yes limited and elevated Two kinds of The latter is the default ,

InstallScope: The value is an enumeration type , It literally means installation scope , The value must be perMachine perhaps perUser. I don't know the exact use of the document , Let go of .

*MajorUpgrade  This element supports preventing degradation

AllowDowngrades: Back to the lower version , If set to No( The default value is ) Will be stopped , This is the time DowngradeErrorMessage Property must be set , To give a hint .

DowngradeErrorMessage: When you install a lower version of the installation package, you will be prompted .

*Feature   A list of features , Features are the smallest units that can be installed . In the subelements ComponentGroupRef Is and  ComponentGroup Corresponding . The former is equivalent to an installation directory , The latter records the location of the installation files .

Id: Is the only one.

Title: It's just a short explanation .

Level: The level of installation , The value is 0 Will invalidate this feature , The default value is 1

Absent: This property definition User Whether you have the right to choose not to install a feature in the user interface (absent), The value is allow perhaps disallow One of

*Fragment   The elements are in wix Create a base block to install the database in (msi A file is a database ), After definition , It's unchangeable ( I don't quite understand ....ORZ). Its sub elements contain *Ref The element of must have a corresponding unit , For example Fragment Contains two Component Elements , that You must be there. Feature of use ComponentRef And Component Corresponding . The default generated document contains two Fragment block . One includes Directory, One includes ComponentGroup , The former refers to the installation directory , The latter, as the name suggests, is Component A collection of .

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Setup07" />
</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 Id="ProductComponent">
<File Source="$(var.MyApplication.TargetPath)" />

*Directory The installation directory of the product . first Directory Id=TARGETDIR It's the root directory , every last wix Every project will have this directory element , the second Id=ProgramFilesFolder The corresponding is C:\Program Files\ ,64 It's the right place x86 Next , The third element is the folder where our own applications are located , The final result is c:\Program Files\My Application Name   In the default prompt You can also see in Component Add installation files to , resources , Registration form, etc . Here you can see the innermost Directory Of Id=INSTALLFOLDER Yes and the second Fragment Medium ComponentGroup Of Directory Attributes are consistent . stay Component Each unit that you need to install and where it is located .

$(var.MyApplication.TargetPath) yes wix Reference variables . See the table below . Of course vs2010 It's just the meaning of the current version .

Variable name

Example usage

Example value



Debug or Release






AnyCPU, Win32, x64 or ia64



C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\












C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\MyApp.csproj



C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\bin\Debug\












C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\bin\Debug\MyProject.exe



C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\bin\Debug\en-US\MyProject.msm



C:\users\myusername\Documents\Visual Studio 2010\Projects\MySolution\












C:\users\myusername\Documents\Visual Studio 2010\Projects\MySolution\MySolution.sln

Take a look at the whole   Directory Defines the installation directory ,Component Components and locations are defined ,Feature It defines some features of components during installation .Product and package And so on . So it's semantic , Continue to explore .

The above is just a personal summary , It's hard to avoid mistakes , Welcome to correct , If it helps you , Please give me a hand .:)

Wix Installation and deployment ( One ) Same as MSBuild More articles on automatically generating packaged files

  1. Wix Installation and deployment ( One ) Same as MSBuild Automatically generate packaging files turn

    Original address : Because the project needs , Recent research Wix Packaged deployment , There's also something in the garden about wix The blog of , All aspects , There are different points ...

  2. Wix Installation and deployment tutorial ( sixteen ) -- Automatically generate multilingual files

    Because continuous integration requires , After all the projects are compiled, a multilingual installation package is generated . Prior to generate mst The files are all manual , and mst The files must be updated every time and new packages are installed “ relation ”, Otherwise, when the Chinese installation package calls English resources, it will report something like “ Type conversion ...

  3. Wix Installation and deployment tutorial ( Twelve ) -- Auto update WXS file

    The last one shared a QuickWIX, It is used to compare the differences between the two projects before and after , But it's still cumbersome , And I found out yesterday that Bug, There's something wrong with the catalog comparison . This time, change the practice , Let the program update automatically WXS file , And then use CCNet To compile automatically , such ...

  4. WIX Installation and deployment tutorial ( 6、 ... and ) Seven knowledge points collected for you

    Some time ago 5 piece WIX(Windows Installer XML) Installation tutorial for , But it's not perfect , Here we continue to sort out seven knowledge points to share with you .WIX The latest version 3.8, Click to download WIX Installation and deployment ( One ) Same as MSBuild since ...

  5. Wix Installation and deployment ( Two ) Customize the installation interface and behavior

    The last one showed how to combine MSBuild To automatically generate packaging files and pairs of WIX Some preliminary understanding of , . This article will be based on the previous one ...

  6. linux Next use automake Automatic tool generation makefile file

    linux In the environment , When the project is big , The process of compiling is very complicated , So we need to use make Tools , Automatically compile and install , But handwriting makefile The files are complicated , Fortunately GNU In the plan , We have designed a kind called Autoconf/Au ...

  7. php in soap Examples of how to use and generate WSDL file , Provide automatic generation WSDL Class library for files ——SoapDiscovery.class.php class

    1. web service Universal : Webservice soap wsdl Personal opinion of the difference Web Service Achieving business aspirations :  Web Service It's real “ Work ” the , Provides a general term for service interfaces . ...

  8. The program automatically generates Dump file

    Preface : adopt drwtsn32.NTSD.CDB And so on Dump file , drwtsn32 There are shortcomings, though NTSD.CDB It can be completely solved , But not all operating systems have NTSD.CDB Etc . I understand ...

  9. The program automatically generates Dump file ()

    Preface : adopt drwtsn32.NTSD.CDB And so on Dump file , drwtsn32 There are shortcomings, though NTSD.CDB It can be completely solved , But not all operating systems have NTSD.CDB Etc . I understand ...

Random recommendation

  1. opengl View transformation Projection transformation derivation

    View transformation in opengl in , The input to view transformation is :(1) Eye position ( Or the location of the camera )eys:(2) The center of the eye center,( It's where the eyes look );(3) The direction of the head up. Any point will be converted to eye coordinates after view transformation ...

  2. [LeetCode] Answer key (python):079 Word Search

    Title source Given a 2D board and a word, find if the word exists ...

  3. ***CI Pagination : by CodeIgniter Write paging class

    ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ...

  4. Swift - Parkour game development (SpriteKit Game development )

    One , Here's how to develop a Parkour game , The functions are as follows : 1, The platform factory will continue to generate platforms , And move to the left . When the platform moves out of the game scene, it can be removed . 2, The generated platform width is random , Highly random . At the same time, the short platform will fall when it is trampled . 3 ...

  5. The problem of monkeys eating peaches ( Nanyang ACM324)

    The problem of monkeys eating peaches The time limit :3000 ms  |  Memory limit :65535 KB difficulty :0 describe There is a pile of peaches. I don't know the number , The monkey ate half of it on the first day , Another one , The next day in this way , Eat half of the remaining peaches and one more , Every day , ...

  6. 《 The way of cultivation :.NET Development points 》 Reading notes ( Four )

    The role of delegation :1) It allows methods to be taken as parameters , To other modules :2) It allows us to call multiple methods with the same signature at the same time :3) It allows us to call any method asynchronously . “ Method signature ” The number of parameters of a method . Parameter types and return values, etc , Have the same signature ...

  7. G: Dave The maze of time and space (next Array )

    G: Dave The maze of time and space Time Limit: 1 s      Memory Limit: 128 MB Submit My Status Problem Description The Royal Institute of technology is hidden ...

  8. Java Container class source code analysis Iterator And ListIterator iterator ( be based on JDK8)

    One . Basic concepts Iterator is an object , It's also a design pattern ,Java There are two interfaces for implementing iterators , Namely Iterator Interfaces and inheritance from Iterator Of ListIterator Interface . The object of the class that implements the iterator interface has traversal ...

  9. MYSQL The index type of :PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL What's the difference? ? Each of them is suitable for any occasion ?

    One . Introduce the type of index Mysql Common indexes are : primary key . unique index . General index . Full-text index . Composite index PRIMARY KEY( primary key ) ALTER TABLE `table_name` ADD PRIMAR ...

  10. [No00004F] In the history of the most complete Vim Shortcut key bitmap ( Introduction to advanced )vim Summary of common commands

    Use... On the current line in the command state == ( Continuous press = two ), Or for multiple lines n==(n It's a natural number ) Indicates auto indent below the current line n That's ok . You can try to indent the code and scramble it n== Typesetting , It's equivalent to IDE Inside code format. send ...