{"id":11523,"date":"2011-02-11T07:00:00","date_gmt":"2011-02-11T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/02\/11\/how-do-specify-that-a-shortcut-should-not-be-promoted-as-newly-installed-on-the-start-menu\/"},"modified":"2011-02-11T07:00:00","modified_gmt":"2011-02-11T07:00:00","slug":"how-do-specify-that-a-shortcut-should-not-be-promoted-as-newly-installed-on-the-start-menu","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20110211-00\/?p=11523","title":{"rendered":"How do specify that a shortcut should not be promoted as newly-installed on the Start menu?"},"content":{"rendered":"<p>\nWindows XP\n<a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2005\/11\/24\/496690.aspx\">\nemployed a number of heuristics to determine which Start menu\nshortcuts should be promoted when an application is newly-installed<\/a>.\nBut what if those heuristics end up guessing wrong?\n<\/p>\n<p>\nYou can set the\n<a HREF=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd391568(VS.85).aspx\">\n<code>System.App&shy;User&shy;Model.Exclude&shy;From&shy;Show&shy;In&shy;New&shy;Install<\/code>\nproperty<\/a>\nto <code>VARIANT_TRUE<\/code> to tell the Start menu,\n&#8220;I am not the primary entry point for the program;\nI&#8217;m a secondary shortcut, like a help file.&#8221;\n<\/p>\n<pre>\n#include &lt;windows.h&gt;\n#include &lt;tchar.h&gt;\n#include &lt;shlobj.h&gt;\n#include &lt;atlbase.h&gt;\n\/\/ <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2004\/05\/20\/135841.aspx\">class CCoInitialize<\/a> incorporated here by reference\nint __cdecl _tmain(int argc, TCHAR **argv)\n{\n \/\/ error checking elided for expository purposes\n CCoInitialize init;\n CComPtr&lt;IShellLink&gt; spsl;\n spsl.CoCreateInstance(CLSID_ShellLink);\n spsl-&gt;SetPath(TEXT(\"C:\\\\Program Files\\\\LitWare\\\\LWUpdate.exe\"));\n PROPVARIANT pvar;\n pvar.vt = VT_BOOL;\n pvar.boolVal = <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2004\/12\/22\/329884.aspx\">VARIANT_TRUE<\/a>;\n CComQIPtr&lt;IPropertyStore&gt;(spsl)-&gt;SetValue(PKEY_AppUserModel_ExcludeFromShowInNewInstall, pvar);\n CComQIPtr&lt;IPersistFile&gt;(spsl)-&gt;Save(L\"LitWare Update.lnk\", TRUE);\n return 0;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Windows XP employed a number of heuristics to determine which Start menu shortcuts should be promoted when an application is newly-installed. But what if those heuristics end up guessing wrong? You can set the System.App&shy;User&shy;Model.Exclude&shy;From&shy;Show&shy;In&shy;New&shy;Install property to VARIANT_TRUE to tell the Start menu, &#8220;I am not the primary entry point for the program; I&#8217;m a [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-11523","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Windows XP employed a number of heuristics to determine which Start menu shortcuts should be promoted when an application is newly-installed. But what if those heuristics end up guessing wrong? You can set the System.App&shy;User&shy;Model.Exclude&shy;From&shy;Show&shy;In&shy;New&shy;Install property to VARIANT_TRUE to tell the Start menu, &#8220;I am not the primary entry point for the program; I&#8217;m a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/11523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=11523"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/11523\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=11523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=11523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=11523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}