{"id":1249,"date":"2017-12-04T05:51:41","date_gmt":"2017-12-04T05:51:41","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1249"},"modified":"2021-02-27T09:34:33","modified_gmt":"2021-02-27T09:34:33","slug":"quick-launch-shortcut-in-vista-and-windows-7","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/","title":{"rendered":"Quick Launch shortcut in Vista and Windows 7"},"content":{"rendered":"<p><strong>InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7<\/strong><br \/>\nThe right substitute for Vista\/XP like Quick Launch shortcut is to make the link pinned to the taskbar (IMO).<br \/>\n><br \/>\n> It appears as simple as putting the shortcut in User Pinned\\TaskBar subfolder of Quick Launch folder in Windows 7.<br \/>\n><br \/>\n>      <!-- Quick Launch per-user folder --><br \/>\n>      <Directory Id=\"QL1\" SourceName=\"Application Data\"><br \/>\n>        <Directory Id=\"QL2\" Name=\"Microsoft\"><br \/>\n>          <Directory Id=\"QL3\" Name=\"Internet Explorer\"><br \/>\n>            <Directory Id=\"QL4\" Name=\"Quick Launch\" \/><br \/>\n>        <Directory Id=\"QL5\" Name=\"User Pinned\" \/><br \/>\n>                <Directory Id=\"QL6\" Name=\"TaskBar\" \/><br \/>\n>                <\/Directory><br \/>\n>              <\/Directory><br \/>\n>            <\/Directory><br \/>\n>        <\/Directory><br \/>\n><br \/>\n> Now, I can condition the installation of the component containing the Shortcut element.<br \/>\n> When OS is Windows 7 shortcut gets created in QL6 directory, otherwise in QL4.<br \/>\n><br \/>\n> Since this would unnecessarily create User Pinned\\TaskBar folders on Vista and XP, does anybody know if there is a more elegant way to accomplish the same goal?<\/p>\n<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7<\/strong><br \/>\nTony, how do you catch the case, that your user only can install applications elevated as administrator (don&#8217;t assume everybody is admin on his\/her machine)? Wouldn&#8217;t the quick launch shortcut then only appear on the administrator&#8217;s quick launch bar and hence is invisible for the normal user(s)?<\/p>\n<p>Tom<\/p>\n<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7<\/strong><br \/>\nBecause of various other factors, I require from users to have admin rights when installing and running the app. So this is not a problem for me (at least not for now).<\/p>\n<p>But you don&#8217;t have to be admin to install the application. Administrator can approve of certain MSI to be installed by non-elevated users on his network and MSI takes care of elevating the rights so that, for example, folders and files can be created in Program Files.<\/p>\n<p>I tested this scenario once: I allowed all users on my machine to run MSI and as non-elevated user I had no problem installing the app. I had problems running it because some of installed apps write to Program Files subfolders, but that&#8217;s another issue.<\/p>\n<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7<\/strong><br \/>\nI am not sure if I understood the question well and if my previous response makes sense. But this is how would I try doing it if I had to do it and if WiX didn&#8217;t let me do declaratively:<\/p>\n<p>Even if MSI (or more correctly parts of install) run with elevated privileges, I think that immediate custom action runs non-elevated and I can find current user&#8217;s ApplicationData folder via Shell API call GetSpecialFolder. I can then create shortcut links programmatically in custom action code as seen below (I don&#8217;t know where I got it from, probably some MSDN article).<\/p>\n<p>\/\/<br \/>\n\/\/<br \/>\n\/\/ CreateLink &#8211; uses the Shell&#8217;s IShellLink and IPersistFile interfaces<br \/>\n\/\/              to create and store a shortcut to the specified object.<br \/>\n\/\/<br \/>\n\/\/ Returns the result of calling the member functions of the interfaces.<br \/>\n\/\/<br \/>\n\/\/ Parameters:<br \/>\n\/\/ lpszPathObj  &#8211; address of a buffer containing the path of the object.<br \/>\n\/\/ lpszPathLink &#8211; address of a buffer containing the path where the<br \/>\n\/\/                Shell link is to be stored.<br \/>\n\/\/ lpszDesc    &#8211; address of a buffer containing the description of the<br \/>\n\/\/                Shell link.<br \/>\n\/\/ lpszIconLink &#8211; address of a buffer containing the path where the<br \/>\n\/\/                Shell link icon can be found.<br \/>\n\/\/ index        &#8211; index of the icon<br \/>\n\/\/<\/p>\n<p>HRESULT CreateLink(LPCTSTR lpszPathObj, LPCTSTR lpszPathLink, LPCTSTR lpszDesc, LPCTSTR lpszIconLink, int index) {<br \/>\n    HRESULT hres;<br \/>\n    IShellLink* psl;<\/p>\n<p>    \/\/ Get a pointer to the IShellLink interface.<br \/>\n    hres=::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,<br \/>\n                            IID_IShellLink, (LPVOID*)&#038;psl);<br \/>\n    if(SUCCEEDED(hres))<br \/>\n    {<br \/>\n        IPersistFile* ppf;<\/p>\n<p>        \/\/ Set the path to the shortcut target and add the description.<br \/>\n        psl->SetPath(lpszPathObj);<br \/>\n        psl->SetDescription(lpszDesc);<br \/>\n        if(lpszIconLink!=0)<br \/>\n            psl->SetIconLocation(lpszIconLink, index);<\/p>\n<p>        \/\/ Query IShellLink for the IPersistFile interface for saving the<br \/>\n        \/\/ shortcut in persistent storage.<br \/>\n        hres=psl->QueryInterface(IID_IPersistFile, (LPVOID*)&#038;ppf);<\/p>\n<p>        if(SUCCEEDED(hres))<br \/>\n        {<br \/>\n            USES_CONVERSION;<\/p>\n<p>            \/\/ Ensure that the string is Unicode.<br \/>\n            LPWSTR wsz=CT2W(lpszPathLink);<\/p>\n<p>            \/\/ Add code here to check return value from MultiByteWideChar<br \/>\n            \/\/ for success.<\/p>\n<p>            \/\/ Save the link by calling IPersistFile::Save.<br \/>\n            hres = ppf->Save(wsz, TRUE);<br \/>\n            ppf->Release();<br \/>\n        }<br \/>\n        psl->Release();<br \/>\n    }<br \/>\n    return hres;<br \/>\n}<br \/>\n<strong>InstallerGeek replied the topic: Re: Quick Launch shortcut in Vista and Windows 7<\/strong><br \/>\nThere&#8217;s no need to do that: The Shortcut table can be used to create shortcuts in any directory. And it takes care of uninstall and rollback, which your code does not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7 The right substitute for Vista\/XP like Quick Launch [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[303,304],"class_list":["post-1249","post","type-post","status-publish","format-standard","hentry","category-general","tag-vista","tag-windows-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Quick Launch shortcut in Vista and Windows 7 - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick Launch shortcut in Vista and Windows 7 - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7 The right substitute for Vista\/XP like Quick Launch [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-04T05:51:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:34:33+00:00\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Quick Launch shortcut in Vista and Windows 7\",\"datePublished\":\"2017-12-04T05:51:41+00:00\",\"dateModified\":\"2021-02-27T09:34:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/\"},\"wordCount\":698,\"commentCount\":0,\"keywords\":[\"Vista\",\"Windows 7\"],\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/\",\"name\":\"Quick Launch shortcut in Vista and Windows 7 - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-04T05:51:41+00:00\",\"dateModified\":\"2021-02-27T09:34:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/quick-launch-shortcut-in-vista-and-windows-7\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick Launch shortcut in Vista and Windows 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quick Launch shortcut in Vista and Windows 7 - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/","og_locale":"en_US","og_type":"article","og_title":"Quick Launch shortcut in Vista and Windows 7 - scmGalaxy","og_description":"InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7 The right substitute for Vista\/XP like Quick Launch [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-04T05:51:41+00:00","article_modified_time":"2021-02-27T09:34:33+00:00","author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Quick Launch shortcut in Vista and Windows 7","datePublished":"2017-12-04T05:51:41+00:00","dateModified":"2021-02-27T09:34:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/"},"wordCount":698,"commentCount":0,"keywords":["Vista","Windows 7"],"articleSection":["General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/","name":"Quick Launch shortcut in Vista and Windows 7 - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-04T05:51:41+00:00","dateModified":"2021-02-27T09:34:33+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/quick-launch-shortcut-in-vista-and-windows-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Quick Launch shortcut in Vista and Windows 7"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1249"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1249\/revisions"}],"predecessor-version":[{"id":1250,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1249\/revisions\/1250"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}