1 Wix简介
Wix是Windows Installer XML的简称,其通过类XML文件格式来指定了用于创建Windows Installer安装包数据库的元素。关于Wix的详细介绍,查看Wix Tutorial。
通过http://wix.codeplex.com/,我们下载最新的Wix toolset,并进行安装。
2 1+1=2
动手实践是感受最深的方式。下面我们就通过制作一个简单的HelloWorld安装包来感受一下Wix。
2.1 HelloWorld程序
我们编写一个很简单的C# 的HelloWorld程序。
复制代码
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace HelloInstallerDemo
7 {
8 class Program
9 {
10 static void Main(string[] args)
11 {
12 Console.WriteLine(“Hello World!”);
13 Console.ReadKey();
14 }
15 }
16 }
复制代码
编译该程序,生成可运行程序HelloWorld.exe。
2.2 制作HelloWorld.msi安装包
在HelloWorld.exe所在文件夹中新建一个文件Product.wxs(.wxs是Wix源文件的扩展名),然后打开该文件,填入下面源代码
复制代码
1