<?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 on setup and servicing with WiX and MSI</description>
	<lastBuildDate>Wed, 01 Feb 2012 05:01:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting shelf space in the Store</title>
		<link>http://www.joyofsetup.com/2012/02/01/getting-shelf-space-in-the-store/</link>
		<comments>http://www.joyofsetup.com/2012/02/01/getting-shelf-space-in-the-store/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 05:01:28 +0000</pubDate>
		<dc:creator>Bob Arnson</dc:creator>
				<category><![CDATA[Etc]]></category>
		<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[best practices]]></category>

		<guid isPermaLink="false">http://www.joyofsetup.com/?p=304</guid>
		<description><![CDATA[Reading the Windows Store for developers blog recently, I was pleasantly surprised to see that desktop (i.e., non-Metro-style) apps would be allowed to show up in the Windows Store. Desktop apps won&#8217;t get the same treatment as Metro-style apps, of &#8230; <a href="http://www.joyofsetup.com/2012/02/01/getting-shelf-space-in-the-store/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Reading the <a href="http://blogs.msdn.com/b/windowsstore/archive/2012/01/20/designing-the-windows-store-user-experience.aspx">Windows Store for developers blog</a> recently, I was pleasantly surprised to see that desktop (i.e., non-Metro-style) apps would be allowed to show up in the Windows Store. Desktop apps won&#8217;t get the same treatment as Metro-style apps, of course; instead of being able to install apps right from the Windows Store, desktop apps will have a similar listing page with a link to the developer&#8217;s site to handle download.</p>
<p>Still, it&#8217;s better than nothing &#8212; the Windows Store is likely to have a lot of window shoppers looking to buy apps.</p>
<p>However, a hurdle to get an app listing page is that the app must pass &#8220;certification.&#8221; In the past, this was known as the Windows Logo program and had many pages of technical requirements. In <a href="http://msdn.microsoft.com/library/windows/desktop/hh749939">Windows 8, the list is much smaller</a> and less prescriptive. For example, the Logo program for previous versions required the use of MSI, then required MSI or ClickOnce; for Windows 8, there are no technology restrictions.</p>
<p>Some requirements that struck me as interesting:</p>
<blockquote><p>1.2 Your app must not take a dependency on the VB6 runtime</p></blockquote>
<p>VB6, IE6 &#8212; anything v6 must go away. <img src='http://www.joyofsetup.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>5.1 Your app must properly implement a clean, reversible installation</p>
<p>If the installation fails, the app should be able to roll it back and restore the machine to its previous state.</p></blockquote>
<p>If Windows 8 certification is anything like previous versions&#8217;, it will involve automated test suites that will highlight rollback that&#8217;s less than perfect.</p>
<blockquote><p>5.4 Your app must never block silent install/uninstall</p></blockquote>
<p>So don&#8217;t throw UI from custom actions and don&#8217;t rely on being able to prompt the user (i.e., also don&#8217;t break requirement #5.1).</p>
<blockquote><p>6.1 All executable files (.exe, .dll, .ocx, .sys, .cpl, .drv, .scr) must be signed with an Authenticode certificate</p></blockquote>
<p>MSI packages aren&#8217;t mentioned. But if you ship a Burn bundle or other bootstrapper .exe, that&#8217;s going to require signing.</p>
<blockquote><p>10.1 Your app must be installed in the Program Files folder by default</p></blockquote>
<p>There&#8217;s nothing mentioned that would exempt per-user apps in general from this requirement, though you can always request exceptions. Given the emphasis Metro places on per-user, restricted apps, perhaps this requirement will be extended/relaxed for per-user desktop apps too.</p>
<blockquote><p>10.6 Your app must write user data at first run and not during the installation in “per-machine” installations</p></blockquote>
<p>Long-time readers of <a href="http://wix.sourceforge.net/mailinglists.html#wix-users">wix-users</a> will recognize this as advice given again and again. Good to see Windows catching on. <img src='http://www.joyofsetup.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>10.7 Exceptions and Waivers</p>
<p>A waiver is required for apps that write to the global assembly cache (GAC) .NET apps should keep assembly dependencies private, and store it in the app directory unless sharing an assembly is explicitly required.</p></blockquote>
<p>I suspect it&#8217;s a response to the GAC getting used too often when it&#8217;s not needed or very useful. (See also Rico Mariani&#8217;s <a href="http://blogs.msdn.com/b/ricom/archive/2012/01/31/ngen-or-not-the-rules-haven-t-changed-very-much-since-2004.aspx">blog post on using NGen</a>, which falls into the same boat.) Still, I&#8217;m mildly surprised to see it a requirement.</p>
<blockquote><p>12.5 App running under the WoW64 emulator should not attempt to subvert or bypass Wow64 virtualization mechanisms</p></blockquote>
<p>This one&#8217;s interesting, depending how struct &#8220;subvert&#8221; turns out to be. For example, several WiX custom actions make fairly trivial &#8220;subversions&#8221; of WoW64 to avoid the need for both 32-bit and 64-bit custom actions just to write to the right version of Program Files.</p>
<p>All in all, there&#8217;s nothing terribly surprising in this set of requirements. A lot of them just codify what&#8217;s already known as best practice for Windows apps in the age of UAC. Of course, this is just the first version of the certification requirements and Windows 8 isn&#8217;t yet shipping; there&#8217;s plenty of time for Microsoft to add, drop, or change requirements. In the end, you get to decide whether the effort of certification is worth having a presence in the Windows Store. Remember the Metro-style app folks, who have no choice in the matter: The Windows Store is the only way they can ship.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joyofsetup.com/2012/02/01/getting-shelf-space-in-the-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 &#8230; <a href="http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/12/29/neither-more-nor-less/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/09/07/hint-be-generous-with-upgrade-codes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/09/02/google-chrome-setup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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[Windows Installer]]></category>
		<category><![CDATA[WiX]]></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. &#8230; <a href="http://www.joyofsetup.com/2008/06/18/testing-your-deferred-and-rollback-custom-actions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/06/13/virtualbox-162-drops-vbscript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/05/23/microsoft-source-analysis-for-c-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/04/16/google-earth-setup-experience/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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 &#8230; <a href="http://www.joyofsetup.com/2008/02/13/two-great-tastes-agile-development-and-distributed-declarative-setup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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>
	</channel>
</rss>

