1

We have a windows installer that is built with WIX. It's installed on a certain server.

We changed the name of one folder, but GUID of the corresponding component is the same. Then we do uninstall and install. The folder is created with the old name. I was trying to find a solution for that in windows registry but failed.

What cleanup should be done on the system to remove traces of the old installer? Sure changing GUID of the component, installing this folder is a workaround, but it should be possible without code changes.

Andrey Ershov
  • 1,773
  • 1
  • 16
  • 26

2 Answers2

2

Changing the name requires changing the component GUID. Anything else is a violation of the component rules.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • I've accepted the more detailed answer but I think your answer is what a person with a similar question will be looking for :) – Andrey Ershov Jul 12 '18 at 16:19
1

Simple Solution: Changed installation path requires changed component GUIDs due to MSI component rules - so change both together, or confusion results. Technical details below.

If changing component GUIDs is not an option (it should be), you should be able to "fix" your current problem by scheduling RemoveExistingProducts early in the InstallExecuteSequence (general approach to avoid problems caused by MSI-file design problems and component reference errors). Or rather, you will avoid the problem seen, the actual underlying cause is likely still there, it is just avoided.

I suppose there could also be problems in the Directory table that causes this (unlikely when using WiX).


Explanation: The central thing to understand with MSI componentization is that absolute paths are reference counted, and not files per-se: Change my component GUID in wix? In other words: the component GUID does not follow a file around if it moves.

The overall concept of MSI is that there is a 1:1 mapping between a component GUID (unique identifier) and an absolute path (install location / key path). The full path, including file name if any.

Accordingly, renaming a folder means you should generate new GUIDs for all components targeting that folder (since the absolute path has changed). Somewhat hard to understand and rationalize, but that is the design.

WiX features auto-magic for automatically setting the component GUIDs dealing with changes like folder renames and re-targeting in an automagic-fashion (recommended read). A component GUID is calculated based on installation folder (absolute path).

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164