Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix - Do Not Remove Pinned Taskbar on Install

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.

like image 255
user3216062 Avatar asked Jan 20 '14 18:01

user3216062


2 Answers

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.

like image 170
Mike Ward Avatar answered Nov 08 '22 19:11

Mike Ward


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.

like image 44
Ivan Zhakov Avatar answered Nov 08 '22 21:11

Ivan Zhakov