<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chandankoushik's Weblog</title>
	<atom:link href="http://chandankoushik.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chandankoushik.wordpress.com</link>
	<description>Weblog for whatever i think</description>
	<lastBuildDate>Fri, 19 Jun 2009 12:22:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='chandankoushik.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Chandankoushik's Weblog</title>
		<link>http://chandankoushik.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chandankoushik.wordpress.com/osd.xml" title="Chandankoushik&#039;s Weblog" />
	<atom:link rel='hub' href='http://chandankoushik.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Wix getting Started</title>
		<link>http://chandankoushik.wordpress.com/2009/02/05/wix-introduction/</link>
		<comments>http://chandankoushik.wordpress.com/2009/02/05/wix-introduction/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 06:10:36 +0000</pubDate>
		<dc:creator>chandankoushik</dc:creator>
				<category><![CDATA[Wix]]></category>

		<guid isPermaLink="false">http://chandankoushik.wordpress.com/?p=8</guid>
		<description><![CDATA[Microsoft recently surprised quite a few people by releasing an application under an open source license (the Common Public License, to be precise) and hosting its source code on SourceForge, the premier open source community site. Though this isn&#8217;t the first time Microsoft has shipped open source code (take a look at Services for Unix [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chandankoushik.wordpress.com&amp;blog=4331683&amp;post=8&amp;subd=chandankoushik&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!--[if !mso]&gt; &lt;!  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} -->Microsoft recently surprised quite a few people by releasing an application under an open source license (the Common Public License, to be precise) and hosting its source code on SourceForge, the premier open source community site. Though this isn&#8217;t the first time Microsoft has shipped open source code (take a look at Services for Unix some time), the politics of the <a href="http://sourceforge.net/projects/wix">Windows Installer XML (WiX)</a> project were heavily discussed in the wake of this release. But what about the technical aspects? It turns out that there&#8217;s a lot of yummy goodness here for the developer who wants to integrate setup building into the development process, using an easily controlled XML file format. So in this article, I&#8217;m going to sidestep the politics and concentrate on what you can actually <em>do</em> with this stuff.</p>
<p class="MsoNormal"><a href="http://adlog.com.com/adlog/c/r=12970&amp;s=807666&amp;o=&amp;h=cn&amp;p=2&amp;b=&amp;l=en_US&amp;site=&amp;pt=publisher&amp;nd=&amp;pid=&amp;cid=&amp;pp=&amp;e=&amp;rqid=01c17-ad-e548AAD313F7EBAC&amp;orh=&amp;oepartner=&amp;epartner=&amp;ppartner=979&amp;pdom=ondotnet.com&amp;cpnmodule=&amp;count=&amp;ra=59.162.161.211&amp;pg=&amp;t=2008.08.21.09.25.25/http:/altfarm.mediaplex.com/ad/ck/6549-34461-2542-97?mpt=2008.08.21.09.25.25" target="_blank"></a></p>
<h3>Some Basic Concepts</h3>
<p>To start with the obvious, WiX is a set of tools for taking XML files (structured according to a particular schema) and turning them into MSI files. MSI files, of course, are the source files used by the Windows Installer Service to install new software. Using the Windows Installer Service for this purpose offers all sorts of benefits, from Add/Remove Software support to automatic nondestructive rollback if there&#8217;s any problem with the installation.</p>
<p>At big companies like Microsoft, the people who write setup programs do nothing but write setup programs. For most of us, though, writing the setup is a sideline to the rest of our development efforts. Before you get started with a Windows Installer tool, there are a few basic concepts that you need to understand. Here are four of the key ones:</p>
<ul type="disc">
<li class="MsoNormal">A <em>product</em> is some chunk of software that you&#8217;re installing. A product might be as large as Microsoft Office 2003 Enterprise in Japanese, or as small as a &#8220;Hello World&#8221; application including a single file. Each product is identified by a GUID, the product code. You aren&#8217;t required to change the product code if you make a &#8220;relatively minor&#8221; change to the files for a product.</li>
<li class="MsoNormal">A <em>package</em> contains everything that the Windows Installer Service needs to install a particular product. This includes the appropriate MSI files and any external files (such as CAB files) that the setup needs. Packages, too, are identified by GUIDs (known as <em>package codes</em>). If you make any change to a package, you must assign a new package code.</li>
<li class="MsoNormal">A <em>feature</em> is a piece of functionality that makes sense to the end user of the software. The help system could be a feature, or spell-checking, or wizards. If you&#8217;ve ever installed software that displays a treeview of things that you can choose to install or leave out, those are individual features. Features are identified by strings that must be unique within a particular package.</li>
<li class="MsoNormal">A <em>component</em> is a unit of software that the Installer can install. Components can include files, registry keys, shortcuts, resources, and other things. Each component is identified by a GUID, the component ID, which must be unique across all packages, regardless of product.</li>
</ul>
<p>These four concepts just scratch the surface of the complexity of the Windows Installer Service, but they&#8217;re enough to get you started with WiX. If you get deeply into the subject, you&#8217;ll want to pick up a reference to the database used by the Installer. The independent InstallSite web site has a good <a href="http://installsite.org/">list of books</a> on the subject, or you can find the Windows Installer documentation in the MSDN Library.</p>
<h3>Building Installer Files</h3>
<p>The <a href="http://www.microsoft.com/msdownload/platformsdk/sdkupdate/">Windows Installer SDK</a> includes some command-line tools and a very basic editor named Orca. With these tools, you can build a package that makes use of all of the functions of the Windows Installer Service. So why look any further? Well, the tools, though comprehensive, are not especially powerful or easy to use.</p>
<p>Fortunately, the SDK does not stand alone. A number of companies, such as <a href="http://www.wise.com/">Wise</a> and <a href="http://www.installshield.com/">InstallShield</a>, have built tools that help build Installer packages. These tools help the novice or experienced author wring the most out of the Installer Service, and usually include user interface editors, ways to automatically pick up dependencies, wizards, and other powerful tools. Even Microsoft has gotten into the act; the setup projects in Visual Studio .NET are also, under the hood, just building Installer packages.</p>
<p>But these developer-oriented tools are not generally a good fit for an automated build process, especially one that may be called upon to determine which software to include in a setup based on other factors (such as recent check-ins, changed filenames, and so on). That&#8217;s where WiX comes in. The WiX tools allow you to define the structure of a Windows Installer package using an XML file. This gives you all of the usual benefits of XML: easy editing with a variety of tools, the ability to modify the files using well-known technologies, and the ability to put the source file under source code control, for example. The WiX tools themselves are command-line tools, so they fit well with almost any build process.</p>
<h3>A WiX Source File</h3>
<p>So, what does a WiX source file look like? Well, here&#8217;s a relatively simple one:&lt;!&#8211;[if gte mso 9]&gt; Normal 0 false false false MicrosoftInternetExplorer4 &lt;![endif]&#8211;&gt;&lt;!&#8211;[if gte mso 9]&gt; &lt;![endif]&#8211;&gt;<!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} code 	{font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> &lt;!&#8211;[endif]&#8211;&gt;</p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;?</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">xml</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">version</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">1.0</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">encoding</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">utf-8</span>&#8220;<span style="color:blue;">?&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Wix</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">xmlns</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">http://schemas.microsoft.com/wix/2003/01/wi</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"><span> </span>&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Product</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Name</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Fancy Hello</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Id</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">4AA22F5D-D457-4A58-99FB-56AFF7FFD2CC</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"><span> </span></span><span style="font-size:11pt;font-family:&quot;color:red;">Version</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">1.0.0</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Manufacturer</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Lark Group, Inc.</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Language</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">1033</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Package</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">6697CCC3-B351-4DCE-820E-DEAC87F57A2A</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Comments</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">This MSI file installs the FancyHello application</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Manufacturer</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Lark Group, Inc.</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">InstallerVersion</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">200</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Languages</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">1033</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Compressed</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">yes</span>&#8220;<span style="color:blue;">/&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Media</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">EmbedCab</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">yes</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Cabinet</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Fancy.cab</span>&#8220;<span style="color:blue;">/&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">TARGETDIR</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">SourceDir</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">ProgramFilesFolder</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">PFiles</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">FHDir</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Fancy</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">LongName</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">FancyHello</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Component</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">SayHello Documentation</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Guid</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">8637E553-C046-60E0-9101-8D35A2870C86</span>&#8220;<span style="color:blue;">&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">File</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">readme</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Readme.txt</span>&#8220;</span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">LongName</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Readme.txt</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">DiskId</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">src</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Readme.txt</span>&#8220;<span style="color:blue;">/&gt;</span></span><span style="font-size:11pt;font-family:&quot;color:blue;"><br />
</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Component</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Component</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Core</span>&#8220;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Guid</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">B081FEDE-736F-541C-26EA-BA1015D31B37</span>&#8220;<span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">File</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Main program</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">FANCYH~1.EXE</span>&#8220;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">LongName</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">FancyHello.exe</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">DiskId</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">1</span>&#8220;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">src</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">FancyHello.exe</span>&#8220;<span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Shortcut</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Program shortcut</span>&#8220;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">ProgramMenuFolder</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">SayHello</span>&#8220;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">Target</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">DefaultFeature</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Show</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">normal</span>&#8220;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;"></span><span style="font-size:11pt;font-family:&quot;color:red;">WorkingDirectory</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">TARGETDIR</span>&#8220;<span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">File</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Component</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">ProgramMenuFolder</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">PMFolder</span>&#8220;<span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Directory</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Feature</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">DefaultFeature</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Level</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">ComponentRef</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">SayHello Documentation</span>&#8220;<span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">ComponentRef</span><span style="font-size:11pt;font-family:&quot;color:blue;"> </span><span style="font-size:11pt;font-family:&quot;color:red;">Id</span><span style="font-size:11pt;font-family:&quot;color:blue;">=</span><span style="font-size:11pt;font-family:&quot;">&#8220;<span style="color:blue;">Core</span>&#8220;<span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Feature</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;font-family:&quot;color:blue;">&lt;/</span><span style="font-size:11pt;font-family:&quot;color:#a31515;">Product</span><span style="font-size:11pt;font-family:&quot;color:blue;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:11pt;color:blue;">&lt;/</span><span style="font-size:11pt;color:#a31515;">Wix</span><span style="font-size:11pt;color:blue;">&gt;</span></p>
<p>This file, when properly built with the WiX tools (I&#8217;ll show you how to do that in a little bit) will install a slightly souped-up &#8220;Hello World&#8221; application consisting of a single executable file and a readme file, and it will add a shortcut to the Start-&gt;Programs menu to run the application. Before I show you how to build it, let me go through the file, piece by piece, to discuss what&#8217;s in it.</p>
<pre><code> </code>
<code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code>
<code>&lt;Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi"&gt;</code>
<code>...</code>
<code>&lt;/Wix&gt;</code></pre>
<p>After the standard XML header, every WiX source file must include the <code><span style="font-size:10pt;">Wix</span></code> root element, with a reference to the WiX schema.</p>
<pre><code> </code>
<code>&lt;Product Name="Fancy Hello" Id="4AA22F5D-D457-4A58-99FB-56AFF7FFD2CC" </code>
<code><span>  </span>Version="1.0.0" Manufacturer="Lark Group, Inc." Language="1033"&gt;</code>
<code><span>  </span>...</code>
<code>&lt;/Product&gt;</code></pre>
<p>As you can no doubt guess, the <code><span style="font-size:10pt;">Product</span></code> element defines the product that the Installer will install. This is the first case where you can see a common WiX pattern: the name of the element corresponds to a table in the Windows Installer database, and the attributes correspond to the columns in the table. However, the correspondence is not exact. For instance, the Installer database includes foreign key columns to relate many tables, while the WiX source files use nesting to accomplish the same relation. The WiX tools take care of defining the appropriate foreign key values for you.</p>
<pre><code> </code>
<code>&lt;Package Id="6697CCC3-B351-4DCE-820E-DEAC87F57A2A" </code>
<code><span>  </span>Comments="This MSI file installs the FancyHello application" </code>
<code><span>  </span>Manufacturer="Lark Group, Inc." InstallerVersion="200" </code>
<code><span>  </span>Languages="1033" Compressed="yes"/&gt;</code></pre>
<p>Within the <code><span style="font-size:10pt;">Product</span></code> element, you&#8217;ll find a single <code><span style="font-size:10pt;">Package</span></code> element, defining the package that corresponds to this WiX file.</p>
<pre><code> </code>
<code>&lt;Media Id="1" EmbedCab="yes" Cabinet="Fancy.cab"/&gt;</code></pre>
<p>The <code><span style="font-size:10pt;">Media</span></code> element defines the distribution media where the MSI file and any associated CAB files will be stored. In this particular case, I set the <code><span style="font-size:10pt;">EmbedCab</span></code> attribute to <code><span style="font-size:10pt;">yes</span></code> to embed the CAB file in the MSI file, so the final package will consist of a single file. You can define more than one <code><span style="font-size:10pt;">Media</span></code> element for a single package; this was more important back when we used to ship software spread across multiple diskettes.</p>
<pre><code> </code>
<code>&lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;</code>
<code><span>  </span>&lt;Directory Id="ProgramFilesFolder" Name="PFiles"&gt;</code>
<code><span>    </span>&lt;Directory Id="FHDir" Name="Fancy" LongName="FancyHello"&gt;</code>
<code><span>      </span>...</code>
<code><span>    </span>&lt;/Directory&gt;</code>
<code><span>  </span>&lt;/Directory&gt;</code>
<code><span>  </span>&lt;Directory Id="ProgramMenuFolder" Name="PMFolder"&gt;</code>
<code><span>  </span>&lt;/Directory&gt;</code>
<code>&lt;/Directory&gt;</code></pre>
<p>The <code><span style="font-size:10pt;">Directory</span></code> elements define the hierarchy of directories that the Installer Service will use with this software. Note that the <code><span style="font-size:10pt;">Id</span></code> attributes are not completely arbitrary. The Windows Installer defines a number of special directories, including the two (the program files folder and the program menu folder) that I&#8217;m using in this example.</p>
<pre><code> </code>
<code>&lt;Component Id="SayHello Documentation" </code>
<code><span>  </span>Guid="8637E553-C046-60E0-9101-8D35A2870C86"&gt;</code>
<code><span>  </span>&lt;File Id="readme" Name="Readme.txt" </code>
<code><span>    </span>LongName="Readme.txt" DiskId="1" src="Readme.txt"/&gt;</code>
<code>&lt;/Component&gt;</code>
<code>&lt;Component Id="Core" </code>
<code><span>  </span>Guid="B081FEDE-736F-541C-26EA-BA1015D31B37"&gt;</code>
<code><span>  </span>&lt;File Id="Main program" Name="FANCYH~1.EXE" </code>
<code><span>    </span>LongName="FancyHello.exe" DiskId="1"</code>
<code><span>    </span>src="FancyHello.exe"&gt;</code>
<code><span>    </span>&lt;Shortcut Id="Program shortcut" </code>
<code><span>      </span>Directory="ProgramMenuFolder" Name="SayHello" </code>
<code><span>      </span>Target="DefaultFeature" Show="normal" </code>
<code><span>      </span>WorkingDirectory="TARGETDIR"/&gt;</code>
<code><span>  </span>&lt;/File&gt;</code>
<code>&lt;/Component&gt;</code></pre>
<p>The <code><span style="font-size:10pt;">Component</span></code> elements and their child elements define the exact software that will be installed. In this case, the first component consists of a single file, while the second includes a file and a shortcut to the file. Note that WiX will look for the files that you include relative to the XML file. The best plan is probably to place the XML file in the same folder as your source files, and place the WiX tools on your path.</p>
<pre><code> </code>
<code>&lt;Feature Id="DefaultFeature" Level="1"&gt;</code>
<code><span>  </span>&lt;ComponentRef Id="SayHello Documentation"/&gt;</code>
<code><span>  </span>&lt;ComponentRef Id="Core"/&gt;</code>
<code>&lt;/Feature&gt;</code></pre>
<p>Finally (in this case), the <code><span style="font-size:10pt;">Feature</span></code> element defines both the single feature in this package and the mapping between features and components; in this case, the feature includes both components.</p>
<p>MSI files can, of course, perform extremely complex tasks, and the corresponding WiX source files are much more complex than this one. You&#8217;ll want to have both the Windows Installer SDK and the WiX documentation handy as you develop more complex files.</p>
<h3>Building and Testing</h3>
<p>Turning a WiX source file (which has the extension .wxs, by convention) into an MSI file is a two-step process, with both steps being carried out by command-line tools. The first of these tools is the compiler <code><span style="font-size:10pt;">candle</span></code>. Here&#8217;s a <code><span style="font-size:10pt;">candle</span></code> session:</p>
<pre><code> </code>
<code>E:\Program Files\wix&gt;candle fancyhellosetup.wxs</code>
<code>Microsoft (R) Windows Installer Xml Compiler version 2.0.1615.0</code>
<code>Copyright (C) Microsoft Corporation 2003. All rights reserved.</code>
<code> </code>
<code>fancyhellosetup.wxs</code></pre>
<p>Unless something goes wrong, the output from the WiX tools is very terse; <code><span style="font-size:10pt;">candle</span></code> just echoes back the name of its input file. You can even use the <code><span style="font-size:10pt;">-nologo</span></code> switch to suppress printing the copyright information, if you like. Terse utilities are better for command-line automation, so this is a nice feature. The next step is to use <code><span style="font-size:10pt;">light</span></code>, the linker:</p>
<pre><code> </code>
<code>E:\Program Files\wix&gt;light fancyhellosetup.wixobj </code>
<code>Microsoft (R) Windows Installer Xml Linker version 2.0.1615.0 </code>
<code>Copyright (C) Microsoft Corporation 2003. All rights reserved.</code></pre>
<p>Assuming that <code><span style="font-size:10pt;">light</span></code> didn&#8217;t find any errors, you&#8217;ve now got an MSI file ready to go. Though you could launch the setup by double-clicking it in Explorer, it&#8217;s worth knowing that there&#8217;s a Windows Installer tool to kick it off from the command line:</p>
<pre><code> </code>
<code>msiexec /i fancyhellosetup.msi</code></pre>
<p>And when you&#8217;re done testing, you can uninstall with the same utility:</p>
<pre><code> </code>
<code>msiexec /x fancyhellosetup.msi </code></pre>
<p>Note that the uninstall switch is <code><span style="font-size:10pt;">/x</span></code>, rather than the <code><span style="font-size:10pt;">/u</span></code> that you might be expecting.</p>
<p>Finally, there&#8217;s one more WiX tool that you should know about: <code><span style="font-size:10pt;">dark</span></code>. <code><span style="font-size:10pt;">dark</span></code> takes an existing MSI file and produces the corresponding WXS file. This is a good way to learn how the pieces of a WiX source file fit together. But beware: WiX source files can get very large for complex installations.</p>
<p class="MsoNormal"> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chandankoushik.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chandankoushik.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chandankoushik.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chandankoushik.wordpress.com&amp;blog=4331683&amp;post=8&amp;subd=chandankoushik&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chandankoushik.wordpress.com/2009/02/05/wix-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/994fb8aaa5cf9f5eeef0a4dee4652f63?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chandankoushik</media:title>
		</media:content>
	</item>
	</channel>
</rss>
