Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Quick Launch shortcut in Vista and Windows 7

InstallerGeek created the topic: Quick Launch shortcut in Vista and Windows 7
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.
>
>
>
>
>
>
>
>
>

>

>

>

>
> 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?

applicationPackaging replied the topic: Re: 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

applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7
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).

But you don’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.

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’s another issue.

applicationPackaging replied the topic: Re: Quick Launch shortcut in Vista and Windows 7
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;
}
InstallerGeek replied the topic: Re: Quick Launch shortcut in Vista and Windows 7
There’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.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Complete Guide to Software Packaging and Application Packaging

Here’s a comprehensive, in-depth tutorial covering all your sections and topics with enriched details. 1️⃣ What is a Package? A package is a namespace that organizes a…

Read More

Best & Most Popular 5 Code Editor for VBA programming Language

Visual Basic for Applications (VBA) is an implementation of Microsoft’s event-driven programming language Visual Basic 6, which was declared legacy in 2008, and is an associated integrated…

Read More

Best & Most Popular 5 Code Editor for R programming Language

What is the R programming language and how to work? R is an open-source programming language and is a free software environment for statistical computing. R was…

Read More

List Of Top 14 free Blogging websites in 2021 – I verified

What is Blogging :-A discussion or informational website published on the World Wide Web is called A Blog consisting of discrete, often informal diary-style posts. Posts are typically…

Read More

Top 5 Easy to USE and Best International Money Transfer Platform Online

International payments are still difficult to make without a third-party money transfer provider. Transfer apps offer the ability to send money across the world using different currencies…

Read More

How to Download Free O’Reilly Books?

Rajesh KumarI’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x