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't let me do declaratively:

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's ApplicationData folder via Shell API call GetSpecialFolder. I can then 
create shortcut links programmatically in custom action code as seen below (I 
don't know where I got it from, probably some MSDN article).

//-----------------------------------------------------------------------------------------
//
// CreateLink - uses the Shell's IShellLink and IPersistFile interfaces 
//              to create and store a shortcut to the specified object. 
//
// Returns the result of calling the member functions of the interfaces. 
//
// Parameters:
// lpszPathObj  - address of a buffer containing the path of the object. 
// lpszPathLink - address of a buffer containing the path where the 
//                Shell link is to be stored. 
// lpszDesc     - address of a buffer containing the description of the 
//                Shell link. 
// lpszIconLink - address of a buffer containing the path where the 
//                Shell link icon can be found.
// index        - index of the icon
//-----------------------------------------------------------------------------------------

HRESULT CreateLink(LPCTSTR lpszPathObj, LPCTSTR lpszPathLink, LPCTSTR lpszDesc, 
LPCTSTR lpszIconLink, int index) 
{ 
    HRESULT hres; 
    IShellLink* psl; 
 
    // Get a pointer to the IShellLink interface. 
    hres=::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, 
                            IID_IShellLink, (LPVOID*)&psl); 
    if(SUCCEEDED(hres)) 
    { 
        IPersistFile* ppf; 
 
        // Set the path to the shortcut target and add the description. 
        psl->SetPath(lpszPathObj); 
        psl->SetDescription(lpszDesc); 
        if(lpszIconLink!=0)
            psl->SetIconLocation(lpszIconLink, index); 
 
        // Query IShellLink for the IPersistFile interface for saving the 
        // shortcut in persistent storage. 
        hres=psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf); 
 
        if(SUCCEEDED(hres)) 
        { 
            USES_CONVERSION;
 
            // Ensure that the string is Unicode. 
            LPWSTR wsz=CT2W(lpszPathLink); 
                        
            // Add code here to check return value from MultiByteWideChar 
            // for success.
 
            // Save the link by calling IPersistFile::Save. 
            hres = ppf->Save(wsz, TRUE); 
            ppf->Release(); 
        } 
        psl->Release(); 
    } 
    return hres; 
}

-----Original Message-----
From: Thomas Singer [mailto:w...@regnis.de] 
Sent: Wednesday, December 23, 2009 3:04 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Quick Launch shortcut in Vista and Windows 7

Tony, how do you catch the case, that your user only can install
applications elevated as administrator (don't assume everybody is admin on
his/her machine)? Wouldn't the quick launch shortcut then only appear on the
administrator's quick launch bar and hence is invisible for the normal user(s)?

Tom


On 17.12.2009 21:53, Tony Juricic wrote:
> The right substitute for Vista/XP like Quick Launch shortcut is to make the 
> link pinned to the taskbar (IMO).
> 
> It appears as simple as putting the shortcut in User Pinned\TaskBar subfolder 
> of Quick Launch folder in Windows 7.
> 
>       <!-- Quick Launch per-user folder -->
>       <Directory Id="QL1" SourceName="Application Data">
>         <Directory Id="QL2" Name="Microsoft">
>           <Directory Id="QL3" Name="Internet Explorer">
>             <Directory Id="QL4" Name="Quick Launch" />
>         <Directory Id="QL5" Name="User Pinned" />
>                <Directory Id="QL6" Name="TaskBar" />
>                </Directory>
>               </Directory>
>             </Directory>
>         </Directory>
> 
> Now, I can condition the installation of the component containing the 
> Shortcut element.
> When OS is Windows 7 shortcut gets created in QL6 directory, otherwise in QL4.
> 
> 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?



TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) 
of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, 
FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and 
subscription company, and TradeStation Europe Limited, a United Kingdom, 
FSA-authorized introducing brokerage firm. None of these companies provides 
trading or investment advice, recommendations or endorsements of any kind. The 
information transmitted is intended only for the person or entity to which it 
is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete the material from any computer.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to