EylM
EylM

Reputation: 6103

Remove XLL addin when multiple XLL addins are installed

I've written a Excel-Dna based Addin in C#. Used the following technique to register it at users computer (from WixInstaller and ManageOpenKey):

Everything works as expected in the installation, but the problem starts if one of the addins is uninstalled using WixInstaller.

For example, if value "OPEN" is removed, addins at "OPEN1" and "OPEN2" will stop functioning. Excel explicitly looks for "OPEN", "OPEN1", "OPENXXX" sequence and if one of the values is missing - it stops enumerating. I checked the source code of ManageOpenKey - it "blindly" removes the addin key even if this operation breaks the sequence.

Only solution I am thinking, is to write a function that re-orders all the keys. This does not look so difficult, but my question is: Have anyone found a solution for this?

Upvotes: 0

Views: 899

Answers (2)

C. Augusto Proiete
C. Augusto Proiete

Reputation: 27878

Charles Williams answer is correct. When uninstalling an Excel add-in, you should rewrite & reorder the values in the registry that comes after the add-in being uninstalled (if any).

I've added an issue to the Excel-DNA WiXInstaller Template repo, for us to fix it.

Upvotes: 0

Charles Williams
Charles Williams

Reputation: 23540

Yes you would have to rewrite the OPEN keys so that they are in contiguous ascending sequence.
Also worth removing the key from the ADDINS hive in case a user has used the XL Addin manager to move it from the active to the inactive list of addins.

Upvotes: 2

Related Questions