How to avoid broken taskbar shortcut after app update?

75 Views Asked by At

Installing v1.2 of our app over v1.1 causes a shortcut pinned on the taskbar to be broken.

Here are the steps to see the problem:

  1. Download an app on Windows (10 or 11) (this should be an app with a Windows installer - not a "portable" app, etc.)
  2. Download and install a previous version of the same app
  3. Pin the shortcut to the taskbar
  4. Install the later version of the same app to upgrade it
  5. The pinned taskbar shortcut is broken

When I click on the broken shortcut, Windows tells me this:

enter image description here

Ironically (or infuriatingly?), when I clicked No, it removed it anyway!!!

What can I do in our Wix code to prevent the shortcut from becoming broken?

I looked at How to keep taskbar shortcut during update? and Wix - Do Not Remove Pinned Taskbar on Install

So I tried adding this to my <InstallExecuteSequence>:

<RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE AND REMOVE="ALL"</RemoveShortcuts>

The intent was to remove shortcuts only when the user chooses to uninstall the product, but not to remove them for upgrades or repairs. That did not work. The shortcut is still broken after the upgrade install.

I suspect it may have something to do with warning messages I get when using light.exe to build the installer:

warning LGHT1055 : The InstallExecuteSequence table contains an action 'RemoveShortcuts' which cannot be merged from the merge module '....\packages\Encoding-Converters-Core.0.6.0\runtimes\EcDistFiles\MergeModules\x64\EC_40_64bit_MM.msm'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module.

Encoding-Converters is a merge module from another development team.

Is there a way to avoid this conflict?

If there is, will it fix our problem with the broken taskbar shortcut?

UPDATE: I was able to work with a developer for the merge module, and we tried to ensure that both the merge module and the installer for our app had the same <RemoveShortcuts> line. Doing this removed the warning from Wix when building the installer, but the problem remains with the taskbar shortcut being broken.

New question: Does it matter where in the <InstallExecuteSequence>, the <RemoveShortcuts> is placed?

0

There are 0 best solutions below