<?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/"
	>

<channel>
	<title>Joy of Setup &#187; best practices</title>
	<atom:link href="http://www.joyofsetup.com/tag/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joyofsetup.com</link>
	<description>Bob Arnson's blog about setup and servicing</description>
	<lastBuildDate>Tue, 29 Jun 2010 02:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Paying for upgrades</title>
		<link>http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/</link>
		<comments>http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 09:18:35 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/</guid>
		<description><![CDATA[No, this isn&#8217;t a post on the costs of proprietary software but an amplification/clarification to my previous post. On wix-users, there&#8217;s a thread on the pains of automating upgrades. If your product consists of a large number of files and the file set changes regularly – files being added and removed during the product lifetime [...]]]></description>
			<content:encoded><![CDATA[<p>No, this isn&#8217;t a post on the costs of proprietary software but an amplification/clarification to my <a href="http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/">previous post</a>. On <em>wix-users</em>, there&#8217;s a <a href="https://sourceforge.net/mailarchive/forum.php?thread_name=7A84109A2C011C47B536D8FDCA5E19B9E16B747C55%40mail.Wintellect.local&amp;forum_name=wix-users'">thread</a> on the pains of automating upgrades.</p>
<p>If your product consists of a large number of files and the file set changes regularly – files being added and removed during the product lifetime – it&#8217;s only natural to want to avoid the cost of hand-authoring setup changes to match. (A little over a year ago, I <a href="http://www.joyofsetup.com/2007/10/03/flight-simulator-x-acceleration-releases-to-manufacturing/">shipped a product with over 7000 files</a>, so I&#8217;m familiar with the pain and desire for automation.)</p>
<p>Unfortunately, our <a href="http://en.wikipedia.org/wiki/Frenemy">frenemy</a> the <a href="http://msdn.microsoft.com/en-us/library/aa372795.aspx">component</a> <a href="http://blogs.msdn.com/robmen/archive/2003/10/18/56497.aspx">rules</a> makes such automation difficult. The closest we-the-WiX-team has gotten to a complete solution is to create components with one file each, which makes the component eligible to have its component GUID <a href="http://installing.blogspot.com/2006/09/automatically-generating-component.html">automatically generated</a> (using an asterisk in the <a href="http://wix.sourceforge.net/manual-wix3/wix_xsd_component.htm">Component element&#8217;s Guid attribute</a> value).</p>
<p>What doesn&#8217;t work is when files are removed. Windows Installer doesn&#8217;t let you remove components in a minor upgrade, so using one file per component doesn&#8217;t immediately solve the automation problem: Your automatically-generated minor upgrade will be missing a component, which is a <a href="http://blogs.msdn.com/heaths/archive/2006/01/23/516457.aspx">mortal component-rule sin</a>.</p>
<p>Nor can you avoid the problem by using multiple files per component because component rules say that components must be immutable: You can&#8217;t add or remove resources from a component.</p>
<p>So automating the creation of minor upgrades has additional costs:</p>
<ul>
<li>Additional tooling to try to support removing files without blatantly violating component rules.</li>
<li>Additional coding in your product to tolerate &#8220;obsolete&#8221; files without being able to remove them.</li>
</ul>
<p>For many types of apps, but especially Web apps with many content files, that&#8217;s a huge cost. Being able to ship minor-upgrade patches from an automated build might be a benefit worth the cost. It&#8217;s really a decision your team needs to make.</p>
<p>I&#8217;ll add that if you don&#8217;t anticipate shipping patches on a regular schedule, you might just automate the authoring of your RTM product and pay the price of manually tweaking your setup authoring when you need to ship a patch. Again, it&#8217;s a cost-benefit decision your team needs to think about.</p>
<h2>Cheap and easy</h2>
<p>If you don&#8217;t absolutely need to ship patches, you can avoid the costs of minor upgrades by simply using major upgrades. You can remove files without worrying about component-rule violations if you use an &#8220;early&#8221; scheduling of the <a href="http://msdn.microsoft.com/en-us/library/aa371197.aspx">RemoveExistingProducts</a> standard action – before or immediately after the <a href="http://msdn.microsoft.com/en-us/library/aa369535(VS.85).aspx">InstallInitialize action</a>.</p>
<p>The MSI SDK notes that scheduling RemoveExistingProducts early is &#8220;inefficient&#8221; because the files that are same between the two product versions are removed and then reinstalled. But that inefficiency is what lets you remove files and components. If you schedule RemoveExistingProducts immediately before or after <a href="http://msdn.microsoft.com/en-us/library/aa369505(VS.85).aspx">InstallFinalize</a>, MSI implements the major upgrade by installing the new version of the product &#8220;on top of&#8221; the previous version, upgrading files with newer versions, then removing the previous version. MSI increments the reference count of components in both packages during the installation of the newer version, then decrements it during the removal of the previous version. Component reference counting works only if component rules are followed, so it&#8217;s pretty much the same as minor upgrades.</p>
<p>If you have a large product, the size and install-time benefits of minor upgrade patches might be worth the development effort. Otherwise, major upgrades scheduled early are a great solution. Your call.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Neither more nor less</title>
		<link>http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/</link>
		<comments>http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 01:28:03 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/</guid>
		<description><![CDATA[&#8216;When I use a word,&#8217; Humpty Dumpty said, in a rather scornful tone,&#8217; it means just what I choose it to mean, neither more nor less.&#8217; &#8216;The question is,&#8217; said Alice, &#8216;whether you can make words mean so many different things.&#8217; &#8216;The question is,&#8217; said Humpty Dumpty, &#8216;which is to be master &#8211; that&#8217;s all.&#8217; [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8216;When <b>I</b> use a word,&#8217; Humpty Dumpty said, in a rather scornful tone,&#8217; it means just what I choose it to mean, neither more nor less.&#8217;</p>
<p>&#8216;The question is,&#8217; said Alice, &#8216;whether you <i>can</i> make words mean so many different things.&#8217;</p>
<p>&#8216;The question is,&#8217; said Humpty Dumpty, &#8216;which is to be master &#8211; that&#8217;s all.&#8217; </p>
<p>&#8211;<a href="http://en.wikipedia.org/wiki/Alice%27s_Adventures_in_Wonderland">Alice&#8217;s Adventures in Wonderland</a> and brought to mind by almost anybody reading SDK documentation for any length of time</p>
</blockquote>
<p>Windows Installer has three ways of upgrading products from one version to another:</p>
<ul>
<li>Major upgrades </li>
<li>Minor upgrades </li>
<li>Small updates </li>
</ul>
<p>There are two common problems we run into when discussing upgrades given size-related terms to describe upgrades.</p>
<h2>Version numbers</h2>
<p><em>Major</em> and <em>minor</em> are also commonly used to refer to particular elements in a version number (major.minor.build.patchlevel being most common). </p>
<p>But major upgrades can upgrade any product version number to any other version number, regardless of which parts of the version number change. For example, the WiX installers are always major upgrades for every 3.0.xxxx version; only the <em>build</em> portion of the version number changes with each weekly build. And the WiX v3.0 installers don&#8217;t do major upgrades down to WiX v2; we intentionally designed the installers to be able to live &quot;side-by-side&quot; on the same system to help migrating from WiX v2 to v3. </p>
<p>Minor upgrades, on the other hand, are usually used to deliver service packs; they must change some part of the product version but <em>can&#8217;t</em> change the major part of the product version (at least according to PatchWiz.dll error ERROR_PCW_INVALID_MAJOR_VERSION).</p>
<p>Small updates cannot change the product version at all.</p>
<h2>Size matters not</h2>
<p><em>Major</em>, <em>minor</em>, and <em>small</em> also bring to mind size or breadth of a particular upgrade. To an extent, that&#8217;s true: Small updates tend to be for single-purpose &quot;hotfix&quot; types of fixes. Minor upgrades can update many files but can make only limited &quot;structural&quot; changes such as adding features and components; they can&#8217;t be used to remove components. </p>
<p>Major upgrades aren&#8217;t so limited: They can change anything in a product, but also support as few changes as a small update. So even if you&#8217;re changing only a few files, you can still use major upgrades. Think of <em>major</em> as an upper limit on the set of changes, not the lower limit on the type of upgrade you need.</p>
<p>Major upgrades also have the advantage of built-in support in Windows Installer. Using <a href="http://wix.sourceforge.net/manual-wix3/wix_xsd_upgrade.htm">Upgrade</a> and <a href="http://wix.sourceforge.net/manual-wix3/wix_xsd_upgradeversion.htm">UpgradeVersion</a> elements, you can use a &quot;naked&quot; .msi package to install a product for the first time or by major-upgrading a prior version of the product. Doing the same thing with a minor upgrade requires a bootstrapper executable or extra work to set the <a href="REINSTALL">REINSTALL</a> and <a href="http://msdn.microsoft.com/en-us/library/aa371182(VS.85).aspx">REINSTALLMODE</a> properties appropriately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hint: Be generous with upgrade codes</title>
		<link>http://www.joyofsetup.com/2008/09/07/hint-be-generous-with-upgrade-codes/</link>
		<comments>http://www.joyofsetup.com/2008/09/07/hint-be-generous-with-upgrade-codes/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 00:33:45 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[bad practices]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/09/07/hint-be-generous-with-upgrade-codes/</guid>
		<description><![CDATA[Major upgrades work across products by associating them with a single upgrade code: Version 1.0 of a product has a different product code than version 2.0 but both share the same upgrade code. The FindRelatedProducts action and MsiEnumRelatedProducts function find any products on the system with a particular upgrade code. The RemoveExistingProducts action then uninstalls [...]]]></description>
			<content:encoded><![CDATA[<p>Major upgrades work across products by associating them with a single upgrade code: Version 1.0 of a product has a different product code than version 2.0 but both share the same upgrade code. The <a href="http://msdn.microsoft.com/en-us/library/aa368600(VS.85).aspx">FindRelatedProducts action</a> and <a href="http://msdn.microsoft.com/en-us/library/aa370103(VS.85).aspx">MsiEnumRelatedProducts function</a> find any products on the system with a particular upgrade code. The <a href="http://msdn.microsoft.com/en-us/library/aa371197(VS.85).aspx">RemoveExistingProducts action</a> then uninstalls the (usually older) products as part of the major upgrade cycle.</p>
<p>Note that FindRelatedProducts and MsiEnumRelatedProducts explicitly support finding multiple products installed on the system simultaneously. MSI doesn&#8217;t try to force you to use the same upgrade code only for products that are upgraded by major upgrades. That means it&#8217;s possible to use the same upgrade code for products that aren&#8217;t major upgrades for each other.</p>
<p>However, the <a href="http://msdn.microsoft.com/en-us/library/aa372379(VS.85).aspx">Upgrade table</a> supports only version and language as ways of narrowing down the products it finds. So if you use the same upgrade code for multiple products that can be installed simultaneously, FindRelatedProducts doesn&#8217;t have a way to filter out the ones you don&#8217;t want removed in a major upgrade.</p>
<p>You can use a custom action to remove product codes from the property specified by the UpgradeVersion/@Property attribute. Just schedule it to run after FindRelatedProducts. The cost is that you have to maintain by hand any such product codes and carry them from version to version. </p>
<p>The Upgrade table and FindRelatedProducts action let you search on multiple upgrade codes in a single product. So it&#8217;s always safe to use <em>more</em> upgrade codes if you think you might support having products side-by-side in the future &#8212; just use multiple Upgrade elements to detect and uninstall them via major upgrade.</p>
<p>In short, if you have products are <em>never</em> going to be installed at the same time, you can safely use the same upgrade code. But if you have products that might need to be installed simultaneously, give them separate upgrade codes. (Upgrade code GUIDs are cheap when you buy them in quantity from <a href="http://msdn.microsoft.com/en-us/library/ms241442(VS.80).aspx">reputable online retailers</a>.) And always test your servicing strategy before you release a product: Some things can&#8217;t be fixed in a patch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/09/07/hint-be-generous-with-upgrade-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome setup</title>
		<link>http://www.joyofsetup.com/2008/09/02/google-chrome-setup/</link>
		<comments>http://www.joyofsetup.com/2008/09/02/google-chrome-setup/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 04:48:35 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/09/02/google-chrome-setup/</guid>
		<description><![CDATA[Google today released (after a bit of a comic-book&#160;pre-release, presumably due to the Labor Day holiday in the US) Google Chrome, its long-rumored open-source browser. Plenty of people will talk (endlessly) about the implications of another browser and how well Google Chrome and Chromium (the open source project) do the job. Blah, blah. Whatever. What&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Google today released (after a bit of a <a href="http://www.google.com/googlebooks/chrome/">comic-book</a>&#160;<a href="http://blogoscoped.com/google-blog.html">pre-release</a>, presumably due to the Labor Day holiday in the US) <a href="http://www.google.com/chrome/">Google Chrome</a>, its long-rumored open-source browser. Plenty of people will talk (endlessly) about the implications of another browser and how well Google Chrome and <a href="http://code.google.com/chromium/">Chromium</a> (the open source project) do the job. Blah, blah. Whatever. What&#8217;s <em>really </em>interesting is a couple of choices Google made about deployment:</p>
<ol>
<li>The Google Chrome <a href="http://www.google.com/chrome/eula.html">download</a> is a svelte 474K bootstrapper that downloads the setup bits. No offline installer is available (unless it&#8217;s well-hidden). </li>
<li>Google Chrome is a &quot;composite&quot; setup: The guts of the application are installed by a non-MSI self-extractor. However, Google Chrome <a href="http://blogoscoped.com/google-chrome/34">includes Google Gears</a>, the browser add-in/library that adds a <a href="http://code.google.com/apis/gears/gears_faq.html">bunch of functionality for making apps-in-the-browser more powerful</a>. The Gears in Google Chrome is installed by an MSI package. And yes, it&#8217;s built with WiX. </li>
<li>The Google Updater is no longer a LocalSystem service; instead, it starts at logon from the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run registry key. </li>
<li>Last and absolutely not least: Google Chrome is a per-user application. It even installs in the per-user LocalAppDataFolder. (The included Google Gears is marked as &quot;<a href="http://msdn.microsoft.com/en-us/library/aa372870(VS.85).aspx">UAC compliant</a>.&quot;) </li>
</ol>
<p>That Google Chrome is a per-user app is amazing. Even with UAC on Windows Vista and Windows Server 2008, it&#8217;s <em>so</em> easy to say that &quot;everyone&#8217;s used to needing admin privileges to install.&quot; That Google took the extra effort to limit themselves to the capabilities of a per-user app says a lot about their desire to have:</p>
<ul>
<li>a low-impact setup </li>
<li>and absolutely no barriers to entry. </li>
</ul>
<p>I wonder if it&#8217;s the start of a trend&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/09/02/google-chrome-setup/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Testing your deferred and rollback custom actions</title>
		<link>http://www.joyofsetup.com/2008/06/18/testing-your-deferred-and-rollback-custom-actions/</link>
		<comments>http://www.joyofsetup.com/2008/06/18/testing-your-deferred-and-rollback-custom-actions/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 06:06:33 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[WiX]]></category>
		<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[custom actions]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/06/18/testing-your-deferred-and-rollback-custom-actions/</guid>
		<description><![CDATA[When you include deferred custom actions &#8212; that somehow modify the machine &#8212; in your setup, you have two big responsibilities: Provide rollback custom actions that &#34;undo&#34; what the deferred CAs do so that the installation transaction is actually transactional. Test. Test. Test. OK, so numbers 2 through 4 are kinda the same but not [...]]]></description>
			<content:encoded><![CDATA[<p>When you include deferred custom actions &#8212; that somehow modify the machine &#8212; in your setup, you have two big responsibilities:</p>
<ol>
<li>Provide rollback custom actions that &quot;undo&quot; what the deferred CAs do so that the installation transaction is actually transactional. </li>
<li>Test. </li>
<li>Test. </li>
<li>Test. </li>
</ol>
<p>OK, so numbers 2 through 4 are kinda the same but not really: Even a simple installation (say, without patching or upgrades) has three different scenarios you need to test when you have deferred/rollback custom actions:</p>
<ol>
<li>Installation rollback. </li>
<li>Repair rollback. </li>
<li>Uninstallation rollback. </li>
<li>All of the above. </li>
</ol>
<p>The right behavior for each kind of rollback is usually the opposite action. Rolling back installation is uninstallation. Rolling back uninstallation is installation. Rolling back repair is usually installation. Mixing installation, repair, and uninstallation is possible if your package has user-selectable features and users go into maintenance mode to turn on and off features. And, of course, it&#8217;s always an option from the msiexec.exe command line using the ADDLOCAL/ADDSOURCE/ADDDEFAULT, REMOVE, and REINSTALL properties.</p>
<h2>Testing rollback means testing failure</h2>
<p>Windows Installer initiates rollback when an action fails, so to test rollback you need to cause a failure. WiX includes an easy way to trigger failure: The WixFailWhenDeferred custom action, part of WixUtilExtension, triggers a failure when it&#8217;s executed. Include it in your package by referencing WixUtilExtension (in your Votive .wixproj or via the -ext switch to the light.exe command line) and adding a CustomActionRef to your package authoring:</p>
<blockquote><p>&lt;CustomActionRef Id=&quot;WixFailWhenDeferred&quot; /&gt;</p>
</blockquote>
<p>WixFailWhenDeferred automatically schedules itself in InstallExecuteSequence before InstallFinalize, with a condition of:</p>
<blockquote><p>WIXFAILWHENDEFERRED=1</p>
</blockquote>
<p>The condition means that you can have one package to test all the different possible combinations of &quot;normal&quot; installation and rollback. Just pass the WIXFAILWHENDEFERRED=1 property value on the msiexec.exe command line to trigger rollback. For example:</p>
<blockquote><p>msiexec /qb- /i intermediate.msi /L*vx installfail.log WIXFAILWHENDEFERRED=1      <br />msiexec /qb- /i intermediate.msi /L*vx install.log       <br />msiexec /qb- /fvamus intermediate.msi /L*vx repairfail.log WIXFAILWHENDEFERRED=1       <br />msiexec /qb- /fvamus intermediate.msi /L*vx repair.log       <br />msiexec /qb- /x intermediate.msi /L*vx uninstallfail.log WIXFAILWHENDEFERRED=1       <br />msiexec /qb- /x intermediate.msi /L*vx uninstall.log</p>
</p>
</p>
</blockquote>
<p>WixFailWhenDeferred has been in WiX v3 weekly releases since April.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/06/18/testing-your-deferred-and-rollback-custom-actions/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>VirtualBox 1.6.2 drops VBScript</title>
		<link>http://www.joyofsetup.com/2008/06/13/virtualbox-162-drops-vbscript/</link>
		<comments>http://www.joyofsetup.com/2008/06/13/virtualbox-162-drops-vbscript/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 14:40:06 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/06/13/virtualbox-162-drops-vbscript/</guid>
		<description><![CDATA[As I mentioned previously, one of my favorite examples of a tight, clean Windows Installer package for a real product&#8211;VirtualBox&#8211;succumbed to a dreaded VBScript custom action when they released v1.6.0. Predictably, it caused errors (during uninstallation, because this custom action ran during uninstall only). VirtualBox 1.6.2 dropped that custom action. The VirtualBox installers still have [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.joyofsetup.com/2008/05/05/virtualbox-160-setup-another-example-of-the-second-law-of-thermodynamics/">As I mentioned previously</a>, one of my favorite examples of a tight, clean Windows Installer package for a real product&#8211;<a href="http://www.virtualbox.org/">VirtualBox</a>&#8211;succumbed to a <a href="http://blogs.msdn.com/robmen/archive/2004/05/20/136530.aspx">dreaded</a> VBScript custom action when they released v1.6.0. <a href="http://forums.virtualbox.org/viewtopic.php?t=6140">Predictably, it caused errors</a> (during uninstallation, because this custom action ran during uninstall only).</p>
</p>
<p><a href="http://www.virtualbox.org/wiki/Changelog">VirtualBox 1.6.2</a> dropped that custom action. The VirtualBox installers still have a few ICE errors and warnings so here&#8217;s hoping the VirtualBox team continues cleaning those up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/06/13/virtualbox-162-drops-vbscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Source Analysis for C# released</title>
		<link>http://www.joyofsetup.com/2008/05/23/microsoft-source-analysis-for-c-released/</link>
		<comments>http://www.joyofsetup.com/2008/05/23/microsoft-source-analysis-for-c-released/#comments</comments>
		<pubDate>Fri, 23 May 2008 20:59:50 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[WiX]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/05/23/microsoft-source-analysis-for-c-released/</guid>
		<description><![CDATA[Microsoft Source Analysis for C# &#8212; known inside Microsoft as StyleCop &#8212; is now available. We use StyleCop on new WiX code, in addition to FxCop to analyze code for style consistency and correctness. Now that StyleC&#8230;er, Microsoft Source Analysis for C# is available outside the campus grounds, we can include the settings files we [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.msdn.com/sourceanalysis/archive/2008/05/23/announcing-the-release-of-microsoft-source-analysis.aspx">Microsoft Source Analysis for C#</a> &#8212; known inside Microsoft as StyleCop &#8212; <a href="http://code.msdn.microsoft.com/sourceanalysis/Release/ProjectReleases.aspx?ReleaseId=1047">is now available</a>. We use StyleCop on new WiX code, in addition to FxCop to analyze code for style consistency and correctness. Now that StyleC&#8230;er, Microsoft Source Analysis for C# is available outside the campus grounds, we can include the settings files we use in the WiX codebase.</p>
<p>StyleCop is a Visual Studio package that integrates analysis commands in the Solution Explorer and a tool window to show analysis results. StyleCop also includes MSBuild tasks so you can make analysis runs part of your daily builds.</p>
<p>Naturally, the Style&#8230;dammit&#8230;Microsoft Source Analysis for C# installer is authored in WiX. The package is extremely clean. There are no ICE errors and only ICE33 warnings about non-advertised COM registration. The only custom actions come from WixUIExtension and WixVSExtension. The UI is built with WixUI, though the StyleCop team chose to use some logo-themed white bitmaps rather than the <a href="http://robmensching.com/blog/archive/2008/05/23/More-red-UI.aspx">classic-yet-modern red</a>.</p>
<p>The first few times you run StyleCop on existing code, you&#8217;re bound to be surprised and probably frustrated. The rules are, after all, about enforcing a consistent coding style. Unless you happen to already be using the StyleCop style, you&#8217;ll get a lot of &#8220;violations&#8221; that seem quite arbitrary. Yep, and that&#8217;s the point: Coding style discussions are pretty much religious wars over arbitrary decisions. (Yes, there are exceptions, but mostly it&#8217;s personal esthetic choice. Except for tabs versus spaces; don&#8217;t mess with tabs versus spaces!)</p>
<p>Just stick with StyleCop style and you&#8217;ll be consistent, even if elements of the style aren&#8217;t your personal favorite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/05/23/microsoft-source-analysis-for-c-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Earth setup experience</title>
		<link>http://www.joyofsetup.com/2008/04/16/google-earth-setup-experience/</link>
		<comments>http://www.joyofsetup.com/2008/04/16/google-earth-setup-experience/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 06:32:12 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[custom actions]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/04/16/google-earth-setup-experience/</guid>
		<description><![CDATA[Google announced the release of Google Earth 4.3 today. Given the recent release of their WiX-based setup for the Google App Engine SDK, I had to give it a shot. (It helps that my day job also deals with 3-D terrain imagery.) When you click the link to “Download Google Earth 4.3” (and accept the [...]]]></description>
			<content:encoded><![CDATA[<p>Google <a href="http://googleblog.blogspot.com/2008/04/whole-new-world-to-explore.html">announced</a> the release of <a href="http://earth.google.com/">Google Earth 4.3</a> today. Given the recent release of their <a href="http://robmensching.com/blog/archive/2008/04/07/Google-App-Engine-delivered-to-Windows-by-WiX.aspx">WiX-based setup</a> for the <a href="http://code.google.com/appengine/">Google App Engine SDK</a>, I had to give it a shot. (It helps that my day job also deals with 3-D terrain imagery.)</p>
<p>When you click the link to “Download Google Earth 4.3” (and accept the EULA), you download not Google Earth but “Google Updater.exe.” Run it and it starts downloading the Google Earth installer.</p>
<p>Personally, I much prefer to download the <em>actual</em> installers for the software I use. Some of it’s purely practical: I can stick it on a network and put it on multiple computers (EULA permitting, of course) without waiting for multiple downloads. Perhaps more importantly, for the paranoid among us, is the ability to virus-scan the installers. (Google Updater requests elevation, so it has admin rights to install multiple packages.)</p>
<p>Google Updater also runs as a startup app, optionally showing an icon in the increasingly-unusable system tray. (Yes, I know it’s technically the “<a href="http://en.wikipedia.org/wiki/Windows_Taskbar">notification area</a>,” but come on, who calls it that?) I don’t think I need 24/7 instant access to software that doesn’t get updated that often. In fact, I’m sure I don’t.</p>
<p>Naturally, installing a packaging system with update capabilities is a boon to many users (and Google itself, of course, which has a nicely visible entry point to suggest additional apps for download). Apple does it with iTunes and Microsoft does it with Windows Live. Luckily, Google Updater has its own entry in Add/Remove Programs so you can remove it without impact to Google Earth.</p>
<h2>Google Earth installer</h2>
<p>The Google Earth installer is built with InstallShield, using its support for “dynamic file linking.” (If you haven’t used it, think of running Heat or Tallow with every build.) Interestingly, it uses the CAQuietExec custom action from WiX and has wixca.dll in the Binary table.</p>
<p>The .msi package fails ICE validation, with errors in ICE03, ICE15, ICE34, ICE38, ICE43, ICE44, ICE57, ICE64, and ICE99, and warnings in ICE45, ICE60, ICE82, ICE86, and ICE91.</p>
<p>There are 36 custom actions, some of which are mildly disturbing:</p>
<ul>
<li>registerFlashSOL is a deferred, no-impersonate custom action that runs an included .exe with a “-install” command-line switch. Oh joy: self-reg.</li>
<li>InstallToolBarCA is an immediate custom action that runs an installed .exe. It’s not scheduled and is only available from the UI sequence – the one that’s suppressed because Google Updater runs the installation silently.</li>
<li>SetGEUserStats is another custom action run only from the suppressed – but still included – UI sequence.</li>
<li>SET_RES_READ_ONLY sets QtExecCmdLine to run the WiX CAQuietExec custom action. What is it hiding? It’s running attrib.exe to turn off the read-only attribute on a recursive set of files/directories. Doesn’t the File table let you control the read-only attribute? Yes, it does, but apparently not when you use InstallShield’s dynamic file linking to harvest a directory tree at build time. In a previous life, I used that functionality and turned off the read-only attributes in the build script before harvesting. Doing it as part of installation is bad karma on Google’s part.</li>
</ul>
<p>Overall, it’s not a bad installer, but I hope Google cleans it up a bit before it loses the “beta” label.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/04/16/google-earth-setup-experience/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Two great tastes: Agile development and distributed, declarative setup</title>
		<link>http://www.joyofsetup.com/2008/02/13/two-great-tastes-agile-development-and-distributed-declarative-setup/</link>
		<comments>http://www.joyofsetup.com/2008/02/13/two-great-tastes-agile-development-and-distributed-declarative-setup/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 15:21:31 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[WiX]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[custom actions]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2008/02/13/two-great-tastes-agile-development-and-distributed-declarative-setup/</guid>
		<description><![CDATA[I&#8217;ve had the good fortune to work on several agile software-development teams over the years. If you&#8217;ve ever hated having software you&#8217;ve developed sit on the shelf for months or years until the next release, shipping several times a year feels good. Shipping almost every month is even better. Shipping almost every week is phenomenal. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had the good fortune to work on several agile software-development teams over the years. If you&#8217;ve ever hated having software you&#8217;ve developed sit on the shelf for months or years until the next release, shipping several times a year feels good. <a href="http://msdn2.microsoft.com/en-us/vstudio/aa700819.aspx">Shipping almost every month</a> is even better. <a href="http://wix.sourceforge.net/releases/">Shipping almost every week</a> is phenomenal.</p>
<p>Most of the <a href="http://agilemanifesto.org/principles.html">principles of the agile manifesto</a> reinforce the idea that shipping software often is how to best deliver customer value. To ship often, you need predictability:</p>
<ul>
<li>Finish all the work associated with a feature.
<li>Make sure it&#8217;s of ship quality.</li>
</ul>
<h1>Done versus done-done</h1>
<p>The waterfall model of designing, then coding, then throwing over the wall to test, then fixing bugs, then throwing over the other wall to setup&#8211;yes, of course I&#8217;m going to talk about setup&#8211;is just procrastinating. Sure, it&#8217;s more fun to start working on the next new thing, but it&#8217;s just postponing the work required to get a feature <em>really</em> done and ready to ship.</p>
<p>Setup development, like testing, is often considered one of the &#8220;taxes&#8221; of software development that is best put off as long as possible. But if you want to deliver shippable software on a rapid schedule, paying taxes late doesn&#8217;t work; you might get to <a href="http://www.americaslibrary.gov/cgi-bin/page.cgi/jb/progress/taxday_1">April 15th</a> and discover that you have more bugs than you can fix by midnight. Instead, you pay your taxes as you go along so there are no surprises when you get to the last day and you want to ship.</p>
<p>Rather than developers considering themselves &#8220;done&#8221; when they&#8217;ve written some code and debugged it, developers need to get &#8220;done done&#8221; by providing code, unit tests, acceptance tests, and setup.</p>
<p>WiX supports &#8220;done done&#8221; by easily integrating into the development build cycle. Every member of an agile team can author setup. That prevents the lone setup developer, who probably supports multiple product teams, from being a bottleneck.</p>
<p>Plus, if developers are responsible for their own setup authoring, they&#8217;re less likely to push bad design decisions onto the setup developer&#8217;s shoulders.</p>
<h1>Keep quality high and take the weekends off</h1>
<p>Agile methodologies bring a whole set of tools and processes to help keep quality high and ready to &#8220;ship on a dime,&#8221; like:</p>
<ul>
<li>Test-driven development to produce high-quality designs and code
<li>Automated acceptance testing to reduce the need for armies of testers to validate the whole system at the end</li>
</ul>
<p>Add some setup flavor:</p>
<ul>
<li>Make sure that &#8220;done&#8221; for every feature includes its setup authoring.</li>
<li>Run your automated acceptance tests from official setup packages, not from local builds.</li>
<li>Build upgrades and patches and create automated tests to ensure you can service the product.</li>
<li>Use only fully declarative custom actions&#8211;they make it easier to handle patching, upgrades, and repair.</li>
</ul>
<p>Frequent, automated testing tells you if your code (and setup) do what they&#8217;re supposed to (or not&#8211;at least as far as the tests are concerned). Adding setup into the testing mix helps ensure that your setup is ready too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2008/02/13/two-great-tastes-agile-development-and-distributed-declarative-setup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Test your setups virtually</title>
		<link>http://www.joyofsetup.com/2007/09/24/test-your-setups-virtually/</link>
		<comments>http://www.joyofsetup.com/2007/09/24/test-your-setups-virtually/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 07:10:26 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/2007/09/12/test-your-setups-virtually/</guid>
		<description><![CDATA[A key part of most setup development is testing from a known state to see that your setup leaves the machine in another known state. Usually, it&#8217;s from a &#8220;clean&#8221; state to one with your app installed but I&#8217;m sure I&#8217;m not alone with needing to duplicate bugs that come from a &#8220;dirty&#8221; machine. In [...]]]></description>
			<content:encoded><![CDATA[<p>A key part of most setup development is testing from a known state to see that your setup leaves the machine in another known state. Usually, it&#8217;s from a &#8220;clean&#8221; state to one with your app installed but I&#8217;m sure I&#8217;m not alone with needing to duplicate bugs that come from a &#8220;dirty&#8221; machine. In both cases, you need to be able to quickly get a test machine to the starting state.</p>
<p>One way to get consistent machine states is with imaging software: Take an image of the machine in a particular state using software like <a href="http://www.acronis.com/enterprise/products/ATICW/">Acronis True Image</a> and restore the image before you begin each test. The downside to machine images is the time needed to restore an image; a bare operating system image might be only a couple of gigabytes for a svelte Windows XP image but your setup or app might have other prerequisites that balloon the image size. For example, my testing for Flight Simulator X Service Pack 1 and Flight Simulator X: Acceleration both require an installation of Flight Simulator X, all 13GB and 42,000 files worth. Such an image takes about 20 minutes to restore, not counting the reboots and loading the imaging software: Call it a good half an hour. With that overhead, I avoid re-imaging between install tests; the overhead&#8217;s not worth it. And surely I never author any bad setup or make even the slightest bug in my deferred custom actions, much less the rollback custom actions. Oh wait&#8230;</p>
<p>But virtual machines have significantly less overhead. Instead of re-imaging, you shut down the VM and discard changes made during the test session. Then restart the VM to start clean: The only overhead is the time it takes the VM to &#8220;power on&#8221; and boot. Most VM software lets you create snapshots to record the state of the VM at key points. You can also create new VMs as clones or deltas of other VMs, to save the time of installing OSes over and over.</p>
<p>There are two potential drawbacks to cloning VMs:</p>
<ol>
<li>Don&#8217;t forget your OS licensing.</li>
<li>If you need to join your VMs to a network domain, you&#8217;ll have to use a tool like <a href="http://technet2.microsoft.com/windowsserver/en/library/c03a5469-ef71-4545-b970-ce2add5e715c1033.mspx?mfr=true">SysPrep</a> or <a href="http://www.microsoft.com/technet/sysinternals/Security/NewSid.mspx">NewSID</a> to join cloned VMs to the domain.</li>
</ol>
<p>Of course, both those things are true with hardware machine images too. I avoid the problem by not joining VMs to domains. Most VM software offers other ways of getting test files to VMs, like shared folders that simulate a network share to the host computer or drag-and-drop.</p>
<p>VMs aren&#8217;t as fast as real hardware but unless you have a huge setup or want to investigate timing-related issues, it&#8217;s rarely a serious problem. Though it gives you a great excuse for a powerful dev box: A quad-core CPU with 4GB RAM and RAID 0 storage works really well.&lt;g&gt; Fewer cores, less RAM, and non-RAID disks work too, of course, depending on how many simultaneous VMs you want to run.</p>
<h2>VM software</h2>
<p>Here&#8217;s a list of the VM software I&#8217;ve used.</p>
<ul>
<li><a href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx"><strong>Virtual PC</strong></a>, Microsoft&#8217;s desktop VM product. Free (as in beer). Easy to use, OK GUI. Biggest cons: It&#8217;s a single-threaded app, so multiple VMs don&#8217;t take advantage of multi-core CPUs and it has no automation API.</li>
<li><a href="http://www.microsoft.com/windowsserversystem/virtualserver/"><strong>Virtual Server</strong></a>, Microsoft&#8217;s current server VM product. Free (as in beer). Multi-threaded with COM API. Biggest con: In the box, there&#8217;s only a Web administrative interface. <a href="http://blogs.technet.com/matthts/">VMRCplus</a>, an unsupported WinForms UI, is available and while it has some rough edges, it&#8217;s a big improvement.</li>
<li><a href="http://www.vmware.com/products/ws/"><strong>VMware Workstation</strong></a>, VMware&#8217;s desktop VM product. $189. Great multi-process GUI with automation APIs. Hardware support improves with each version; the current version, 6.0, supports USB 2.0. The only drawback is that because it&#8217;s not free software (beer or speech), you need to make sure you&#8217;re in compliance with license if you want to use  it on multiple machines.</li>
<li><a href="http://www.virtualbox.org/"><strong>VirtualBox</strong></a>, innotek&#8217;s VM product. Free (beer and speech). VirtualBox comes in a closed-source edition that&#8217;s free of charge and a subset is available under the <a href="http://www.virtualbox.org/wiki/GPL">GPL</a>. Multi-process and nicely automatable, via command line and XML configuration files. There&#8217;s a separate API that isn&#8217;t yet documented. The biggest downside is that virtual machines, hard drives, and CD/DVD images have to be registered so it&#8217;s slightly more complicated than the others to copy VMs among host machines. Secret setup geek benefit: The closed-source edition of VirtualBox comes with an installer &#8212; authored in WiX &#8212; that&#8217;s amazingly clean; it doesn&#8217;t quite pass validation but it&#8217;s very light on black-box custom actions.</li>
</ul>
<p>Using machine images is vital if your setup requires particular hardware or if your app does and you need to test both the setup and the app. Otherwise, save yourself headaches, hassles, and horked dev machines and test your setups in virtual machines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2007/09/24/test-your-setups-virtually/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
