-1

My wix installer creates the shortcuts at Desktop and StartMenu during installation.

From the installed Startmenu shortcuts, Some of the users use the feature "Pin to taskbar" to pin the shortcuts to taskbar manually which is not in control of my wix msi.

The taskbar shortcut gets created at %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk in Windows 10.

The shortcuts at StartMenu and Desktop gets removed when product is uninstalled (which is expected), However the taskbar shortcut pinned manually goes orphaned and stays even after product is uninstalled.

How can i remove the taskbar shortcut when product is uninstalled ?

This is what I tried but it is not working:

  <CustomAction Id="DeleteTaskBarShortcut" Execute="deferred"
     ExeCommand="del &quot;[AppDataFolder]\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk&quot;"
     Directory="AppDataFolder"
     Impersonate="no"
     Return="ignore" />

 <InstallExecuteSequence>     
      <Custom Action="DeleteTaskBarShortcut" Before="RemoveFiles">Installed</Custom>
 </InstallExecuteSequence>  

Thanks in advance

DotNetSpartan
  • 931
  • 4
  • 20
  • 41

1 Answers1

1

To answer the question of Should you the answer would be no. The reasons are:

  1. Microsoft has made it incredibly difficult to manage things like this because they consider it user data and they don't want software vendors abusing user settings.

  2. Your user created the object not your installer. So therefore you are under no obligation to clean it up.

  3. Managing per-user resources for a per-machine installer has always been incredibly difficult anyways. It creates a many to one cleanup with access right issues to boot.

If you are somehow able to run an EXE that when ran as SYSTEM works as expected then I can assist you in integrating that into an MSI. But don't expect it to always work especially on newer versions of Windows as MSFT continues to close off the attack surfaces.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100