<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Office Development with Visual Studio : Bootstrapper</title><link>http://blogs.msdn.com/vsto/archive/tags/Bootstrapper/default.aspx</link><description>Tags: Bootstrapper</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Can I deploy my &lt;Insert App Name Here&gt; and all of its prerequisites in one file? (Mary Lee)</title><link>http://blogs.msdn.com/vsto/archive/2009/10/14/can-i-deploy-my-insert-app-name-here-and-all-of-its-prerequisites-in-one-file-mary-lee.aspx</link><pubDate>Wed, 14 Oct 2009 22:16:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9907343</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9907343.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9907343</wfw:commentRss><description>&lt;p&gt;One frequent customer question is about how to deploy an application and all of its prerequisites in a single .msi or .exe file. This question applies whether you are deploying any of the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft Office 2003 solutions with dependencies on .NET Framework 2.0, Visual Studio Tools for Office 2005 SE runtime, Microsoft Office 2007 primary interop assemblies. &lt;/li&gt;    &lt;li&gt;Microsoft Office 2007 solutions with dependencies on .NET Framework 3.5 , Visual Studio Tools for Office runtime 3.0, Microsoft Office 2007 primary interop assemblies. &lt;/li&gt;    &lt;li&gt;Microsoft Office 2007 solutions with dependencies on .NET Framework 3.5 SP1, Visual Studio Tools for Office runtime 3.0 SP1, Microsoft Office 2007 primary interop assemblies. &lt;/li&gt;    &lt;li&gt;Microsoft Office 2007 solutions with dependencies on .NET Framework 3.5 SP1 Client Profile, Visual Studio Tools for Office runtime 3.0 SP1, Microsoft Office 2007 primary interop assemblies. &lt;/li&gt;    &lt;li&gt;Really, any WinForms/WPF/console/whatever app with dependencies on .NET Framework, SQL Server Express, SQL Server compact, Visual C++ runtime, Windows Installer, or anything else. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There are three concepts in deployment related to prerequisites: nesting, merging, and chaining or bootstrapping.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Nesting&lt;/strong&gt; is the process of embedding a Windows Installer file (.msi) within another .msi file. However, the &lt;a href="http://support.microsoft.com/kb/306439"&gt;How to create a nested .msi package&lt;/a&gt; article has an important disclaimer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/CanIdeploymyInsertAppNameHereandallofits_8404/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/CanIdeploymyInsertAppNameHereandallofits_8404/image_thumb.png" width="555" height="80" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The drawbacks of creating a nested MSI installation are listed in the same article.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Nested Installations cannot share components. &lt;/li&gt;    &lt;li&gt;An administrative installation cannot contain a nested installation. &lt;/li&gt;    &lt;li&gt;Patching and upgrading will not work with nested installations. &lt;/li&gt;    &lt;li&gt;The installer will not correctly cost a nested installation. &lt;/li&gt;    &lt;li&gt;Integrated ProgressBars cannot be used with nested installations. &lt;/li&gt;    &lt;li&gt;Resources that are to be advertised cannot be installed by the nested installation. &lt;/li&gt;    &lt;li&gt;A package that performs a nested installation of an application should also uninstall the nested application when the parent product is uninstalled. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For these reasons, nesting is no longer supported. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Merging&lt;/strong&gt; includes shared code, files, resources, registry entries, and setup logic to applications as a single compound file. Prerequisites available as a merge module (.msm) form can be added to a .msi file. For example, if a prerequisite is available as an .msm, you can add it to a Setup project in Visual Studio as shown in &lt;a href="http://msdn.microsoft.com/en-us/library/z6z02ts5(VS.100).aspx"&gt;How to: Create or Add a Merge Module Project&lt;/a&gt;. However, merge modules cannot be serviced by the same owner as the .msi file, so it is difficult to fix issues in the merge module. &lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Tao of the Windows Installer, Part 4&lt;/a&gt; lists two cautionary notes:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Do not consume merge modules of vendors who do not promise to fix their merge modules promptly when bugs arrive &lt;/li&gt;    &lt;li&gt;Be prepared to handle the heat when bugs are found in your merge module causing issues for others’ products that have consumed your merge module and you get to put out the flame &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For these reasons, using merge modules is not recommended.&lt;/p&gt;  &lt;p&gt;Nesting and merging create a single file to deploy an application and its prerequisites, but these methods are not supported and not recommended. Thus, the answer to the question in the title is no: you cannot or should not deploy an application and its prerequisites in one file. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Chaining&lt;/strong&gt; or &lt;strong&gt;bootstrapping&lt;/strong&gt; is the process of checking for and installing missing prerequisites, including installing the application that is going to be used to install the rest of the prerequisites and application. You can use Visual Studio to generate a chainer/bootstrapper that is called Setup.exe. This program checks for and installs missing prerequisites before installing the application or Office solution. &lt;/p&gt;  &lt;p&gt;If you are deploying an Office 2007 solution in Visual Studio 2008 SP1, the .NET Framework 3.5 SP1, Visual Studio Tools for Office 3.0 SP1 runtime, and Microsoft Office 2007 primary interop assemblies are already selected in the Prerequisites Dialog Box.&lt;/p&gt;  &lt;p&gt;To learn more about how to install prerequisites in Visual Studio, see the following topics.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb608608(VS.100).aspx"&gt;How to: Install Prerequisites on End User Computers to Run Office Solutions&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/7eh4aaa5(VS.100).aspx"&gt;How to: Install Prerequisites in Windows Installer Deployment&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/8st7th1x(VS.100).aspx"&gt;How to: Install Prerequisites with a ClickOnce Application&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If the prerequisite package does not appear in Visual Studio, you can create your own bootstrapper package. After you create a product.xml file that describes the prerequisite and a package.xml files that includes locale-specific error messages, you can copy the bootstrapper package to \Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages folder. For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/ms165429(VS.100).aspx"&gt;Creating Bootstrapper Packages&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Other tools besides Visual Studio: You can also use MSBuild and the &lt;a href="http://msdn.microsoft.com/en-us/library/ms164294.aspx"&gt;GenerateBootstrapper Task&lt;/a&gt; to create a bootstrapper on a build computer. Alternatively, you can use the Windows Installer XML Toolset to generate .msi files and package prerequisites. For more information, see &lt;a title="http://wix.sourceforge.net/" href="http://wix.sourceforge.net/"&gt;http://wix.sourceforge.net/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;For questions about bootstrapping, search for answers or post new questions in the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads"&gt;ClickOnce and Setup &amp;amp; Deployment forum&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Happy deployment!&lt;/p&gt;  &lt;p&gt;Mary Lee, Programming Writer.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9907343" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Mary+Lee/default.aspx">Mary Lee</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Windows+Installer/default.aspx">Windows Installer</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/primary+interop+assemblies/default.aspx">primary interop assemblies</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Bootstrapper/default.aspx">Bootstrapper</category></item><item><title>VSTO Runtime bootstrapper package failure causes deployed customization installation to fail (Aaron Cathcart)</title><link>http://blogs.msdn.com/vsto/archive/2009/02/07/vsto-runtime-bootstrapper-package-failure-causes-deployed-customization-installation-to-fail-aaron-cathcart.aspx</link><pubDate>Sat, 07 Feb 2009 11:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9404080</guid><dc:creator>VSTO Team</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9404080.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9404080</wfw:commentRss><description>&lt;P&gt;In an attempt to make this easier to read here are a few terms I will be using frequently in this article: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;VSTOR = Visual Studio Tools for the Microsoft Office System (version 3.0 Runtime) (x86) &lt;/LI&gt;
&lt;LI&gt;VSTORSP1 = Visual Studio Tools for the Microsoft Office System (version 3.0 Runtime) Service Pack 1(x86) &lt;/LI&gt;
&lt;LI&gt;Bootstrapper = the clickonce bootstrapper that gets deployed with a VSTO customization when there are prerequisites checked (setup.exe) &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Some of our customers have raised an issue with the bootstrapper failing after deploying their customizations onto a user’s machine that has previously had VSTOR &amp;amp; VSTORSP1 installed. &lt;/P&gt;
&lt;P&gt;The problem occurs when an end user installs VSTOR followed by VSTORSP1 then subsequently uninstalls VSTOR from the Add/Remove Programs wizard. The uninstall removes the entire product including the service pack but fails to update the registry keys that our bootstrapper uses to detect if VSTOR is installed. If a user then installs a customization using the bootstrapper it will incorrectly detect that VSTOR is installed and proceed to install VSTORSP1, at which point it fails. &lt;/P&gt;
&lt;P&gt;I recently responded to a customer on the VSTO forums ( &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2dd02b04-cc89-47c3-8f76-462ecfbee65e" mce_href="http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2dd02b04-cc89-47c3-8f76-462ecfbee65e"&gt;http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2dd02b04-cc89-47c3-8f76-462ecfbee65e&lt;/A&gt; ) regarding this issue where I approached it from an end-user perspective, providing them with a list of fixes for post-deployment use. The purpose of this article is to provide a solution that developers can utilize so that end-users machines do not require post-deployment modification.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This workaround will allow developers to bake the correct VSTOR detection logic into every customization they develop that utilizes the bootstrapper.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what you need to do:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;On the development machine locate the file %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\VSTOR30\product.xml &lt;/LI&gt;
&lt;LI&gt;Replace the element &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RegistryCheck &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;VSTORuntimeInstalled&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Key&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;HKLM\SOFTWARE\Microsoft\VSTO Runtime Setup\v9.0.21022&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Install&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;with&amp;nbsp; &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;MsiProductCheck &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;VSTORuntimeInstalled&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;{8FB53850-246A-3507-8ADE-0060093FFEA6}&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt; &lt;/LI&gt;
&lt;LI&gt;Alter the element &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BypassIf &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;VSTORuntimeInstalled&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Compare&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ValueGreaterThanOrEqualTo&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;to be &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BypassIf &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;VSTORuntimeInstalled&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Compare&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ValueGreaterThanOrEqualTo&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;3&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;And that’s it! Now that you have made these changes to your product.xml, every VSTO customization you build and deploy with a bootstrapper will correctly detect if VSTOR is installed regardless of what state the end-users machine is in.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9404080" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/MSI/default.aspx">MSI</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Add+Remove+Programs/default.aspx">Add Remove Programs</category><category domain="http://blogs.msdn.com/vsto/archive/tags/SP1/default.aspx">SP1</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Aaron+Cathcart/default.aspx">Aaron Cathcart</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Bootstrapper/default.aspx">Bootstrapper</category></item></channel></rss>