<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vista Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/vista/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/vista/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:34:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Quick Launch shortcut in Vista and Windows 7</title>
		<link>https://www.scmgalaxy.com/tutorials/quick-launch-shortcut-in-vista-and-windows-7/</link>
					<comments>https://www.scmgalaxy.com/tutorials/quick-launch-shortcut-in-vista-and-windows-7/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Mon, 04 Dec 2017 05:51:41 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=1249</guid>

					<description><![CDATA[<p>InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7 The right substitute for Vista/XP like Quick Launch [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/quick-launch-shortcut-in-vista-and-windows-7/">Quick Launch shortcut in Vista and Windows 7</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7</strong><br />
The right substitute for Vista/XP like Quick Launch shortcut is to make the link pinned to the taskbar (IMO).<br />
><br />
> It appears as simple as putting the shortcut in User Pinned\TaskBar subfolder of Quick Launch folder in Windows 7.<br />
><br />
>      <!-- Quick Launch per-user folder --><br />
>      <Directory Id="QL1" SourceName="Application Data"><br />
>        <Directory Id="QL2" Name="Microsoft"><br />
>          <Directory Id="QL3" Name="Internet Explorer"><br />
>            <Directory Id="QL4" Name="Quick Launch" /><br />
>        <Directory Id="QL5" Name="User Pinned" /><br />
>                <Directory Id="QL6" Name="TaskBar" /><br />
>                </Directory><br />
>              </Directory><br />
>            </Directory><br />
>        </Directory><br />
><br />
> Now, I can condition the installation of the component containing the Shortcut element.<br />
> When OS is Windows 7 shortcut gets created in QL6 directory, otherwise in QL4.<br />
><br />
> 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>
<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7</strong><br />
Tony, 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>
<p>Tom</p>
<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7</strong><br />
Because 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>
<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>
<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>
<p><strong>applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7</strong><br />
I 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>
<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>
<p>//<br />
//<br />
// CreateLink &#8211; uses the Shell&#8217;s IShellLink and IPersistFile interfaces<br />
//              to create and store a shortcut to the specified object.<br />
//<br />
// Returns the result of calling the member functions of the interfaces.<br />
//<br />
// Parameters:<br />
// lpszPathObj  &#8211; address of a buffer containing the path of the object.<br />
// lpszPathLink &#8211; address of a buffer containing the path where the<br />
//                Shell link is to be stored.<br />
// lpszDesc    &#8211; address of a buffer containing the description of the<br />
//                Shell link.<br />
// lpszIconLink &#8211; address of a buffer containing the path where the<br />
//                Shell link icon can be found.<br />
// index        &#8211; index of the icon<br />
//</p>
<p>HRESULT CreateLink(LPCTSTR lpszPathObj, LPCTSTR lpszPathLink, LPCTSTR lpszDesc, LPCTSTR lpszIconLink, int index) {<br />
    HRESULT hres;<br />
    IShellLink* psl;</p>
<p>    // Get a pointer to the IShellLink interface.<br />
    hres=::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,<br />
                            IID_IShellLink, (LPVOID*)&#038;psl);<br />
    if(SUCCEEDED(hres))<br />
    {<br />
        IPersistFile* ppf;</p>
<p>        // Set the path to the shortcut target and add the description.<br />
        psl->SetPath(lpszPathObj);<br />
        psl->SetDescription(lpszDesc);<br />
        if(lpszIconLink!=0)<br />
            psl->SetIconLocation(lpszIconLink, index);</p>
<p>        // Query IShellLink for the IPersistFile interface for saving the<br />
        // shortcut in persistent storage.<br />
        hres=psl->QueryInterface(IID_IPersistFile, (LPVOID*)&#038;ppf);</p>
<p>        if(SUCCEEDED(hres))<br />
        {<br />
            USES_CONVERSION;</p>
<p>            // Ensure that the string is Unicode.<br />
            LPWSTR wsz=CT2W(lpszPathLink);</p>
<p>            // Add code here to check return value from MultiByteWideChar<br />
            // for success.</p>
<p>            // Save the link by calling IPersistFile::Save.<br />
            hres = ppf->Save(wsz, TRUE);<br />
            ppf->Release();<br />
        }<br />
        psl->Release();<br />
    }<br />
    return hres;<br />
}<br />
<strong>InstallerGeek replied the topic: Re: Quick Launch shortcut in Vista and Windows 7</strong><br />
There&#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>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/quick-launch-shortcut-in-vista-and-windows-7/">Quick Launch shortcut in Vista and Windows 7</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/quick-launch-shortcut-in-vista-and-windows-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
