<?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>Windows Installer Team Blog : Best Practice Guidelines</title><link>http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx</link><description>Tags: Best Practice Guidelines</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Integration Hurdles for EXE Custom Actions</title><link>http://blogs.msdn.com/windows_installer_team/archive/2007/10/20/integration-hurdles-for-exe-custom-actions.aspx</link><pubDate>Sat, 20 Oct 2007 17:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5548080</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/5548080.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=5548080</wfw:commentRss><description>&lt;P&gt;A while back, two sets of engineers were arguing whether simply calling an EXE custom action would be good enough for Windows Installer based package.&amp;nbsp; The first team with the EXE didn't want to do the work to move to Windows Installer but they really wanted the second team to take a dependency.&amp;nbsp; The team based on Windows Installer said the integration problems with calling an EXE was so great they would not integrate without a Windows Installer package.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;As an attempt at arbitrating the disagreement, it was requested the Window Installer team provide an analysis.&amp;nbsp; A quick paper was written to capture the analysis.&amp;nbsp; This paper has since been shared in other similar circumstances.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In a recent instance, Microsoft blogger &lt;A class="" href="http://blogs.msdn.com/astebner/" mce_href="http://blogs.msdn.com/astebner/"&gt;Aaron Stebner&lt;/A&gt; suggested this quick paper would make a good blog.&amp;nbsp; Here it is.&amp;nbsp; Hope it's useful ;^)&lt;/P&gt;
&lt;H2&gt;Integration Hurdles for EXE Custom Actions&lt;/H2&gt;
&lt;H3&gt;Overview and Scope&lt;/H3&gt;
&lt;P&gt;Windows Installer (MSI) architecture was designed to work best when all the installation behaviors are native to the Windows Installer. When the native behavior (called &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/Aa372022.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/Aa372022.aspx"&gt;Standard Actions&lt;/A&gt;) are insufficient, there is a way to provide extend behavior (called &lt;A class="" href="http://msdn.microsoft.com/library/en-us/msi/setup/custom_actions.asp" mce_href="http://msdn.microsoft.com/library/en-us/msi/setup/custom_actions.asp"&gt;Custom Actions&lt;/A&gt;). Custom Actions come in various &lt;A class="" href="http://msdn.microsoft.com/library/en-us/msi/setup/summary_list_of_all_custom_action_types.asp" mce_href="http://msdn.microsoft.com/library/en-us/msi/setup/summary_list_of_all_custom_action_types.asp"&gt;base types&lt;/A&gt; that are differentiated on the way the &lt;A class="" href="http://www.microsoft.com/technet/prodtechnol/windows2000pro/evaluate/featfunc/wispro.mspx" mce_href="http://www.microsoft.com/technet/prodtechnol/windows2000pro/evaluate/featfunc/wispro.mspx"&gt;Windows Installer service&lt;/A&gt; instantiates the custom action in the appropriate sandbox. Among the types of custom actions are &lt;A class="" href="http://msdn.microsoft.com/library/en-us/msi/setup/executable_files.asp" mce_href="http://msdn.microsoft.com/library/en-us/msi/setup/executable_files.asp"&gt;executable files&lt;/A&gt; and &lt;A class="" href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp" mce_href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;dynamic link libraries&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Bare custom actions are risky to the integrity of a Windows Installer base install and this document will consider the risks.&lt;/P&gt;
&lt;P&gt;This document will not dive deep into the architecture or the possibilities to improve the custom action architecture in the future. &lt;/P&gt;
&lt;H3&gt;Integration Hurdles&lt;/H3&gt;
&lt;P&gt;The installation integrity risk running EXE custom actions come in a number of varieties&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 
&lt;TABLE class="" cellSpacing=0 cellPadding=0 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P align=center mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=center&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P align=center mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=center&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P align=center mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=center&gt;&lt;STRONG&gt;Mitigation&lt;/STRONG&gt;&lt;/P&gt;
&lt;P align=center&gt;&lt;EM&gt;(by consumer of EXE)&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Crash&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs can bring down the custom action sandbox&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Binary Dependency&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs can require technologies that are not in the system at the time of the install.&amp;nbsp; &lt;I&gt;Specific instance&lt;/I&gt;: MSXML custom actions required MFC 7 but it didn't exist on machines.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Load&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs can expect to load DLLs from the path but the path could be customized by the user on the machine.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Rights&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs can require more rights (e.g. admin) than the package thus breaking scenarios (per-user)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Logging&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs do not have access to the Windows Installer Log so there is no integrated troubleshooting.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that provides log path to EXE and puts the log next to or into the Windows Installer log)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;UI&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXE do not have access to the &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/uilevel.asp"&gt;UILevel&lt;/A&gt; so they do not know &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/determining_ui_level_from_a_custom_action.asp"&gt;whether it's OK to display UI&lt;/A&gt;.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that reads &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/uilevel.asp"&gt;UILevel&lt;/A&gt; and alters command line)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Progress&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs do not have &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/adding_custom_actions_to_the_progressbar.asp"&gt;access to the widows installer progress bar&lt;/A&gt;.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, add entries to the &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/reservecost_table.asp"&gt;ReserveCost&lt;/A&gt; table)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Hangs&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXE may hang and neither the Windows Installer nor the user has no way of knowing whether the install is hung or just taking a long time.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls &lt;A href="http://msdn.microsoft.com/library/en-us/dllproc/base/createprocess.asp"&gt;CreateProcess&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/library/en-us/dllproc/base/waitformultipleobjectsex.asp"&gt;WaitForMultipleObjects&lt;/A&gt;)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Costing&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXE do not have any way of being integrated into the &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/file_costing.asp"&gt;Windows Installer costing&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/adding_custom_actions_to_the_progressbar.asp"&gt;add ticks to the progress bar&lt;/A&gt;)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Rollback&lt;/P&gt;
&lt;P&gt;- rollback behavior&lt;BR&gt;- decision when to execute rollback (did failure occur in the FWD case thus calling the Backward case is extraneous?)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXE do not support &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/rollback_installation.asp"&gt;rollback&lt;/A&gt;.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls EXE uninstall if exists)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Transparency and Predictability&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs are not &lt;A href="http://msdn.microsoft.com/library/en-us/vsintro7/html/vxgrfcustomactiondataproperty.asp"&gt;data driven from the contents&lt;/A&gt; of the MSI thus are not transparent to users, especially admins.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Uninstall&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs do not support &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/uninstalling_custom_actions.asp"&gt;uninstall&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls EXE uninstall if exists)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Uninstall Rollback&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs do not support &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/uninstalling_custom_actions.asp"&gt;uninstall&lt;/A&gt; rollback&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls EXE install)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Repair/Resiliency&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs do not support &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/reinstalling_a_feature_or_application.asp"&gt;repair&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls EXE install again)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;First Run&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs mix per machine installation with per-user installation that should be &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/initializing_an_application.asp"&gt;invoked at first run&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Error Codes&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs do not provide return codes or have return codes that do not match the &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/custom_action_return_values.asp"&gt;custom action return code&lt;/A&gt; expectations.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that interprets errors returned from the EXE and &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/custom_action_return_values.asp"&gt;returns the appropriate value&lt;/A&gt;) &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Watson&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXE failures are difficult to map to Watson buckets (for teams that have implemented Setup Watson)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that initializes Setup Watson with the needed context to differentiate EXE error)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;PSS Costs&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;When an EXE fails, the supports costs are absorbed by the enclosing product&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that records needed context to differentiate EXE error)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Localization&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Does installation or manipulation by the EXE cause strings to be written to the system?&amp;nbsp; If yes, how are the strings differentiated?&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Selection&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Some EXEs have different levels that can be installed (Minimum, Full).&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that maps UI or feature selection to different levels in EXE)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Terminal Server and SMS&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Bad EXEs do not run &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/using_custom_actions_on_a_terminal_server.asp"&gt;correctly on Terminal Server&lt;/A&gt; where there is no user logged in and will not have a user hive&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Group Policy (Publishing, assignment)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;&amp;lt;missing this context&amp;gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Debugging&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;There is no way to &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/debugging_custom_actions.asp"&gt;debug custom actions&lt;/A&gt; in EXE from MSI.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that uses &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/debugging_custom_actions.asp"&gt;dll debugging&lt;/A&gt; then alter EXE call from inside &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt;)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Access to Database&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs are unable to &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/accessing_the_current_installer_session_from_inside_a_custom_action.asp"&gt;access the database&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that uses dll method to &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/accessing_the_current_installer_session_from_inside_a_custom_action.asp"&gt;access the database&lt;/A&gt;)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Run From Source or Cache&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs are unable to be configured to &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/addsource.asp"&gt;run from source&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Servicing&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs are more difficult to confirm they contain the right security fixes when servicing&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Help&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs that contain 2.0 User Education integration may not have MSI's namespace parents configured at the time they are called&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, move the EXE to a different location in the sequence after the html help custom actions)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Events&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs that produce events during install will appear outside the MSI context&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Customization&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Numerous third party tools exist to customize an install to the needs of a particular specialized user (usually LORGs)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;File In Use&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;There is no way for a custom action to inform the user that files they want to manipulate are in use&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Pending File Renames, File in Use, and Rollback&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;If a EXE custom action replaces files that are held in use and a MoveFileEx causes those files to end up in Pending File Renames, then the install rolls back it's possible that the files will still be changed on the next boot.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Detection of When to Install (Resiliency v Rollback)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;A rollback during repair or reinstall could cause premature removal of a EXE install that existed on the machine before MSI was installed.&amp;nbsp; If one implements rollback, one has to implement foolproof detection for existing installs of the component and &lt;I&gt;not&lt;/I&gt; run the EXE package if the same version of EXE is already on the machine.&amp;nbsp; Otherwise, a cancel or failure in the MSI could cause a preexisting installation of the EXE component to be removed.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Reboot&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;If the EXE requires a reboot, there is no way to communicate the need for the REBOOT to the MSI&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Cancel&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;As EXEs can not call &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprocessmessage.asp"&gt;MsiProcessMessage&lt;/A&gt;, they are unable to respond to the cancel button.&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None (best effort, build &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/dynamic_link_libraries.asp"&gt;DLL&lt;/A&gt; that calls &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprocessmessage.asp"&gt;MsiProcessMessage&lt;/A&gt;)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;Watson&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;EXEs that crash may cause a Watson dialog during the install&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;None&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;H3&gt;Test Scenarios&lt;/H3&gt;
&lt;P&gt;When testing the MSI that contains this EXE, one needs to test the following &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Deployment technologies&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Group Policy Software Distribution&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Publishing&lt;/LI&gt;
&lt;LI&gt;Assignment&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;SMS deployment&lt;/LI&gt;
&lt;LI&gt;Install from network share/media&lt;/LI&gt;
&lt;LI&gt;Install from local cache&lt;/LI&gt;
&lt;LI&gt;Hard drive imaging&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Customer segments&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Retail install&lt;/LI&gt;
&lt;LI&gt;OEM pre-install&lt;/LI&gt;
&lt;LI&gt;Enterprise deployment&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;User types&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;No user (install during winlogon, install by SMS agent) - these will not have a user hive&lt;/LI&gt;
&lt;LI&gt;Lockdown user&lt;/LI&gt;
&lt;LI&gt;Regular user&lt;/LI&gt;
&lt;LI&gt;LUA without registry virtualization&lt;/LI&gt;
&lt;LI&gt;Admin user&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; COLOR: #969696; mso-bidi-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;[Author: Robert Flaming]&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA"&gt;This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at &lt;A href="http://www.microsoft.com/info/cpyright.htm" mce_href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;SPAN style="COLOR: #003399; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/info/cpyright.htm&lt;/SPAN&gt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5548080" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Frequently+Asked+Questions/default.aspx">Frequently Asked Questions</category><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Design+Pointers/default.aspx">Design Pointers</category><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Arbitrary labels used as Primary keys must not be changed between versions</title><link>http://blogs.msdn.com/windows_installer_team/archive/2007/03/07/arbitrary-labels-used-as-primary-keys-must-not-be-changed-between-versions.aspx</link><pubDate>Wed, 07 Mar 2007 21:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1830132</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/1830132.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=1830132</wfw:commentRss><description>&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;Summary&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Msi Editing tools that write auto generated references inside installer tables may cause unnecessary content to be included inside a patch.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;‘Patching’ components with unchanged content may cause them to be uninstalled when the patch is removed thereby breaking the original application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;EM&gt;&lt;FONT size=5&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;&lt;SPAN class=MsoIntenseEmphasis&gt;&lt;SPAN style="FONT-WEIGHT: normal"&gt;Scenario&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=MsoIntenseEmphasis&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-STYLE: normal"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;“I create a small patch for my product.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;When I selectively uninstall the patch my original product is broken.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;The trouble is I’m using Msi 3.x and this isn’t supposed to happen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Doesn’t Msi 3.x ‘cache’ whatever I patch so I can just roll it back when I uninstall?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I have followed all the rules to the letter but can’t see where things are going wrong?”&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT size=5&gt;&lt;FONT face=Cambria&gt;&lt;FONT color=#365f91&gt;&lt;SPAN style="FONT-WEIGHT: normal; mso-bidi-font-weight: bold"&gt;This&lt;/SPAN&gt; &lt;/FONT&gt;&lt;SPAN class=MsoIntenseEmphasis&gt;&lt;SPAN style="FONT-WEIGHT: normal"&gt;&lt;FONT color=#4f81bd&gt;Is How &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT color=#365f91&gt;&lt;SPAN style="FONT-WEIGHT: normal; mso-bidi-font-weight: bold"&gt;I&lt;/SPAN&gt; &lt;/FONT&gt;&lt;SPAN class=MsoIntenseEmphasis&gt;&lt;SPAN style="FONT-WEIGHT: normal"&gt;&lt;FONT color=#4f81bd&gt;Can Reproduce This Behaviour&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I create an installation msi for my simple single file application msiExplorer.exe.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is nothing untoward about this installation.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The file goes in Program Files\msiExplorer and puts a shortcut on the desktop.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The installation also creates a single registry key HKLM\Software\msiExplorer with value Text set to “A”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;It installs. It works.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here’s the registry table:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=egkey1 style="WIDTH: 709px; HEIGHT: 184px" height=184 alt=egkey1 src="http://msidev.members.winisp.net/image001.png" width=709 align=middle mce_src="http://msidev.members.winisp.net/image001.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Next, I create a new ‘upgraded’ version of this product.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The only thing I change is the &lt;U&gt;label&lt;/U&gt; in the registry column of the registry table. (Why would I want to do that!? – well just bear with me and I’ll explain below).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I change the label to “RegKey2”.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=regkey2 style="WIDTH: 709px; HEIGHT: 184px" height=184 alt=regkey2 src="http://msidev.members.winisp.net/image002.png" width=709 align=middle mce_src="http://msidev.members.winisp.net/image002.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Now I go through the patch creation process by duly creating a PCP file.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the PCP I specify the old ‘RTM’ msi and the new ‘updated’ msi – the usual routine.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;When I execute MsiMsp.exe it works.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;No errors reported.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I can even load the original RTM msi database into Orca and overlay it with my new msp.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It confirms that the registry table has been modified and shows me what is now included in the patch.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=Regkey1Regkey2 style="WIDTH: 685px; HEIGHT: 212px" height=212 alt=Regkey1Regkey2 src="http://msidev.members.winisp.net/image003.png" width=685 align=middle mce_src="http://msidev.members.winisp.net/image003.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Notice how the actual Registry key, value and data are the same.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Only the Registry column has changed.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Ok, I install RTM.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It runs without problem; the registry key is duly created.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I apply the patch (msiexec /p msiExplorer.msp).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It installs, it runs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Registry key looks the same – well it would wouldn’t it?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;At this stage it’s difficult to tell who was responsible for writing that registry value – the RTM install or the subsequent patch.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;IMG title=regdumpTextA style="WIDTH: 723px; HEIGHT: 243px" height=243 alt=regdumpTextA src="http://msidev.members.winisp.net/image004.png" width=723 align=middle mce_src="http://msidev.members.winisp.net/image004.png"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;However I know the patch has been successfully applied because when I look in Add\Remove programs, there is my app and the patch correctly listed.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=arpPatch1 style="WIDTH: 730px; HEIGHT: 167px" height=167 alt=arpPatch1 src="http://msidev.members.winisp.net/image005.png" width=730 align=middle mce_src="http://msidev.members.winisp.net/image005.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So everything looks good.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Unfortunately the trouble starts when I decide to selectively remove MsiExplorer_Patch1 (msiexec /i msiExplorer.msi MSIPATCHREMOVE=msiexplorer.msp).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The patch uninstall executes successfully, Add\Remove programs shows it has been removed and I think I’m ok.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=arpPatch1Removed style="WIDTH: 730px; HEIGHT: 167px" height=167 alt=arpPatch1Removed src="http://msidev.members.winisp.net/image006.png" width=730 align=middle mce_src="http://msidev.members.winisp.net/image006.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;But when I look in the registry.......&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;IMG title=regdumpTextAgone style="WIDTH: 723px; HEIGHT: 243px" height=243 alt=regdumpTextAgone src="http://msidev.members.winisp.net/image007.png" width=723 align=middle mce_src="http://msidev.members.winisp.net/image007.png"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .........my registry key has gone.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So now you can imagine when I run my app – if it depended on this key – it’s going to fail.&lt;/FONT&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;Why does that happen?&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;FONT face=Calibri size=3&gt;The key aspect of the scenario is that the registry key with a new label ‘looks’ like a new registry resource added by the patch.&amp;nbsp; When a patch is removed, the new product is restored to its view minus the patch.&amp;nbsp; Additionally, the Installer processes the patch being removed for any resources that it added.&amp;nbsp; It then schedules removal for those resources.&amp;nbsp; Therefore, while the key with label RegKey1 became active (the verbose log file shows it being written).........&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center; mso-add-space: auto" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=verboseLogAdded style="WIDTH: 807px; HEIGHT: 339px" height=339 alt=verboseLogAdded src="http://msidev.members.winisp.net/image008.png" width=807 align=middle mce_src="http://msidev.members.winisp.net/image008.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 36pt; mso-add-space: auto"&gt;&lt;FONT face=Calibri size=3&gt;........... it was later deleted per label RegKey2 as part of the added resource cleanup (the last portion of the verbose log file before the end opcode).&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center; mso-add-space: auto" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 10pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=verboseLog_Removed style="WIDTH: 807px; HEIGHT: 339px" height=339 alt=verboseLog_Removed src="http://msidev.members.winisp.net/image009.png" width=807 align=middle mce_src="http://msidev.members.winisp.net/image009.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;So How Could You Unknowingly Get Into This Situation?&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I’m using an ‘industrial strength household name Msi Editing tool’ (ISHNMET).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s a very good product.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It has a nice feature which will read a COM Server file and automatically extract the COM registration information and populate the tables.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;One of these tables is the registry table.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It therefore populates the registry column with arbitrary labels Registry1, Registry2...etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Here’s a mock up of how it might look:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;IMG title=mockupBefore style="WIDTH: 867px; HEIGHT: 213px" height=213 alt=mockupBefore src="http://msidev.members.winisp.net/image010.png" width=867 align=middle mce_src="http://msidev.members.winisp.net/image010.png"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I have to rebuild my msi package every day and have automated the process.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The developers submit their updated files and the tables are built by script.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;When the msi is built by the ISHNMET it does its trick of automatically extracting the COM information.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If the developer has built some extra COM functionality into a dll the entries are inserted mid table bumping all the lower rows down.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The naming algorithm just re-labels all the rows.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;In this example Registry4 gets bumped down a row and re-labelled as Registry5&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=mockupAfter style="WIDTH: 813px; HEIGHT: 219px" height=219 alt=mockupAfter src="http://msidev.members.winisp.net/image011.png" width=813 align=middle mce_src="http://msidev.members.winisp.net/image011.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Now when we go through our patch creation process we correctly pick up that MsiExplorer.exe component has changed but inadvertently include component ‘SomeComponent’&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;because the label changed!&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Now we are going to deliver a patch which includes the problem discussed above.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;To be fair the very latest versions of ISHNMET try to minimise this scenario.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However you might for example delete a registry entry and then change your mind, re-create it using the GUI and have it reappear in the registry table with a brand new label.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So it probably pays to be aware of the dangers of arbitrary labels.&lt;/FONT&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;Does this happen anywhere else?&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Exactly the same issue applies to the file table.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If the ISHNMET uses arbitrary labels for the files it is adding to the file table then they are subject to the same vulnerability.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Where the label in the file table is used as the keypath in the component, it is automatically changed at both reference points when re-labelling occurs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;From the ISHNMET point of view this keeps the referential integrity between Component and File nice and tidy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;From our point of view though, this will be picked up by MsiMsp.exe.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You could finish up attempting to patch a file with an identical copy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here is what this looks like with my simple example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Modify the File column of the file table (Was msiExplorer.exe, now msiExplorer1.exe)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=FileExample1 style="WIDTH: 872px; HEIGHT: 200px" height=200 alt=FileExample1 src="http://msidev.members.winisp.net/image012.png" width=872 align=middle mce_src="http://msidev.members.winisp.net/image012.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;... and modify the keypath reference in the component table....&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=fileExample2 style="WIDTH: 872px; HEIGHT: 200px" height=200 alt=fileExample2 src="http://msidev.members.winisp.net/image013.png" width=872 align=middle mce_src="http://msidev.members.winisp.net/image013.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Create the patch and just to confirm it, overlay the RTM msi with the msp.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;U&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;U&gt;&lt;o:p&gt;&lt;SPAN style="TEXT-DECORATION: none"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;IMG title=fileExample3 style="WIDTH: 872px; HEIGHT: 196px" height=196 alt=fileExample3 src="http://msidev.members.winisp.net/image014.png" width=872 align=middle mce_src="http://msidev.members.winisp.net/image014.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Install RTM.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Install the patch.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Use Add\Remove programs to confirm the patch is registered&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;U&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;IMG title=fileExample4 style="WIDTH: 735px; HEIGHT: 163px" height=163 alt=fileExample4 src="http://msidev.members.winisp.net/image015.png" width=735 align=middle mce_src="http://msidev.members.winisp.net/image015.png"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;You might even inspect the patch cache and notice that &lt;U&gt;no&lt;/U&gt; copy of msiExplorer.exe has been saved.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;U&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=fileExample5 style="WIDTH: 777px; HEIGHT: 334px" height=334 alt=fileExample5 src="http://msidev.members.winisp.net/image016.png" width=777 align=middle mce_src="http://msidev.members.winisp.net/image016.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Now selectively uninstall the patch and the original msiExplorer.exe (The one in Program Files\msiExplorer) has disappeared.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Try to run the shortcut and if you’re lucky the executable will be restored via install-on-demand resilience or in my case, just to prove the point, I hid the source msi so that I could see the install-on-demand dialog.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt; TEXT-ALIGN: center" align=center&gt;&lt;U&gt;&lt;SPAN style="mso-fareast-language: EN-GB; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title=fileExmple6 style="WIDTH: 404px; HEIGHT: 230px" height=230 alt=fileExmple6 src="http://msidev.members.winisp.net/image017.png" width=404 align=middle mce_src="http://msidev.members.winisp.net/image017.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The app is broken.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt; mso-add-space: auto"&gt;&lt;FONT face=Calibri size=3&gt;This same explanation above works for the File as well – and it should be noted that you’d need to maintain the same filekey for binary delta patching to work (just look at the Patch table and you’ll know why by reviewing the primary key columns for that table)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 10pt; mso-add-space: auto"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H1 style="MARGIN: 24pt 0cm 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;Here’s the Message&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0cm 0cm 10pt; mso-add-space: auto"&gt;&lt;FONT face=Calibri size=3&gt;The Installer’s format is a relational database.&amp;nbsp; Identity is expressed by the primary key – which is why it is so crucial.&amp;nbsp; An item is found in the database by searching for its primary key. That’s how transforms can know which data to modify (efficiently) and how Patchwiz can determine what has changed.&amp;nbsp; It’s imperative that the primary keys are not changed between versions of the package.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 16pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-fareast-language: EN-GB"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 138.0pt"&gt;&lt;SPAN lang=EN style="COLOR: #969696; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-ansi-language: EN; mso-fareast-language: EN-GB"&gt;[Author: Robin Drake]&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 20pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-ansi-language: EN; mso-fareast-language: EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN lang=EN style="FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-ansi-language: EN; mso-fareast-language: EN-GB"&gt;This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at &lt;A href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;SPAN style="COLOR: #003399; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/info/cpyright.htm&lt;/SPAN&gt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;SPAN lang=EN style="FONT-SIZE: 20pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-ansi-language: EN; mso-fareast-language: EN-GB"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN style="FONT-SIZE: 18pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1830132" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Design+Pointers/default.aspx">Design Pointers</category><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>New article on UAC and Windows Installer available.</title><link>http://blogs.msdn.com/windows_installer_team/archive/2007/02/19/new-article-on-uac-and-windows-installer-available.aspx</link><pubDate>Mon, 19 Feb 2007 23:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1718390</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/1718390.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=1718390</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Stefan Krueger (one of our MVP’s) has written an &lt;/FONT&gt;&lt;A href="http://www.macrovision.com/company/news/newsletter/tips/is_vista.shtml"&gt;&lt;FONT face=Calibri size=3&gt;article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; for Macrovision (InstallShield) entitled "7 Reasons Why your Installations May Fail on Windows Vista (And How You Can Fix Them)" outlining the top reasons why he sees failures of Windows Installer (MSI) packages on Vista. It’s a good read.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;(You can see Stefan's own blog posting about the article &lt;A class="" title="stefan's blog" href="http://msmvps.com/blogs/installsite/archive/2007/02/07/551337.aspx" target=_blank mce_href="http://msmvps.com/blogs/installsite/archive/2007/02/07/551337.aspx"&gt;here&lt;/A&gt;.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Tyler Robinson]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at &lt;A href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;FONT color=#003399&gt;http://www.microsoft.com/info/cpyright.htm&lt;/FONT&gt;&lt;/A&gt;.&lt;/FONT&gt; &lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1718390" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 6</title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/tao-of-the-windows-installer-part-6.aspx</link><pubDate>Tue, 19 Sep 2006 00:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:761223</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/761223.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=761223</wfw:commentRss><description>Well, here we are with the last part in this series, where we'll be looking at security in relation to the Installer. As I'm sure you're aware, Microsoft take security very seriously, so don't let the fact that this is the last section make you think it's just tagged on at the end to meet some "security quota" for Microsoft documents. And don't be tempted to tag security on at the end of your packaging process either. &lt;BR&gt;&lt;BR&gt;Before I finish up with the series, I'd like to thank everyone who has provided feedback on the blog or to me directly. In particular, thanks to the following individuals for contributing ideas and reviewing the posts: 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.huntland.co.uk/" target=rd mce_href="http://www.huntland.co.uk/"&gt;Robin Drake&lt;/A&gt;, &lt;I&gt;Windows Installer trainer and consultant&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/rflaming/" target=rf mce_href="http://blogs.msdn.com/rflaming/"&gt;Robert Flaming&lt;/A&gt;, &lt;I&gt;Windows Installer Program Manager&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/Showpost.aspx?postid=134577" target=trcn mce_href="http://channel9.msdn.com/Showpost.aspx?postid=134577"&gt;Carolyn Napier&lt;/A&gt;, &lt;I&gt;Windows Installer development lead&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/Showpost.aspx?postid=134577" target=trcn mce_href="http://channel9.msdn.com/Showpost.aspx?postid=134577"&gt;Tyler Robinson&lt;/A&gt;, &lt;I&gt;Windows Installer Program Manager&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2005/09/09/463151.aspx" target=hem mce_href="http://blogs.msdn.com/windows_installer_team/archive/2005/09/09/463151.aspx"&gt;Hemchander Sannidhanam&lt;/A&gt;, &lt;I&gt;Windows Installer developer&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/heaths/default.aspx" target=hs mce_href="http://blogs.msdn.com/heaths/default.aspx"&gt;Heath Stewart&lt;/A&gt;, &lt;I&gt;Developer&lt;/I&gt;&lt;/LI&gt;&lt;/UL&gt;As mentioned at the start some months ago, this series should be available later in the year as a downloadable white paper. Keep an eye on the blog for details. &lt;BR&gt;&lt;BR&gt;Series links: 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx" mce_href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Fundamentals &lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx" mce_href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx"&gt;Packaging&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx" mce_href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx"&gt;Deployment&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx" mce_href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Patching&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx" mce_href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx"&gt;Testing and Support&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Security Considerations &lt;/LI&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;TABLE class=""&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Security Considerations&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 57: Install Managed Applications into a Secure Installation Folder&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;A “secure installation folder” is one for which non-admin users do not have change or modify permissions. There is little point in securing the installation with Group Policy, Software Restriction Policies, Digital Signing, etc., if the user can simply change the application files after install. &lt;BR&gt;&lt;BR&gt;You should also secure all of the applications registry data in a similar way. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 58: Be careful When using Properties for Passwords or Other Sensitive Information&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The installer may write the value of a property authored into the Property table, or created at run time, into a log or the system registry, which is obviously not good security for things such as passwords. Ideally, avoid using properties in this way, but if you must, then use the &lt;I&gt;MsiHiddenProperties&lt;/I&gt; property to makes sure the information is not logged. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 59: Use &lt;I&gt;Restricted Public Properties&lt;/I&gt; to Restrict the Public Properties a User Can Change.&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;In the case of a managed installation, the package author may need to limit which public properties are passed to the server side and can be changed by a user that is not a system administrator. Some restrictions are commonly necessary to maintain a secure environment when the installation requires the installer to use elevated privileges. If all of the following conditions are met, a user that is not a system administrator can only override an approved list of restricted public properties: 
&lt;UL&gt;
&lt;LI&gt;The system is Windows 2000 or later&lt;/LI&gt;
&lt;LI&gt;The user is not a system administrator&lt;/LI&gt;
&lt;LI&gt;The application or product is being installed with elevated privileges&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 60: Avoid Installing Services That Impersonate the Privileges of a Particular User&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;This may write security data into a log or the system registry. This creates potential for a security problem, password conflict, or the loss of configuration data when the system is restarted. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 61: Use the &lt;I&gt;LockPermissions&lt;/I&gt; Table to Secure Files, Registry Keys, etc.&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Every file, registry key, or directory that is listed in the LockPermissions Table receives an explicit security descriptor, whether it replaces an existing object or not. The Windows Installer attempts to preserve the security on objects that already exist on the system, but has these defaults, which may not provide a secure installation: 
&lt;UL&gt;
&lt;LI&gt;If an object is not listed in the &lt;I&gt;LockPermissions&lt;/I&gt; table, and replaces an existing object, the replacement gets the security settings of the object that it replaces.&lt;/LI&gt;
&lt;LI&gt;If an object is not listed in the &lt;I&gt;LockPermissions&lt;/I&gt; table, and does not replace an existing object, it receives no explicit security descriptor. The access to the new object is based on the attributes of its parent or container object.&lt;/LI&gt;&lt;/UL&gt;It is recommended that the system administrator’s local group be included in all access control list. This ensures that the system administrator can access and maintain objects. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 62: Add a Digital Signatures to the Installation to Ensure the Integrity of the Files&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Windows Installer version 2.0 and later uses digital signatures to detect corrupted resources. A signer certificate may be compared to the signer certificate of an external resource to be installed by the package to ensure its integrity. &lt;BR&gt;&lt;BR&gt;Digital signatures can be used with packages, transforms, patches, merge modules, and external cabinet files. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 63: Fail Securely When the User is Denied Access to Resources&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Author your package such that if the user is denied access to resources, the setup fails in a manner that maintains a secure environment. Check the user’s access privileges and determine whether there is sufficient disk space &lt;I&gt;before&lt;/I&gt; installation begins. Commonly, the installer should only display a browse dialogue box if the current user is an administrator or if the installation does not require elevated privileges. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 64: Use &lt;I&gt;Secured Transforms&lt;/I&gt; to Store Transforms Securely on the Local System&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Secured transforms are stored locally on the user’s computer in a location where, on a secure file system, the user does not have write access. Such transforms are cached in this location during the installation or advertisement of the package. Only administrators and local system have write access to this location. A non-admin user would not be able to modify the transform file. During subsequent installation-on-demand or maintenance installations of the package, the installer uses the cached transforms for increased security. &lt;BR&gt;&lt;BR&gt;You can enable the use of Secured transforms on the command-line, using Group Policy or by setting the TRANSFORMSSECURE property. See the SDK for details. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 65: Use the &lt;I&gt;Security Summary&lt;/I&gt; Property to Indicate Whether the Package Should be Opened as Read-only&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;This property should be set to read-only recommended for an installation database and to read-only enforced for a transform or patch. Database editing tool should not modify a read-only enforced database and should issue a warning when an attempt is made to modify a read-only recommended database. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 66: Use the &lt;I&gt;DisablePatch&lt;/I&gt; and &lt;I&gt;AllowLockdownPatch&lt;/I&gt; Policies to Provide Security in Environments Where Patching Must be Restricted.&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;&lt;I&gt;DisablePatch&lt;/I&gt; is a per-machine policy that prevents the installer from installing patches. This policy can be used in high security environments where patching must be restricted. &lt;BR&gt;&lt;BR&gt;&lt;I&gt;AllowLockdownPatch&lt;/I&gt; is similar but still allows administrators to patch existing products that were installed using elevated privileges. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 67: Make Custom Actions Secure&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The installer runs custom actions with user privileges by default in order to limit the access of custom actions to the system. The installer may run custom actions with elevated privileges if a managed application is being installed or if the system policy has been specified for elevated privileges. To ensure better security, follow these guidelines: 
&lt;UL&gt;
&lt;LI&gt;Secure any additional files written by your custom action&lt;/LI&gt;
&lt;LI&gt;Check buffer lengths and validity of all data read by your custom action. This includes properties that may supply data to your custom action, particularly those that use public properties provided by a user&lt;/LI&gt;
&lt;LI&gt;Do not rely on external DLLs that are not trusted by the system on all platforms on which your installation package is intended to run&lt;/LI&gt;
&lt;LI&gt;Carefully consider whether to use custom actions that use elevated privileges or impersonation. If your custom action must run with elevated privileges, be sure that the custom action code guards against buffer overruns and inadvertent loading of unsafe code. Note that during the execution phase of the installation, the installer passes information to a process with elevated privileges and runs the script. Any custom actions that run during the execution phase may run with elevated privileges&lt;/LI&gt;
&lt;LI&gt;Gather all information provided by the user during the UI sequence. Do not prompt the user for any information that can’t be set using a public property. If your script custom action expands properties, take precautions that the custom action is secured against the possibility of script injection. Scripts may be logged in clear text&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 68: Test Your Packages For Locked-down Environments&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;In corporate deployment scenarios, restricted functionality, rights and permissions are the norm. You should make sure that your packages deploy properly in such situations. These basic guidelines will help ensure that your packages work in a locked-down environment: 
&lt;UL&gt;
&lt;LI&gt;Test your package for compatibility with the Windows Installer machine System Policy&lt;/LI&gt;
&lt;LI&gt;Make sure you package runs with all user interface levels, none, basic, limited, and full&lt;/LI&gt;
&lt;LI&gt;Test your package on NTFS partitions, both with elevated and non-elevated privileges&lt;/LI&gt;
&lt;LI&gt;Test your package with different user roles. That is, make sure it installs and works correctly for normal users as well as highly privileged users&lt;/LI&gt;&lt;/UL&gt;Ideally, you should test your packages on a test platform that exactly matches your live environment in terms of permissions, policies and suer rights. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 69: Use Software Restriction Policies to Restrict Package Execution&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Software Restriction Policy (SRP) is a mechanism introduced in Windows XP that allows administrators to restrict the execution of applications based on various criteria such as the file hash, path, URL zone and publisher. The Installer is fully compliant with SRP and you can use it to restrict the execution of MSI packages, patches and transforms. &lt;BR&gt;&lt;BR&gt;If a package, patch, or transform is restricted, the Windows Installer displays an error message and logs an entry in the application event log. Software restriction policy is evaluated the first time an application is installed, when a new patch is applied, and when the installation package is re-cached. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=761223" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 5</title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx</link><pubDate>Fri, 28 Jul 2006 14:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:681358</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/681358.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=681358</wfw:commentRss><description>Testing is a vital part of the package development process and you can avoid many problems in production if your testing strategy is sound. So this time we will look at a couple of pointers on testing. &lt;BR&gt;&lt;BR&gt;I must admit I'm less happy with the arrangement of this section than with some of the others. I think &lt;I&gt;Rule 53&lt;/I&gt; is making a bid for its own section and breaks away from the notion of keeping this to some fairly compact bullet points; in any case, it hopefully gives you a starting point on what to think about in your testing. Let me know what you think. &lt;BR&gt;&lt;BR&gt;Series links: 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Fundamentals &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx"&gt;Packaging&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx"&gt;Deployment&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Patching&lt;/A&gt; 
&lt;LI&gt;Testing and Support 
&lt;LI&gt;&lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/761223.aspx"&gt;Security Considerations&lt;/a&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Testing and Support&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 53: Test thoroughly&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;It is crucial that you test your packages thoroughly before deployment. A classic mistake is for developers and package authors to test only on their own systems where they have full administrator rights and then discover that normal users cannot use their applications. You may want to divide your testing into these phases: &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Installation Testing&lt;/B&gt;&lt;BR&gt;Test your package under different installation scenarios, including: 
&lt;UL&gt;
&lt;LI&gt;Full user input and silent installation 
&lt;LI&gt;Different combinations of selected features 
&lt;LI&gt;Different user roles (e.g. normal user, administrator, etc.) 
&lt;LI&gt;Different deployment methods (e.g. manual, SMS, GPO, etc.) 
&lt;LI&gt;Administrative and advertised installations &lt;/LI&gt;&lt;/UL&gt;Enable installer logging for each test and examine the system event logs for errors after each run. Make sure that all installation initialisation and run-time errors are resolved. &lt;BR&gt;&lt;BR&gt;An important, but often overlooked, part of installation testing is to ensure that your setup UI is accessible and can handle different screen resolutions and font sizes. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Patching and Repair&lt;/B&gt;&lt;BR&gt;As mentioned in the &lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx" target=patching&gt;Patching&lt;/A&gt; section, it is very important that you think about patching before deployment. In fact you should not only think about it but test it thoroughly. You should include these scenarios: 
&lt;UL&gt;
&lt;LI&gt;Small update 
&lt;LI&gt;Minor upgrade 
&lt;LI&gt;Major upgrade 
&lt;LI&gt;Product Repair 
&lt;LI&gt;Multiple simultaneous patch installs and uninstalls 
&lt;LI&gt;Installing and uninstalling patches "out of order" &lt;/LI&gt;&lt;/UL&gt;&lt;B&gt;Uninstall Testing&lt;/B&gt;&lt;BR&gt;Many operating system related errors caused by a repackaged application happen during an uninstall session. Therefore it is extremely important to verify that a generated package does not uninstall “too much” and only uninstalls data that belongs to the package itself and not to the operating system or other applications. &lt;BR&gt;&lt;BR&gt;Test uninstall as thoroughly as install, including: 
&lt;UL&gt;
&lt;LI&gt;Uninstall under different user contexts (e.g. normal user and administrator) 
&lt;LI&gt;Uninstall via different methods (e.g. Control Panel, command line, etc.) 
&lt;LI&gt;Make sure that Operating System does not report any integrity problems 
&lt;LI&gt;Reboot a test machine after uninstall (even if the uninstall did not require a reboot) 
&lt;LI&gt;Verify integrity of common system tools and other standard applications &lt;/LI&gt;&lt;/UL&gt;As with install, use Installer logs and event logs to look for errors, and make sure you resolve all those you find. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;Product Functionality Test&lt;/B&gt;&lt;BR&gt;A successful installation and uninstall sessions can be insufficient for an application to work correctly. Therefore you need to ensure that the application works as expected. Some things to check: 
&lt;UL&gt;
&lt;LI&gt;Verify each shortcut in the package starts the corresponding application correctly 
&lt;LI&gt;Walk through main menu items in the application 
&lt;LI&gt;Follow the application functionality test provided by the vendor, if any 
&lt;LI&gt;Verify that file associations by launching a file for each registered extension. 
&lt;LI&gt;Make sure that application opens, save and prints the files correctly &lt;/LI&gt;&lt;/UL&gt;It is recommended that corporations provide application functionality tests allowing a repackaging engineer to quickly verify major application functionality right away, and make sure that a developed MSI package correctly installs an application, and an application is ready to work properly. &lt;BR&gt;&lt;BR&gt;&lt;B&gt;User Acceptance Test (UAT)&lt;/B&gt;&lt;BR&gt;Just as important, but often overlooked, is user input into the testing strategy. User Acceptance Testing (UAT) is especially important when re-packaging legacy applications to MSI format. &lt;BR&gt;&lt;BR&gt;Some points to note for UAT: 
&lt;UL&gt;
&lt;LI&gt;Application should be deployed for UAT in exactly same manner as it will be deployed in the production environment 
&lt;LI&gt;Pilot the deployment with a selection of “typical” users for the application 
&lt;LI&gt;Make it easy for users to report problems and provide feedback 
&lt;LI&gt;For internal applications, the owning Business Unit must ensure each application passes the UAT to be defined by that Business Unit. Where the package is processed externally an amount of time must be agreed upon, after which it is reasonable to assume the package has been accepted into production 
&lt;LI&gt;It is recommended that product functionality tests be provided for all internal applications. Such tests will allow a packaging engineer to verify major application functionality before submitting a migrated package for UAT &lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 54: Validate Your Packages&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Validation is a means by which you can run certain standard checks (called ICEs) against your package to check for inconsistencies and non-compliance with Installer rules. &lt;BR&gt;&lt;BR&gt;Many ICEs ship with the Installer SDK in .CUB files and you can write your own. They can be run against your packages using the ORCA or MsiVal2.exe tools from the SDK. &lt;BR&gt;&lt;BR&gt;You should &lt;I&gt;always&lt;/I&gt; fully validate your packages and, much like when working with application development, correct any reported errors and treat all warnings seriously. &lt;BR&gt;&lt;BR&gt;Validation is also a useful troubleshooting technique, particularly if you are working with 3-rd party packages. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 55: Use Installer Logging&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;As mentioned previously, the Installer supports extensive logging. This is by far the best tool for troubleshooting Installer issues and the time spent understanding the log files will be repaid many times over when problems arise later. At the least logging should be used throughout testing. &lt;BR&gt;&lt;BR&gt;You are certain to be asked to provide verbose logs if you contact Microsoft support, so either have these ready or be prepared to reproduce your problem to gather some. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 56: Use Virtual Environments for Testing and Support&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Using virtual machines (VMs) for testing rather than real systems has a couple of advantages: 
&lt;UL&gt;
&lt;LI&gt;You can build a VM for each of the different systems in your environment and store these on a single server or workstation to be brought on-line when needed 
&lt;LI&gt;With “undo”-style features of VMs you can easily revert to a clean, known state after each test 
&lt;LI&gt;The same VM images can be used by testing and helpdesk staff &lt;/LI&gt;&lt;/UL&gt;However, do note that if you think you have discovered a bug in the Installer you may be required to reproduce the problem on real hardware when you contact Microsoft support: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://support.microsoft.com/kb/897615/" target=mskb&gt;Support policy for Microsoft software running in non-Microsoft hardware virtualization software&lt;/A&gt; &lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=681358" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 4 </title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx</link><pubDate>Tue, 27 Jun 2006 15:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648447</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/648447.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=648447</wfw:commentRss><description>&lt;P&gt;So, we've covered the basics of the Installer, created a package and deployed it.&amp;nbsp; So far, so good, but what happens if the&amp;nbsp;application needs updated?&amp;nbsp; Well, here are some things to think about with regard to patching. Enjoy. &lt;BR&gt;&lt;BR&gt;Series links: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Fundamentals &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx"&gt;Packaging&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx"&gt;Deployment&lt;/A&gt; 
&lt;LI&gt;Patching 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx"&gt;Testing and Support&lt;/A&gt; 
&lt;LI&gt;&lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/761223.aspx"&gt;Security Considerations&lt;/a&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Patching&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 40: Use Installer Version 3.0 or Later&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;One of the main objectives of MSI3.0 was to improve application servicing. There are many new features such as sequencing and obsolescence that greatly aid in patching installed applications. &lt;BR&gt;&lt;BR&gt;In addition, from a system administrators point of view, one key improvement is the ability to remove patches. Prior to Installer v3.0 patches could not be uninstalled without removing the parent application. This is no longer the case. &lt;BR&gt;&lt;BR&gt;Note that you should update the Installer before you deploy any applications or patches, as upgrading afterwards does not make already installed patches uninstallable. If this is not possible, then still author patches for MSI3.0. While they won’t be able to take advantage of the new features, they are fully backward compatible and won’t need changed once you do upgrade. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 41: Design and Test Your Servicing Strategy Before You Ship the Initial Product&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;You must know in advance how you’ll be updating your product, and once it’s shipped it’s too late to change its design. So build and install your product, then create an update (a minor update, a major upgrade, whatever you’ll be using) and make sure that it works. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 42: Author Packages to Avoid Source Requirements During Patching&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;One major problem with patching previously was that the original source files were required to install the patch. With MSI3.0 this requirement was reduced, but not eliminated. You can help yourself by authoring your packages and patches from the start in a way that reduces dependence on the source files. Here are some tips on doing this: 
&lt;UL&gt;
&lt;LI&gt;Use binary delta patching. You can patch efficiently by just targeting baselines (RTM, SP1, SP2, etc.). 
&lt;LI&gt;Ensure that none of your custom actions access the original source location. 
&lt;LI&gt;Ensure that the ResolveSource action is conditionalized so that it only runs when needed, or alternatively is not present at all. 
&lt;LI&gt;Populate the MsiFileHash Table for all unversioned files. Msifiler.exe can easily do this for you. 
&lt;LI&gt;Ensure that all files have the correct version and language information. Msifiler.exe can easily do this for you.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 43: Think carefully about Merge Module Patching&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Merge modules provide a standard method for delivering Windows Installer components and setup logic just like any redistributable software. For all practical purposes any MSI package can consume a merge module and start using the functionality exposed by the merge module. However, the servicing story of such an MSI package has a huge flaw. Since the setup author who owns the MSI doesn’t own the merge module, they have no way to deliver fixes to issues that are found in the merge module, unless the merge module owner makes them available. On the other hand, the owner of the merge module has no way of delivering the fixes directly to the clients who installed the MSI built after consuming his/her merge module. The bottom-line of the story here is: 
&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;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;Merge modules are great to use for distributing authoring and building of your setup. However, if you intend to redistribute an MSM externally, you should review the servicing implications. If you can tightly control the MSM consumers and identify the relevant products, then it’s possible to service them with a single MSP (multi-product targeting). Otherwise the recommendation is to provide your technology as an MSI that must be chained into the setup &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 44: Avoid Patching Aministrative Installs&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Administrators are strongly advised to keep administrative install points as pristine images. Here are a summary of problems you can encounter if you decide to use administrative patching: 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Deployment latency&lt;/B&gt;. Once the admin image is updated a reinstall command must be invoked on all clients. Before this occurs clients remain in the infamous client/server out of sync state where they can not utilize the admin image. 
&lt;LI&gt;&lt;B&gt;Lack of Inventory&lt;/B&gt;. Applying a patch to an admin image does not stamp the image with information about the patch. It simply updates the files and MSI. Thus clients have no way to determine and report on which updates they’ve consumed from admin images. 
&lt;LI&gt;&lt;B&gt;No Undo Support&lt;/B&gt;. Reverting an admin patch from the admin image is not supported by Windows Installer. 
&lt;LI&gt;&lt;B&gt;Patch Mixing Issues&lt;/B&gt;. Since there is a lack of information on what patches were applied on the admin image, sequencing patches applied on the admin image and those applied on the client side is impossible. Also, the availability of a previous version file is required for binary difference patches to work. But, when a client is synced up to an image that has been admin patched, most binary patch applications fail since, most binary patches target the RTM image. 
&lt;LI&gt;&lt;B&gt;Performance&lt;/B&gt;. The admin patching model suffers from higher bandwidth usage and lack of change delta information. Bandwidth is increased because an entire new MSI package must be downloaded as well as individual source files, increasing both overall download size and latency as compared to a client patch. Precise change delta information is missing because the admin image is modified in place, forcing clients to perform brute force reinstalls to ensure they are brought up to date.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 45: Use Least Privileged User Account (LUA) Patching if Possible&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;LUA patching enables you to identify digitally-signed patches that can be applied in the future by non-administrator users, provided the following conditions are met: 
&lt;UL&gt;
&lt;LI&gt;The application was installed on Windows XP using Windows Installer 3.0 or later 
&lt;LI&gt;The application was originally installed per-machine 
&lt;LI&gt;The application is installed from removable media, such a CD-ROM or DVD disk. This requirement has been removed in Windows Vista. 
&lt;LI&gt;The MsiPatchCertificate table is present and populated in the original package 
&lt;LI&gt;Patches are digitally signed by a certificate listed in the MsiPatchCertificate table 
&lt;LI&gt;Patches can be validated against the digital signature 
&lt;LI&gt;LUA patching has not been disabled by setting the MSIDISABLELUAPATCHING property or the DisableLUAPatching policy&lt;/LI&gt;&lt;/UL&gt;The limitation that the original source location must be removable media limits the usefulness of this in a corporate environment and it is really aimed at home users who are patching software they installed from a retail CD. However, if this applies to you, then using this method gives you more flexibility in your patching. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 46: Use the Correct Type of Patch for the Job&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Windows Installer supports a number of classes of patch, each suited for a different task. Use the appropriate one for a given situation. The types are: 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Small Update&lt;/B&gt;. These change one or more application files that are too minor to warrant changing the product code. A small update is also commonly referred to as a hotfix. 
&lt;LI&gt;&lt;B&gt;Minor Upgrade&lt;/B&gt;. These make changes to many resources. A minor upgrade can be used to add new features and components but cannot reorganize the feature-component tree. Minor upgrades provide product differentiation without actually defining a different product. A typical minor upgrade includes all fixes in previous small updates combined into a patch. A minor upgrade is also commonly referred to as a service pack (SP) update. 
&lt;LI&gt;&lt;B&gt;Major Upgrade&lt;/B&gt;. These are comprehensive updates of a product that needs a change of the ProductCode Property. A typical major upgrade removes a previous version of an application and installs a new version.&lt;/LI&gt;&lt;/UL&gt;There are different limitations and requirements for each patch type. Refer to the SDK for details. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 47: Let the patch authoring environment handle sequencing if possible&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;In most cases, patches for a product fall in a single patch family, and the sequence values in that patch family increase over time. This design idiom is so common that most authoring environments that support patch sequencing automatically create sequencing metadata that fits this design. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 48: Use a single PatchFamily per product unless specific requirements exist for more than one family&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;For most products, a single patch family provides enough flexibility to sequence patches. When multiple patch families are used, the complexity of authoring increases. If the additional functionality provided by multiple patch families is not required, you can avoid the unnecessary authoring work. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 49: Follow the guidelines for patch families whenever possible&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The guidelines for defining patch families are designed to reduce the complexity of patch authoring and patch management. Following the patch guidelines results in fewer authoring errors and simpler sequencing behavior. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 50: Use meaningful names for patch families&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Because patch family names have no meaning except as unique identifiers, use a meaningful name that indicates something about the servicing model (whether it is the target product identity, the updated functionality, the company name, or something meaningful to the patch author.) &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 51: Always skip numbers in the fourth field&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;By skipping numbers in the fourth field between consecutive patches, future patches can be sequenced between existing patches. If patch A is 1.2.3.100 and patch B is sequenced with 1.2.3.200, a future patch could, if required, be sequenced as 1.2.3.150. Using fewer than four fields in the sequence number also ensures that space exists between two consecutive patches. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 52: Do not try to extract data from a patch sequence number&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Although sequence numbers may be based on other data about the patch or target product, the algorithm used to generate the sequence number varies from authoring environment to authoring environment. In other cases, the algorithm may be ignored completely to achieve the desired sequencing behavior. Attempting to extract data from a sequence number may result in invalid data. &lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at &lt;A href="http://www.microsoft.com/info/cpyright.htm"&gt;http://www.microsoft.com/info/cpyright.htm&lt;/A&gt;.&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=648447" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 3 </title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx</link><pubDate>Wed, 24 May 2006 14:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:605835</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/605835.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=605835</wfw:commentRss><description>We have reached the mid-way point in this series and will be taking a look at deployment-related recommendations.&amp;nbsp; Shorter than last time, this section is potentially more interesting to system administrators than package developers - in either case, if you have come across some 'gotchas' or know any nice workarounds for deployment problems, please post them. Similarly, if there is anything you always make sure to do in this area, post it as it might make a good rule to help other Installer users. &lt;BR&gt;&lt;BR&gt;Series links: 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Fundamentals &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx"&gt;Packaging&lt;/A&gt; 
&lt;LI&gt;Deployment 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Patching&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx"&gt;Testing and Support&lt;/A&gt; 
&lt;LI&gt;&lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/761223.aspx"&gt;Security Considerations&lt;/a&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;BR&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Deployment&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 30: Per-machine Installs are Easier to Manage&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Because per-machine packages are installed for every user, there are fewer problems for subsequent repair, patching and uninstall. For example, if a user installs an application only for themselves, another user (even an administrator) cannot later uninstall the application. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 31: Keep the Original Source Files Available&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Be aware that when you roll out packages that the original source package may have to remain available. For install-on-demand, repair and some patching situations the Installer returns to the original source of the relevant MSI package to find the required files. If this source is no longer available (e.g the server has been renamed or the original package removed) the user will by default see a prompt such as ‘Please insert CD #2’, or inviting them to browse the network. &lt;BR&gt;&lt;BR&gt;Mechanisms for avoiding problems with this include: &lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Correctly authoring the SourceList property for all packages.&lt;/B&gt; Set this to a semi-colon delimited list of all the possible servers where the software can be found. The clients will failover each server until one that succeeds is found. This can be done with a transform. 
&lt;LI&gt;&lt;B&gt;Using a DFS share for the source path.&lt;/B&gt; Using a DFS server as the source means that changes to the actual physical location are hidden from the end user and the Installer. It also means that you can take advantage of site-awareness to point the user to a local copy of the source packages, even if they move to a location in another town, country or continent. 
&lt;LI&gt;&lt;B&gt;Programmatically altering the registry source list on the client.&lt;/B&gt; You can use the Installer sourcelist API calls or a simple VBScript to do this on local or remote clients.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 32: Anticipate Installation on Terminal Server&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;If your package might be installed on a Terminal Server, keep in mind the following points: &lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;Administrators and non-administrators can install from Terminal Services console sessions 
&lt;LI&gt;Non-administrators cannot install from Terminal Services remote sessions. Non-administrators can only install from a console session 
&lt;LI&gt;Administrators can install from a remote session only if the &lt;I&gt;EnableAdminTSRemote&lt;/I&gt; system policy has been set 
&lt;LI&gt;When an administrator installs from a remote session that is hosted on Windows 2000, the installation must use a UNC path and not a mapped drive letter. This restriction only exists for remote sessions hosted on Windows 2000 
&lt;LI&gt;Windows Installer can perform per-machine installations without using install mode. It is unnecessary to place the Terminal Server computer into install mode to perform a per-machine installation. Windows Installer does not automatically place the Terminal Server computer in install mode, regardless of the type of installation 
&lt;LI&gt;When installing software for an individual user, placing the computer into install mode may incorrectly copy the application’s shortcuts or data to the profiles of other users, even if the application is not installed for these users. It is recommended that applications installed per-user be installed with the Terminal Server computer in the execute mode&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 33: Avoid Black-boxes&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Make your packages as customisable as possible. Users like to decide for themselves where and what to install on their systems. Provide valid and sensible defaults, but allow users to over-ride these where possible. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 34: Support Silent Installation&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Corporate deployment scenarios almost always demand the ability to deploy with no user interactions. You should design your packages to use public properties for configuration information, which administrators can specify on the command-line. &lt;BR&gt;&lt;BR&gt;You should also avoid relying on data gathered from users via dialogues. During silent installs, this data is not going to be availalbe. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 35: Avoid Reboots&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Being told to reboot their system is one thing that is sure to annoy users, particularly if there is no obvious reason for it. Even worse is the system automatically rebooting due to a silent install the user was entirely unaware of. &lt;BR&gt;&lt;BR&gt;In the case of user applications it is usually not necessary to reboot the entire system. If this is required in your case, your install should handle situations where the application or service must be stopped. &lt;BR&gt;&lt;BR&gt;Ideally, you should design your application such that if it is being upgraded or patched it can handle requests to shutdown/restart by saving the current state and restoring it later. this scenario is very much the recommended one for Windows Vista, where eliminating unnecessary reboots is a key objective. You can be ahead of the game by writing your applications to be work this way now. &lt;BR&gt;&lt;BR&gt;If an application or service needs to be stopped, the user should be warned. Similarly, in cases where a reboot is completely unavoidable (e.g. replacing the GINA), the user should be warned and given a choice to defer the reboot. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 36: Enable Logging on Clients&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Windows Installer supports very detailed logging, which can be invaluable when things go wrong during deployment (and development and testing). &lt;BR&gt;&lt;BR&gt;This article gives information on how to enable logging: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://support.microsoft.com/?kbid=223300"&gt;How to enable Windows Installer logging&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;Once you have the log, you obviously need to know what to look for. A very useful resource for this is &lt;I&gt;WiLogUtl.exe&lt;/I&gt;, which ships with the SDK. As well as automating the parsing of the log, it also has some documentations describing typical log contents. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 37: Enable the &lt;I&gt;DisableMedia&lt;/I&gt; Policy&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;This policy helps prevent unauthorised installation. When enabled, users cannot install from anything except a local fixed drive or a remote server. This prevents users installing unauthorised MSI packages from removable media such as CD or Floppy Disk. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 38: Avoid Using the &lt;I&gt;AlwaysInstallElevated&lt;/I&gt; Policy&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;While this policy setting will allow a non-administrator to install packages they would otherwise not have right to install, it would allow them to install any package, not just ones provided by their administrator. &lt;BR&gt;&lt;BR&gt;Since this policy causes the install to run with SYSTEM privileges, it effectively serves as a possible elevation of privilege security breach. A reasonably smart user could craft an MSI package that would add them to the administrators group, install kernel drivers, alter file and registry permissions and perform other undesirable actions. &lt;BR&gt;&lt;BR&gt;As tempting as this policy may seem as a solution to issues of user rights and permissions that are blocking a deployment, do not use it. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 39: Uninstall Cleanly&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;While most packaging effort goes into the creation and install phases, you should also think carefully about what happens when the user uninstalls the package. Your packages should be authored such that they leave no trace of themselves after uninstall. &lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=605835" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 2</title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx</link><pubDate>Fri, 12 May 2006 11:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:595950</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/595950.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=595950</wfw:commentRss><description>&lt;BR&gt;&lt;BR&gt;Sticking strictly to the "approximately weekly" schedule, here we have, nearly two weeks later, the somewhat more substantial second part in this series. &lt;BR&gt;&lt;BR&gt;Thanks for the comments on &lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Part 1&lt;/A&gt; - even though I briefly answered some at the time, I'll be using these when I come to re-draft the list. So, please keep the comments coming, they &lt;I&gt;are&lt;/I&gt; useful. &lt;BR&gt;&lt;BR&gt;Series links: 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx"&gt;Fundamentals &lt;/A&gt;
&lt;LI&gt;Packaging 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx"&gt;Deployment &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Patching &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx"&gt;Testing and Support &lt;/A&gt;
&lt;LI&gt;&lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/761223.aspx"&gt;Security Considerations&lt;/a&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Packaging&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 7: Work On a Copy&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;&lt;I&gt;"My file server won't boot and I really need it up and running now!"&lt;BR&gt;"Ok, let's re-install Windows and restore the data from backup."&lt;BR&gt;"What backup ...?"&lt;/I&gt; &lt;BR&gt;&lt;BR&gt;Been there? Done that? While losing a single MSI package might not be as disastrous as losing your file server, you really don't want to start from scratch because of some accidental corruption. &lt;BR&gt;&lt;BR&gt;So, always make a copy of your package before you start work, then work on the copy. That way, it is easy to revert to a known good version if the working one becomes corrupt or has other problems you cannot easily correct. &lt;BR&gt;&lt;BR&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 8: Never Cancel a Package Build Before it Finishes&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;To avoid corrupting a package, allow the packaging tool to finish building any new version once initiated. Even if you realise that you need to make more changes or did something wrong, allowing the package to build rather than stopping part way through helps avoid possible corruption. Obviously, if the package does become corrupt, all is not lost if you followed Rule 7. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 9: Use a Clean System for Repackaging&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If you are repackaging an existing application rather than creating your own original package, then it is important to do this on a “clean” system. Repackaging tools commonly use “snapshots” of the system state before and after the legacy application is installed, then create an MSI package based on the differences. To avoid any extraneous changes making their way into the packages the systems should: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Match the target system as closely as possible. 
&lt;LI&gt;Be clear of any unnecessary applications 
&lt;LI&gt;Have all non-essential system services stopped 
&lt;LI&gt;Have all unnecessary processes stopped&lt;/LI&gt;&lt;/UL&gt;Some limitations of repackaging are discussed in the following article: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://support.microsoft.com/?id=264478" target=repackage&gt;INFO: Disadvantages of Repackaging Applications&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;In addition to this, you should check with 3-rd party vendors what their support policy is for repackaging their applications. It is possible that you will void any support agreement if you do not use the vendor-supplied installation mechanism. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 10: Do Not Repackage Microsoft Updates&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Microsoft uses a different packaging technology to create Service Packs and other updates for many products, including Windows, Internet Explorer, Exchange Server, SQL Server and ISA Server. This technology is not related to the Windows installer and it is completely unsupported to convert the updates to Installer packages. Refer to the following article for support details: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://support.microsoft.com/kb/320539/en-us" target=updates&gt;Repackaging software updates to use Windows Installer is not supported&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;You may be aware that Windows Service Packs ship with an “Update.msi” package that can be used to deploy the Service Pack via Group Policy. This package simply calls the normal .exe-based install as a custom action. This is the only supported use of this package and it is not supported to create your own similar MSI wrapper for Service Packs or other updates. Apart from the one situation mentioned, deploying updates in this way is not tested by Microsoft and the results cannot be guaranteed and hence are unsupported. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 11: Do Not Repackage MSI-Based Applications&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Installer does not just copy files and registry keys to the target system. It also creates a lot of “configuration data” to help it keep track of the components, features, etc. If you use a “snapshotting” technique to repackage an MSI-based application your package will include all of this extra data, which it will treat as normal files and registry information. However, this will almost certainly lead to serious problems with the Installer, since this data is actually Installer data from another install. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 12: Modify Vendor Packages Using Transforms&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;As previously mentioned vendor may not support re-packaging their legacy packages. It is also possible that they will not support direct modification of their MSI packages either. For example, Microsoft does not support customisation of Office installations by editing the Office MSI package. &lt;BR&gt;&lt;BR&gt;The recommended (and more likely to be supported) method of modifying vendor packages is via transforms. You can create these in all major packaging tools or by using the MsiTrans.exe tool that ships with the SDK. You should also consider the use of transforms for customising your own packages. Using this technique you can have a single base package that can be deployed to a variety of clients, with customisation handled via one or more transforms. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 13: Be careful with Installer GUIDS&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Installer uses GUIDs to uniquely identify applications, packages, features, etc. &lt;BR&gt;&lt;BR&gt;For example, the ProductID is the GUID used by the Installer to distinguish one application from another. It doesn’t matter if the package or application names for two different applications are different, if the IDs are the same, the Installer is likely to become confused and you will encounter problems with installation, repair and uninstall. &lt;BR&gt;&lt;BR&gt;You &lt;I&gt;can&lt;/I&gt; use the same ProductID when a package is a newer build of an existing one, but you need to then have different PackageIDs to distinguish the application versions. &lt;BR&gt;&lt;BR&gt;If you want the packages to be upgrades of each other, then you need them to have the same UpgradeID. &lt;BR&gt;&lt;BR&gt;GUIDs should be all uppercase &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 14: Use Consistent Package Naming Conventions&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The name of the MSI package itself doesn’t really matter as far as the Installer is concerned. As Rule 13 mentions, the Installer uses GUIDs to identify packages, etc. However, while the Installer doesn’t care about the original MSI name, once it registers that name for the product, it does care. Any small and/or minor update that is issued via an MSI must use the same base package name (the source location can be different depending upon source policy, but the base package name must be the same). &lt;BR&gt;&lt;BR&gt;Also, package naming is important from a user point of view. Consistent, user-friendly naming allows the user to identify a package's contents from the name alone. For example, the following convention can be useful in a corporate environement where there may be many in-house packages available to users: &lt;BR&gt;&lt;BR&gt;&lt;I&gt;&amp;lt;Application Vendor&amp;gt;_&amp;lt;Product Name&amp;gt;_&amp;lt;Product Version&amp;gt;_&amp;lt;Department&amp;gt;.msi&lt;/I&gt; &lt;BR&gt;&lt;BR&gt;Following this, a repackaged version of Adobe &lt;I&gt;Acrobat Reader v7.1&lt;/I&gt; available to all users would be named: &lt;BR&gt;&lt;BR&gt;&lt;I&gt;Adobe_AcrobatReader_71_ALL.msi&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 15: Do Not Try to Replace Protected System Files&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Since the release of Windows 2000, Windows has shipped with &lt;I&gt;Windows File Protection (WFP)&lt;/I&gt;, a mechanism for monitoring and restoring system files that have been renamed, deleted, etc. &lt;BR&gt;&lt;BR&gt;The Installer has no mechanism for by-passing WFP and if your package attempts to replace a protected file, the installation may not give the expected result. For the sake of application compatibility, the install does not fail if it is unable to update a WFP file. Instead, an entry is written to the application event log. However, it is important to note that the application may not be using the intended version of the file. &lt;BR&gt;&lt;BR&gt;Do not be tempted to work around this by using a custom action or other means. WFP will roll-back any changes you make. In any case, even if you managed to force your changes onto the system replacing protected files is simply unsupported by any means except Microsoft-approved methods. For example, by installing a Service Pack. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 16: Follow Component Rules&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Components are a very important part of the Installer technology. They are the means whereby the Installer manages the resources that make up your application. The SDK provides the following guidelines for creating components in your package: &lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Never create two components that install a resource under the same name and target location&lt;/B&gt;. If a resource must be duplicated in multiple components, change its name or target location in each component. This rule should be applied across applications, products, product versions, and companies. 
&lt;LI&gt;&lt;B&gt;Two components must not have the same key path file&lt;/B&gt;. This is a consequence of the previous rule. The key path value points to a particular file or folder belonging to the component that the installer uses to detect the component. If two components had the same key path file, the installer would be unable to distinguish which component is installed. Two components however may share a key path folder. 
&lt;LI&gt;&lt;B&gt;Do not create a version of a component that is incompatible with all previous versions of the component&lt;/B&gt;. This rule should be applied across applications, products, product versions, and companies. 
&lt;LI&gt;&lt;B&gt;Do not create components containing resources that will need to be installed into more than one directory on the user’s system&lt;/B&gt;. The installer installs all of the resources in a component into the same directory. It is not possible to install some resources into subdirectories. 
&lt;LI&gt;&lt;B&gt;Do not include more than one COM server per component&lt;/B&gt;. If a component contains a COM server, this must be the key path for the component. 
&lt;LI&gt;&lt;B&gt;Do not specify more than one file per component as a target for the Start menu or a Desktop shortcut&lt;/B&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 17: Understand File Versioning Rules&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Installer has strict rules that it follows when determining whether to replace an existing file or not. File version, timestamp and language are all used to determine what to do in most cases. It is particularly important to understand what happens with unversioned files. Generally, these are treated as user data, and if any modification has taken place since the original install the Installer will not over-write. &lt;BR&gt;&lt;BR&gt;Refer to the SDK for full details of the versioning rules. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 18: Improve Performance by Limiting System Restore During Setup&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;In a corporate environment where re-imaging or some other technique may be the preferred method for workstation recovery, and System Restore is never used, the additional time and disk space required to create the System Restore Points is essentially wasted. Turning it off for Installer activity will improve performance. &lt;BR&gt;&lt;BR&gt;You can turn off System Restore snapshots for installation using this per-machine policy setting: &lt;BR&gt;&lt;BR&gt;&lt;I&gt;HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer&lt;BR&gt;LimitSystemRestoreCheckpointing = 1&lt;/I&gt; &lt;BR&gt;&lt;BR&gt;This setting is affects only Installer-initiated restore activity and is available in Group Policy to aid its deployment to workstations. &lt;BR&gt;&lt;BR&gt;Note that System Restore is a very important feature of Windows and in most circumstances it is recommended that you do not switch it off, so this rule is only applicable for corporate scenarios where this feature is not used. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 19: Avoid Using the SelfReg Table&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Using the self-registering capabilities of certain DLLs is highly discouraged. Any activity performed by the self-registration (e.g. addition of registry entries) is out of the control of the Installer, so cannot be part of advertisement, repair and is not removed on uninstall. Instead you should have the Installer manage the data for you by using the appropriate tables in the MSI database. &lt;BR&gt;&lt;BR&gt;Some problems and limitations associated with self registration are: &lt;BR&gt;
&lt;UL&gt;&lt;LI.ROLLBACK li application.&lt; or feature another by used are keys self-registered the if telling of way no is there because DllUnregisterServer using done safely be cannot modules with installation an&gt;
&lt;LI&gt;The ability to use advertisement is reduced if class or extension server registration is performed within self-registration routines. 
&lt;LI&gt;The installer automatically handles HKCR keys in the registry tables for both per-user and per-machine installations. DllRegisterServer routines currently do not support the notion of a per-user HKCR key. 
&lt;LI&gt;If multiple users are using a self-registered application on the same computer, each user must install the application the first time they run it. Otherwise the installer cannot easily determine that the proper HKCU registry keys exist. 
&lt;LI&gt;The DllRegisterServer can be denied access to network resources such as type libraries if a component is both specified as run-from-source and is listed in the SelfReg table. This can cause the installation of the component to fail to during an administrative installation. 
&lt;LI&gt;Self-registering DLLs are more susceptible to coding errors because the new code required for DllRegisterServer is commonly different for each DLL. Instead use the registry tables in the database to take advantage of existing code provided by the installer. 
&lt;LI&gt;Self-registering DLLs can sometimes link to auxiliary DLLs that are not present or are the wrong version. In contrast, the installer can register the DLLs using the registry tables with no dependency on the current state of the system.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 20: Avoid Nested Installs&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;A nested installation action installs another Windows Installer package during a currently running installation. This is typically used to install some pre-requisite component(s) for the main application. &lt;BR&gt;&lt;BR&gt;Nested installs are deprecated and highly discouraged. Below are some of the limitations and problems associated with nested installs: &lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;Concurrent installations cannot share components. 
&lt;LI&gt;An administrative installation cannot also contain a concurrent installation. 
&lt;LI&gt;Patching and upgrading may not work with concurrent installations. The installer may not properly cost a concurrent installation. 
&lt;LI&gt;Integrated ProgressBars cannot be used with concurrent installations. 
&lt;LI&gt;Resources that are to be advertised cannot be installed by the concurrent installation. 
&lt;LI&gt;Nested installations live under the context of the parent product and do not appear in the &lt;I&gt;Add or Remove Programs&lt;/I&gt; Control Panel applet. Therefore uninstall of the parent product is the only way to uninstall a nested install. 
&lt;LI&gt;A package that performs a concurrent installation of an application should also uninstall the concurrent application when the parent product is uninstalled.&lt;/LI&gt;&lt;/UL&gt;The recommendation would be to use the bootstrap executable wrapper to install the MSI packages one after another. Each individual MSI would therefore be serviceable and can be treated independently. &lt;BR&gt;&lt;BR&gt;The caveat to the bootstrap is that it can make deployment difficult. Group Policy deployment doesn’t have a concept of ordered dependencies in deployment of installation packages so if order is important you may not be as successful using this technique. This is especially problematic with low rights users since ZAP files do not allow for elevated installations. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 21: Avoid Using Configuration Data You Don’t Own&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;As part of the initial design for the Installer, the consistency of installations was achieved via Microsoft taking ownership of the code for the install engine. This includes the location and format of all configuration data. This data is managed by the Installer and direct access by users or applications is discouraged; in fact some of the data is encoded to make it very difficult to manipulate manually. &lt;BR&gt;&lt;BR&gt;You should not try to peek directly into Windows Installer configuration information. Instead, use the Windows Installer API to get the information you need. Accessing the data this way ensures that your package or application will continue to work even if the underlying configuration data changes location or format. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 22: Differentiate Between User and Application Data&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;All user registration data should be written to the HKEY_CURRENT_USER hive and application data to the HKEY_LOCAL_MACHINE hive. &lt;BR&gt;&lt;BR&gt;Also, your package should avoid over-writing user data during install, repair, etc. The user doesn’t want to have to re-configure their user-specific application settings after they repair the application. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 23: Don’t Use Resources You are Installing&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;It is generally not a good practice to rely on the installation of certain non-critical resources. For example, a custom action that relies on the installation of a file that is part of an advertisable feature might fail when a user chooses to advertise the feature. &lt;BR&gt;&lt;BR&gt;Another typical scenario is a custom action sequenced ahead of InstallFinalize that uses methods exposed by an assembly that your setup is installing. Since assemblies are not committed to the GAC until towards the end of InstallFinalize, you can not use them until after that point. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 24: Use Cabinet Files to Reduce Package Sizes&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Installer allows for packages to contain compressed and uncompressed source files. Compressing the files and storing them in a cabinet (.cab) file reduces the size of the package. The Installer allows the .cab file to be stored as a separate external file, or as a data stream in the MSI package itself. &lt;BR&gt;&lt;BR&gt;Note that for extremely large packages (i.e. with more than 32767 files), you must alter the schema to increase the number of files allowed. The steps to do this are documented in the SDK. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 25: Follow Custom Action Rules&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Custom actions allow for great flexibility in package installation, but are often the source of problems. The following are some simple rules to help get the best from your custom actions: 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Do not initiate a System Restore snapshot from a custom action&lt;/B&gt;. Even if you want System Restore to operate during installs, you should not attempt to create a restore point yourself from a custom action. Such a snapshot will contain whatever partial changes that have taken place up to that point and restoring the system to this time would leave the system in an unknown state. At the least your application is likely to be non-functional, at worst the system could be unstable. 
&lt;LI&gt;&lt;B&gt;Log the Activity of Your Custom Actions&lt;/B&gt;. As is mentioned in several Rules, the Installer supports very detailed logging of its activities. However, the code inside your custom actions is hidden from the Installer, so it has no way to log what you're doing. Using either the Win32 API or the COM interface it is straightforward for your custom actions to log information about their activities, making it much easier to troubleshoot in the event of a problem. 
&lt;LI&gt;&lt;B&gt;Write a rollback custom action for every deferred custom action&lt;/B&gt;. Although custom actions that schedule system operations by inserting rows into database table are reversed by a rollback of the installation, custom actions that change the system directly, or that issue commands to other system services, cannot always be reversed by a rollback. You should write your own rollback custom action to take care of removing these changes. 
&lt;LI&gt;&lt;B&gt;Ensure that your impersonated custom action runs fine as a non-administrator account&lt;/B&gt;. This applies to all aspects of your package really, but it is easy to overlook in your own custom code. If you intend low-rights users to install your package then ensure that you test for this scenario. 
&lt;LI&gt;&lt;B&gt;Avoid using script custom actions for doing non-trivial setup actions&lt;/B&gt;. Scripted actions are easy to write, but are usually hard to maintain. 
&lt;LI&gt;&lt;B&gt;Think of ways to make your custom actions declarative&lt;/B&gt;. For example, use a custom tables to hold details of registry entries and files your custom action manipulates. Have your custom action read from these tables as it updates the system. This will give system administrators installing your package a better idea what your custom action is doing. 
&lt;LI&gt;&lt;B&gt;Do not show dialogue boxes from custom actions&lt;/B&gt;. Use MsiProcessMessage to send messages to the installer service that will decide on how to handle the message based on the UI level and other constraints. This is a much more scalable approach. 
&lt;LI&gt;&lt;B&gt;Be careful when calling Installer functions from a custom action&lt;/B&gt;. Calling certain functions - such as MsiUseFeature, MsiConfigureProduct, MsiApplyPatch, etc - will almost certainly lead to problems. Refer to the SDK for a &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/functions_not_for_use_in_custom_actions.asp" target=calist&gt;full list&lt;/A&gt; of these functions. 
&lt;LI&gt;&lt;B&gt;Do not change the system state from an immediate custom action&lt;/B&gt;. You should not attempt to use an immediate execution custom action to change the system state, because every custom action that changes the state needs to have a corresponding rollback custom action to undo the system state change on an installation rollback. All rollback custom actions are also deferred custom actions and must precede the action they undo&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 26: Consider Storing User-specific Data in a File&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Many applications store customisation data in the user’s registry on first use, and when the user is not logged on this data is stored in the user's .dat registry file on disk. &lt;BR&gt;&lt;BR&gt;This is all fairly standard, but a problem can arise if the application is removed when the user is not logged on - the data is inaccessible to the Installer and the application and so is effectively orphaned. This breaks the idea of having a clean uninstall. &lt;BR&gt;&lt;BR&gt;To work around this, you can store these setting in a file on disk, which will always be available during uninstall, or at least is very easy for the user to delete later themselves.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;This can be a simple text file, or, if you want to keep up with current trends, an XML file. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 27: Consider Maintaining Setup in Text File Format&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Many authoring tools such as the &lt;A href="http://wix.sourceforge.net/" target=wix&gt;WiX toolkit&lt;/A&gt; now have underlying formats that permit building from text files. This makes viewing setup changes a lot easier and may be somewhat more intuitive for developers already used to dealing with version-controlled text files when writing application code. &lt;BR&gt;&lt;BR&gt;WiX is free and gives you the ability to stay very close to the Windows Installer technology without having to worry about every tiny detail (such as keeping foreign keys cased correctly). &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 28: Think about Localisation&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;What if your package is English and a user in China installs it onto a Chinese system? In order to anticipate and cope with such situations learn about Installer properties like ProductLAnguage, Template Summary information property, code pages of the database and summary information for the package. &lt;BR&gt;&lt;BR&gt;You should prepare for localization when authoring the original installation package. Design the layout of localised files such that different language versions can safely coexist when installed on the user’s computer. Organise files requiring localization into separate components and install these files into separate directories. &lt;/BLOCKQUOTE&gt;&lt;B&gt;Rule 29: Follow the Assembly Rules&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The Installer can install, remove and update Win32 and .NET assemblies, including side-by-side and private assemblies in Windows XP. To avoid common problems, follow these rules when using assemblies: &lt;BR&gt;&lt;BR&gt;General: 
&lt;UL&gt;
&lt;LI&gt;A component should contain no more than one assembly 
&lt;LI&gt;All of the files in an assembly should be in a single component 
&lt;LI&gt;Each component that contains an assembly should have an entry in the MsiAssembly table 
&lt;LI&gt;The strong assembly cache name of each assembly should be authored into the MsiAssemblyName table 
&lt;LI&gt;Use the Registry table instead of the Class table when you register COM Interop for an assembly 
&lt;LI&gt;Assemblies that have the same strong name are the same assembly. When the same assembly is installed by different applications, the components that contain the assembly should use the same value for the ComponentId in their Component tables&lt;/LI&gt;&lt;/UL&gt;Win32 Assemblies: 
&lt;UL&gt;
&lt;LI&gt;Do not use the manifest file or the catalogue file as the KeyPath in the Component table for the component containing the Win32 assembly 
&lt;LI&gt;The KeyPath value in the Component table for a component that contains a Win32 policy assembly should be Null. 
&lt;LI&gt;Add a row to the MsiAssemblyName table for each name and value pair that are listed in the &amp;lt;assemblyIdentity&amp;gt; section of the Win32 assembly's manifest&lt;/LI&gt;&lt;/UL&gt;.NET Assemblies: 
&lt;UL&gt;
&lt;LI&gt;The KeyPath value in the Component table for a component that contains the assembly should not be Null 
&lt;LI&gt;When you install an assembly used by the common language runtime to the global assembly cache, the value in the File_Application column of the MsiAssembly table must be Null 
&lt;LI&gt;Add a row to the MsiAssemblyName table for each attribute of the assembly's strong name. All assemblies must have the Name, Version, and Culture attributes that are specified in the MsiAssemblyName table. A publicKeyToken attribute is required for a global assembly&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=595950" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Tao of the Windows Installer, Part 1</title><link>http://blogs.msdn.com/windows_installer_team/archive/2006/05/01/587990.aspx</link><pubDate>Tue, 02 May 2006 02:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:587990</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>25</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/587990.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=587990</wfw:commentRss><description>&lt;BR&gt;Ever agreed to something you thought was a quick favour, just to see it balloon into a massive project? &lt;BR&gt;&lt;BR&gt;Well, towards the end of last year a customer asked me for a list of "best practices" for the Installer. Being helpful, I agreed to send one and started looking for a list. Now, as the Installer was released last millenium, I assumed that someone would have created such a list by now and my search would be short. How wrong I was. &lt;BR&gt;&lt;BR&gt;After much hunting, I couldn't find any document solely devoted to Installer best practices. Sure, there are recommendations and advice scattered around various sources - from my own experience and that of other Installer users in Microsoft to white papers and the SDK - but nothing dedicated to giving straight advice on what to do and what not to do with the Installer. &lt;BR&gt;&lt;BR&gt;Having agreed to provide the list, I had to get one somewhere, so I decided to create my own from the many individual bits and pieces I gathered in my search. This is where things just seemed to take on a life of their own. I had envisioned a short (1-2 page) list, but some months later ended up with a 30+ page document! &lt;BR&gt;&lt;BR&gt;Once I had this in reasonable shape, someone pointed out that it would probably be useful to the whole Installer community and not just one customer. So here it is - or at least here is the first part. &lt;BR&gt;&lt;BR&gt;I initially looked into publishing the list as a white paper for download from the Microsoft web site. Unfortunately, the process of editing and reviewing white papers can take a while, so I decided to post here on the Installer blog first. Mainly so that the information can be made available quicker, but also just as importantly, so &lt;I&gt;you&lt;/I&gt; can give some feedback to help improve the final white paper. &lt;BR&gt;&lt;BR&gt;The paper is currently divided into various section, including a brief description of Installer functionality, troubleshooting advice, etc. However, the bulk of it is a series of "rules" (that is, the "best practices"), split into the following subtopics: 
&lt;UL&gt;
&lt;LI&gt;Fundamentals 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx"&gt;Packaging&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/05/24/605835.aspx"&gt;Deployment &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/06/27/648447.aspx"&gt;Patching &lt;/A&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/windows_installer_team/archive/2006/07/28/681358.aspx"&gt;Testing and Support&lt;/A&gt; 
&lt;LI&gt;&lt;a href="http://blogs.msdn.com/windows_installer_team/archive/2006/09/18/761223.aspx"&gt;Security Considerations&lt;/a&gt;&lt;/LI&gt;&lt;/UL&gt;This week, I'll cover the short &lt;I&gt;Fundamentals&lt;/I&gt; section, with the other sections following on an approximately weekly schedule. Feel free to point out the good, bad and ugly in the list - your feedback will make sure that the final whitepaper will be as accurate and as useful as possible. &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=lightgrey&gt;&lt;FONT face=arial color=slategray size=5&gt;&lt;B&gt;Fundamentals&lt;/B&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;FONT face=arial size=2&gt;&lt;B&gt;Rule 1: Learn the Windows Installer Technology&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The importance of this rule cannot be overstated. If you only follow one rule, this is the one to choose. &lt;BR&gt;&lt;BR&gt;Microsoft Product Support often speak to Installer users who are installing packages which they created with a sophisticated high-level re-packaging tool, without any understanding of how the Installer actually works. While these tools are excellent at what they do and they abstract the user from the details on a day-to-day basis, the lack of Installer knowledge becomes a real problem when the package does not work as expected. Setup authoring is not simply about copying files. The Installer offers extensive functionality and complexity; understand it before you start authoring packages. &lt;BR&gt;&lt;BR&gt;Start with this guide, then read the white papers, books, etc mentioned in the Resources section, then follow Rule 2. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 2: Know Your Way Around the Installer SDK&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The best resource to help with Rule 1 is the Windows Installer SDK (usually just called “the SDK”). It is the definitive guide to the Installer technology and covers all aspects of creating packages, including detailed descriptions of database tables, properties, custom actions, etc. &lt;BR&gt;&lt;BR&gt;The SDK is designed as a reference and so you shouldn’t try to read it from start to finish. However, it does contain many tutorials and specific examples you may want to follow and try out for yourself. In any case, you should make yourself familiar with its contents and use it as your first port of call when you need to know something about the Installer. &lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 3: Use the “Windows Logo” Program as a Basis For Good Practices&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;The "Designed for Windows XP" Logo Program is designed to help give users confidence in the software and hardware they buy to work with Windows. The logo ensures that any software conforms to a Microsoft-defined set of criteria that are designed to provide a consistent, high quality software experience. So, even if you do not intend to submit your application to the logo program, you can still use the guidelines to help make your Installer packages better. &lt;BR&gt;&lt;BR&gt;Many of the logo requirements for software are covered if you use the Installer as your installation mechanism. Some of these rules are shown below, with more details available on the &lt;A href="http://www.microsoft.com/winlogo/software/default.mspx" target=logo&gt;logo program website&lt;/A&gt;. 
&lt;UL&gt;
&lt;LI&gt;Do not attempt to replace files that are protected by Windows File Protection 
&lt;LI&gt;Migrate from earlier versions of Windows 
&lt;LI&gt;Do not overwrite non-proprietary files with older versions 
&lt;LI&gt;Do not require a reboot inappropriately 
&lt;LI&gt;Install to Program Files by default 
&lt;LI&gt;Install any shared files that are not side-by-side to the correct locations 
&lt;LI&gt;Support Add or Remove Programs properly 
&lt;LI&gt;Support “All Users” installs 
&lt;LI&gt;Support Autorun for CDs and DVDs &lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 4: Always Use the Latest Version of the Installer&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Using the latest version of the Installer gives three important benefits: 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Extra features&lt;/B&gt;. Version 3.1 is the Installer version at the time of writing. This contains many new and enhanced features over earlier editions. In particular, from version 3.0 of the Installer, patching and patch management was greatly improved. 
&lt;LI&gt;&lt;B&gt;Bug fixes&lt;/B&gt;. Using the latest code, and keeping this patched with current updates from Microsoft Update, ensures that you are more secure and will avoid known problems. 
&lt;LI&gt;&lt;B&gt;Support&lt;/B&gt;. Microsoft does not support or issue bugfixes for older Installer versions, such as v1.1. Always using the latest version means that Microsoft Product Support will be able to assist with problems and supply updates and patches. &lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 5: Build Setup Into Your Application Development from the Start&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;Installation absolutely should not be an afterthought in the development process. Many developers don’t like the idea that “setup” should influence the design of a product, but when using the Installer it is crucial to develop the two in parallel. &lt;BR&gt;&lt;BR&gt;Thinking up-front about how an application will be installed makes it easier to take advantage of the idea of “features”, “self-repair”, etc. So, rather than forcing the software into some artificial split or limiting very large applications to a single feature, you will end up with a more user-friendly and resilient install. &lt;BR&gt;&lt;BR&gt;Remember that: 
&lt;UL&gt;
&lt;LI&gt;The developer writing the code knows better on what, how and where the configuration data for thier application/module should be 
&lt;LI&gt;It is better to grow the stability and confidence of the product setup along with the confidence in the product itself: a poor product setup will leave lasting bitterness with the user &lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;B&gt;Rule 6: Get to Know ORCA&lt;/B&gt; 
&lt;BLOCKQUOTE&gt;ORCA is an MSI package editing tool that ships with the Installer SDK. It has a basic GUI interface but supports advanced editing of Installer Databases. It is possible to create a new package completely with ORCA, but this would be very tedious and error prone; equivalent to writing the Microsoft.com website in Notepad - possible, but not something you’d really want to do. &lt;BR&gt;&lt;BR&gt;Where ORCA excels is in letting you quickly view and edit package contents for troubleshooting and testing. This reason alone should be enough reason to become familiar with using ORCA, but it also provides a convenient way to validate your packages - a vital step during package creation and testing. &lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT color=#969696 size=1&gt;[Author: Richard Macdonald]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=587990" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item><item><title>Best Practice Guidelines for Building Quality Installs: Part 0, the Introduction</title><link>http://blogs.msdn.com/windows_installer_team/archive/2005/09/27/463649.aspx</link><pubDate>Tue, 27 Sep 2005 06:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463649</guid><dc:creator>Windows Installer Team</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/windows_installer_team/comments/463649.aspx</comments><wfw:commentRss>http://blogs.msdn.com/windows_installer_team/commentrss.aspx?PostID=463649</wfw:commentRss><description>&lt;P&gt;With the start of the &lt;A href="http://go.microsoft.com/?linkid=3187976"&gt;&lt;FONT color=#0066cc&gt;Profesional Developers Conference 2005&lt;/FONT&gt;&lt;/A&gt;, the &lt;a href="http://blogs.msdn.com/windows_installer_team"&gt;&lt;FONT color=#0066cc&gt;Windows Installer Team&lt;/FONT&gt;&lt;/A&gt; is starting a series of &lt;a href="http://blogs.msdn.com/windows_installer_team/archive/category/10860.aspx"&gt;&lt;FONT color=#0066cc&gt;Best Practice Guidelines for Building Quality Installs&lt;/FONT&gt;&lt;/A&gt;. &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/windows_installer_start_page.asp"&gt;&lt;FONT color=#0066cc&gt;Windows Installer (MSI)&lt;/FONT&gt;&lt;/A&gt; is a rich engine with many &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/about_windows_installer.asp"&gt;&lt;FONT color=#0066cc&gt;features&lt;/FONT&gt;&lt;/A&gt; to solve installation problems including an &lt;SPAN lang=EN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;extensibility&lt;/SPAN&gt; feature called &lt;A href="http://msdn.microsoft.com/library/en-us/msi/setup/custom_actions.asp"&gt;&lt;FONT color=#0066cc&gt;custom actions&lt;/FONT&gt;&lt;/A&gt;. Given all the freedom provided when composing packages, package producers and consumers both need a reference with guidelines for quality packages.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Customer Value&lt;/I&gt;&lt;/B&gt;: Some package producers report getting lost in the Windows Installer (MSI) feature set and ask for guidance to do the right thing while saving time. Some package consumers report back to us the common problem they find they are provided and ask us for help in getting the package producers to do the right thing.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Testability&lt;/I&gt;&lt;/B&gt;: How do package producers and consumers arrive at the same interpretation of a best practice? With each Best Practice we'll include a testability component to provide neutral guidance on whether a package conforms.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Complementary Infrastructure&lt;/I&gt;&lt;/B&gt;: For the sake of the exercise, we're assuming there is both a declaration file called a Vendor Questionnaire that is provided by the package provider and a report file called a Compliance Report that is provided by the package consumer. We're also assuming one has a tool that snapshots the system and can difference two snapshots.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Quality Accountability Model&lt;/I&gt;&lt;/B&gt;: It is expected that a package provider would declare any variation from a best practice in the Vendor Questionnaire. It is expected that a package consumer would report any variation from a best practice in the Compliance Report. With this &lt;SPAN lang=EN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;transparency&lt;/SPAN&gt;, the consumer if fully informed as to the qualities of the software one is considering consuming and if either the declared qualities or declarations are missing, a fair upfront discussion can occur between provider and consumer.&lt;/P&gt;
&lt;P&gt;We welcome your feedback. Please let us know if there are areas you are particularly interested in.&lt;/P&gt;
&lt;DIV id=CSBloggerSig&gt;
&lt;DIV&gt;&lt;FONT face=Verdana color=#969696 size=2&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=#969696&gt;&lt;FONT size=1&gt;[Author: &lt;/FONT&gt;&lt;a href="http://blogs.msdn.com/rflaming"&gt;&lt;FONT size=1&gt;Robert Flaming&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=1&gt;]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;FONT size=1&gt;http://www.microsoft.com/info/cpyright.htm&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=1&gt;.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=463649" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/PDC2005/default.aspx">PDC2005</category><category domain="http://blogs.msdn.com/windows_installer_team/archive/tags/Best+Practice+Guidelines/default.aspx">Best Practice Guidelines</category></item></channel></rss>