{"id":2163,"date":"2006-06-21T17:35:00","date_gmt":"2006-06-21T17:35:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2006\/06\/21\/find-the-product\/"},"modified":"2006-06-21T17:35:00","modified_gmt":"2006-06-21T17:35:00","slug":"find-the-product","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/find-the-product\/","title":{"rendered":"Find the Product"},"content":{"rendered":"<p>The Windows SDK Team\n<a href=\"http:\/\/blogs.msdn.com\/windowssdk\/archive\/2006\/06\/20\/640172.aspx\">\ninstructs<\/a> users how to uninstall older Platform SDK installations without\nthe original source installation media. As part of their instructions, they\nwrite,<\/p>\n<blockquote>\n<p>RemoveProgram FilesMicrosoft SDK folder<br \/>\n\tThis is the painful part:<br \/>\n\tFind all .msi that are releated to the February 2003 release in<br \/>\n\t%windir%installer<br \/>\n\tfrom the cmd line you can run msiexec.exe -x nameofmsi.msi<\/p>\n<\/blockquote>\n<p>There are a few ways of doing this. You could navigate to <i>%WINDIR%Installer<\/i>\nin Windows Explorer &#8211; a hidden folder for good reason &#8211; and add both the Title\nand Comments columns to the detail view (since some package misuse the\n<a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/title_summary.asp\">\nTitle Summary Property<\/a> for a description of what their package installs).\nYou could then scan the descriptions to find the right package.<\/p>\n<p>Take note, however, that <i>%WINDIR%Installer<\/i> is a hidden folder because\nit is not meant for general access, and is maintained by Windows Installer and\ncould change without warning since it is not officially documented. In general\nyou should not be in this folder, and even if you&#8217;re simply curious be very\ncareful about what you do.<\/p>\n<p>The Windows Installer programming interfaces provide you with everything you\nneed to access the product. If you know the ProductCode you could call the <code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msiopenproduct.asp\">\nMsiOpenProduct<\/a><\/code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msiopenproduct.asp\">\nfunction<\/a> to get a handle to the product, then call the <code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msigetactivedatabase.asp\">\nMsiGetActiveDatabase<\/a><\/code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msigetactivedatabase.asp\">\nfunction<\/a> to get a handle to the database without knowing the path, and from\nthat query tables or do anything else. Using these functions,\n<a href=\"http:\/\/blogs.msdn.com\/heaths\/archive\/2005\/09\/12\/464047.aspx\">patches<\/a>\nare even brought into view unless you call the\n<a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msiopenpackageex.asp\"><code>MsiOpenPackageEx<\/code>\nfunction<\/a> with <code>dwOptions<\/code> set to include <code>MSIOPENPACKAGEFLAGS_IGNOREMACHINESTATE<\/code>\n(1).<\/p>\n<p>You can also pass the ProductCode to &#8220;msiexec -x {ProductCode}&#8221; instead of\nusing the package path.<\/p>\n<p>Without accessing the <i>%WINDIR%Installer<\/i> directory then, or assuming\nthat some package comments are not easily identifiable, how can you find the\nProductCode or even the\n<a href=\"http:\/\/blogs.msdn.com\/heaths\/archive\/2005\/11\/29\/498018.aspx\">locally\ncached<\/a> product package? You can use the <code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msienumproducts.asp\">\nMsiEnumProducts<\/a><\/code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msienumproducts.asp\">\nfunction<\/a>, and for each result call the <code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msigetproductinfo.asp\">\nMsiGetProductInfo<\/a><\/code><a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msigetproductinfo.asp\">\nfunction<\/a> to fetch common properties like the ProductCode, ProductName,\nProductVersion, and more &#8211; even the local cache location if you just want to,\nfor example, view the <i>.msi<\/i> file in Orca.<\/p>\n<p>I have posted a simple\n<a href=\"http:\/\/hstewart.members.winisp.net\/downloads\/findprod.zip\">example<\/a>\nshowing how to do this, as well as the binary since this could be a useful tool\nfor those not interested in the source. This sample is not supported by\nMicrosoft so use it at your own risk, but feel free to post comments or\nquestions here.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Windows SDK Team instructs users how to uninstall older Platform SDK installations without the original source installation media. As part of their instructions, they write, RemoveProgram FilesMicrosoft SDK folder This is the painful part: Find all .msi that are releated to the February 2003 release in %windir%installer from the cmd line you can run [&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":[14,20],"class_list":["post-2163","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-development","tag-installation"],"acf":[],"blog_post_summary":"<p>The Windows SDK Team instructs users how to uninstall older Platform SDK installations without the original source installation media. As part of their instructions, they write, RemoveProgram FilesMicrosoft SDK folder This is the painful part: Find all .msi that are releated to the February 2003 release in %windir%installer from the cmd line you can run [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2163","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=2163"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2163\/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=2163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=2163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=2163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}