{"id":2463,"date":"2006-02-07T20:42:00","date_gmt":"2006-02-07T20:42:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2006\/02\/07\/common-controls-in-windows-installer-ui\/"},"modified":"2006-02-07T20:42:00","modified_gmt":"2006-02-07T20:42:00","slug":"common-controls-in-windows-installer-ui","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/common-controls-in-windows-installer-ui\/","title":{"rendered":"Common Controls in Windows Installer UI"},"content":{"rendered":"<p>Notice the differences between the following two dialogs from the same Windows Installer package on the same Windows XP machine.<img decoding=\"async\" src=\"\/photos\/heaths\/images\/527183\/original.aspx\" border=\"0\"><img decoding=\"async\" src=\"\/photos\/heaths\/images\/527184\/original.aspx\" border=\"0\"><\/p>\n<p>The first dialog is displayed when launching a sample <i>.msi<\/i> file using the <i>msiwai.exe<\/i> program I <a href=\"\/heaths\/archive\/2006\/01\/23\/516454.aspx\">detailed before<\/a>. The second dialog is displayed when the sample <i>.msi<\/i> file is launched from Windows Explorer, thus using the default handler, <i>msiexec.exe<\/i>. So why the difference?<\/p>\n<p>The difference between the two executable is that <i>msiexec.exe<\/i> has an embedded manifest to bind to the Common Controls 6 side-by-side native assembly, while my sample application <i>msiwai.exe<\/i> has no such manifest and, thus, uses the last Common Controls version prior to <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/sbscs\/setup\/isolated_applications_and_side_by_side_assemblies_start_page.asp\">Windows isolated application and side-by-side<\/a> (WinSxS) support introduced in Windows XP.<\/p>\n<p>If you open <i>msiexec.exe<\/i> in Visual Studio, for example, you&#8217;ll see a resource section called RT_MANIFEST. If you open the item identified as 1 as binary data you&#8217;ll see what looks like XML. When you extract it as <i>msiexec.exe.manifest<\/i> (or anything really, but the name is important for external manifests) and open it you&#8217;ll see the following:<\/p>\n<p><font face=\"courier new, monospace\"><font color=\"#0000ff\">&lt;?<\/font><font color=\"#800000\">xml<\/font><font color=\"#0000ff\"> <\/font><font color=\"#ff0000\">version<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">1.0<\/font>&#8220;<font color=\"#0000ff\"> <\/font><font color=\"#ff0000\">encoding<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">UTF-8<\/font>&#8220;<font color=\"#0000ff\"> <\/font><font color=\"#ff0000\">standalone<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">yes<\/font>&#8220;<font color=\"#0000ff\">?&gt;<br \/>&lt;!&#8211;<\/font><font color=\"#008000\"> Copyright &copy; 1981-2001 Microsoft Corporation <\/font><font color=\"#0000ff\">&#8211;&gt;<br \/>&lt;<\/font><font color=\"#800000\">assembly<\/font><font color=\"#0000ff\"> <\/font><font color=\"#ff0000\">manifestVersion<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">1.0<\/font>&#8220;<font color=\"#0000ff\"> <\/font><font color=\"#ff0000\">xmlns<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">urn:schemas-microsoft-com:asm.v1<\/font>&#8220;<font color=\"#0000ff\">&gt;<\/font><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;<font color=\"#800000\">assemblyIdentity<\/font><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">type<\/font><font color=\"#0000ff\">=<\/font>&#8220;<font color=\"#0000ff\">win32<\/font>&#8220;<\/font><font color=\"#0000ff\"><font face=\"monospace\"><br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">name<\/font>=&#8221;MSIExec&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">version<\/font>=&#8221;4.0.0.0&#8243;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">processorArchitecture<\/font>=&#8221;x86&#8243;<br \/>&nbsp;&nbsp;&nbsp; \/&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;<font color=\"#800000\">description<\/font>&gt; Windows installer setup service &lt;\/<font color=\"#800000\">description<\/font>&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;<font color=\"#800000\">dependency<\/font>&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<font color=\"#800000\">dependentAssembly<\/font>&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<font color=\"#800000\">assemblyIdentity<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><font color=\"#ff0000\">type<\/font>=&#8221;win32&#8243;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=\"#ff0000\">name<\/font>=&#8221;Microsoft.Windows.Common-Controls&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=\"#ff0000\">version<\/font>=&#8221;6.0.0.0&#8243;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">publicKeyToken<\/font>=&#8221;6595b64144ccf1df&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">language<\/font>=&#8221;*&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">processorArchitecture<\/font>=&#8221;x86&#8243;\/&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/<font color=\"#800000\">dependentAssembly<\/font>&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;\/<font color=\"#800000\">dependency<\/font>&gt;<br \/>&lt;\/<font color=\"#800000\">assembly<\/font>&gt;<\/font><\/font><\/p>\n<p>The <font face=\"courier new, monospace\" color=\"#0000ff\">&lt;<font color=\"#800000\">dependentAssembly<\/font>&gt;<\/font> causes the loader to bind to the Common Controls 6 assembly which includes the rich controls that made their debut in Windows XP. Manifests allow you to isolate applications and use different versions of libraries at the same time for different applications, even redirecting version policies much like you can with <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/cpguide\/html\/cpconside-by-sideexecution.asp\">.NET Framework side-by-side execution<\/a>. You can also use manifests for registration-free COM.<\/p>\n<p>Since my sample application wasn&#8217;t linked with a resource file originally it&#8217;s not straight-forward to add the manifest. You can, however, use similar content as that above, changing the <font face=\"courier new, monospace\" color=\"#ff0000\">name<\/font> attribute from &#8220;MSIExec&#8221; to something else like &#8220;MsiWait&#8221;, and the <font face=\"courier new, monospace\" color=\"#0000ff\">&lt;<font color=\"#800000\">description<\/font>&gt;<\/font> to something appropriate like &#8220;Bootstrap to wait for a previous installation to finish&#8221;. Save that to a file named <i>msiwait.exe.manifest<\/i> and save it in the same location as <i>msiwait.exe<\/i>. Now run <i>msiwait.exe<\/i> with a <i>.msi<\/i> file on Windows XP and newer and you&#8217;ll see a UI similar to the second dialog above.<\/p>\n<p>Since the <i>setup.exe<\/i> bootstrap application that Visual Studio creates when building a Windows Installer project (if you&#8217;ve opted to build a bootstrap application) doesn&#8217;t embed a manifest either you can use that for the next procedure.<\/p>\n<\/p>\n<ol>\n<li>In Visual Studio click on the File menu and Open.\n<\/li>\n<li>Browse to the <i>setup.exe<\/i> bootstrap application for a Windows Installer project, select it, and click Open. You should see tree view with nodes like Dialog, Icon, and Version.\n<\/li>\n<li>Right-click on the top node and select Add Resource.\n<\/li>\n<li>Click the Import button and browse to your manifest file similar to the one we created above, select it, and click Open.\n<\/li>\n<li>In the Custom Resource Type dialog enter RT_MANIFEST and click OK.\n<\/li>\n<li>Right-click on the newly created node in the tree view, select Properties, and change the ID to 1 (the manifest resource ID used by the loader for process defaults).\n<\/li>\n<li>Save the executable. <\/li>\n<\/ol>\n<p>Now when you run the bootstrap application on Windows XP or newer Common Control 6 will be loaded instead. If you are using a theme like the default Windows XP theme you&#8217;ll see a dialog similar to the second one above.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Notice the differences between the following two dialogs from the same Windows Installer package on the same Windows XP machine. The first dialog is displayed when launching a sample .msi file using the msiwai.exe program I detailed before. The second dialog is displayed when the sample .msi file is launched from Windows Explorer, thus using [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-2463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-installation"],"acf":[],"blog_post_summary":"<p>Notice the differences between the following two dialogs from the same Windows Installer package on the same Windows XP machine. The first dialog is displayed when launching a sample .msi file using the msiwai.exe program I detailed before. The second dialog is displayed when the sample .msi file is launched from Windows Explorer, thus using [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=2463"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2463\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=2463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=2463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=2463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}