14
votes

During an installation or major upgrade, if a user has pinned the application to their task bar, then after the installation has completed, the task bar shortcut is removed from %AppData%\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar and a blank-file icon (see image link below) is left in its place.

Clicking the icon will prompt the user to delete as it doesn't target anything.

enter image description here
(Mirror: http://i.stack.imgur.com/kz1zW.png)

I would like to make it such that the taskbar shortcut is not removed at all when installing or running a major upgrade. We push out updates on a weekly basis and it can be frustrating if the taskbar shortcut breaks during every update.

Is this possible?
I've read about modifying the value for RemoveExistingProducts (i.e. changing from InstallValidate to InstallFinalize), but I'm unsure if this will be viable.

3
Have you found the solution? I've got the same issue and can't seem to find the solution anywhere...Uflex
@Uflex See my answer for workaround we use in our product.Ivan Zhakov
@Andreas See my answer for workaround we use in our product.Ivan Zhakov
@Uflex Thanks. This seems more elegant than the approach I chose: we use a component with emtpy guid. We remove the shortcut file with a custom action on uninstall.Andreas

3 Answers

6
votes

You can avoid custom actions by disabling the standard RemoveShortcuts as follows:

<InstallExecuteSequence>
  <RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts>
</InstallExecuteSequence>

This disables removing shortcuts except on uninstall.

5
votes

We encountered this issue and our investigation reveals that msiexec.exe explicitly removes pinned item when remove corresponding shortcut on uninstall or major upgrade.

As workaround we did the following:

  1. Disabled standard RemoveShortcuts action using the following WiX code:

    <InstallExecuteSequence>
      <RemoveShortcuts>0</RemoveShortcuts>
    </InstallExecuteSequence>
    
  2. Added explicit <DeleteFile> entry for every shortcut we install. For example:

    <DirectoryRef Id="ProgramMenuDir">
      <Component Id="Component" Guid="B7469BFC-BF2A-4AF7-9DF5-3458BB485F18">
        <Shortcut Id="Shortcut" Name="My Supper App"
                  Directory="ProgramMenuDir" Target='MyApp.exe' />
        <RemoveFile Id="RemoveShortcut"
                    Name="My Supper App.lnk"
                    On="uninstall" />
      </Component>
    </DirectoryRef>
    

It seems to be working fine.

-2
votes

I'm not sure what you can do to prevent it from happening, but this might help you at least replace it. This method uses a logon script, but you should be able to implement this with wix

Windows 7 taskbar pinned icons are stored in the following locations

File System: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

Registry: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband] To deploy it, you can perform the following steps:

  1. Configure Pinned items on a Windows 7 system as a reference computer.
  2. Export Reigstry Key to pinned.reg file: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband] And copy items in the "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" to a shared folder.

  3. Create a logon script to deploy the registry keys and copy the corresponding files. Please note that the “%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned” folder is only created after a user has pinned an icon to the taskbar. In the logon script, you will need to create the “%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar” folder if it does not exist.

Source: http://social.technet.microsoft.com/Forums/windowsserver/en-US/d172b4de-be7c-4149-8958-bebfe042ade1/forum-faq-how-to-deploy-windows-7-taskbar-pinned-icons-by-group-policy?forum=winserverGP