1
votes

I've inherited project with MSI created in WiX and now I'm trying to solve some of the issues that unfortunately exist.

There's a remember property pattern which is used to found specific directory saved in registry entry:

<Property Id="AUTO_FOUND_DIR" Secure="yes" Admin="yes">
      <RegistrySearch Id="regsrch_AUTO_FOUND_DIR"
                      Root="HKCU"
                      Key="$(var.RegPath)"
                      Name="$(var.SpecificKey)"
                      Type="raw"
      />
</Property>

The SpecificKey value is then saved in AUTO_FOUND_DIR property.

Then the black magic appears. A separate component is holding (among other stuff) a shortcut located in ProgramMenuFolder (non-advertised) to the main executable.

I've been told that usage of util:RemoveFolderEx is a workaround for an old issue where this shortcut was orphaned and hasn't been removed during uninstall:

<Feature>
<DirectoryRef Id="ProgramMenuDir">
      <Component Id="cmp_ProgramMenuDir" Guid="{0E8BD13A-GUID-IS-HERE-6E5092ECA9EF}">
        <CreateFolder />
        <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
        <RegistryKey Id='reg_SpecificKeyID' Root='HKCU' Key='$(var.RegPath)' ForceCreateOnInstall="yes">
          <RegistryValue Type='string' Name='$(var.SpecificKey)' Value='[ProgramMenuDir]'/>
        </RegistryKey>
        <!-- other content: shortcut to ProgramMenuFolder and other stuff -->
        <util:RemoveFolderEx Id="rm_dirID" On="install" Property="AUTO_FOUND_DIR"/>
      </Component>
    </DirectoryRef>
</Feature>

The problem is: I don't need this workaround (and usage of AUTO_FOUND_DIR property as well. I've removed that code but during upgrade (major, Product and Package GUIDs set to "*", UpgradeCode has the same value as previous version) I can see in verbose log from MSI that this AUTO_FOUND_DIR exists, the RegistrySearch reads the key value with specific directory and as a result the util:RemoveFolderEx removes that directory and all components that are there located.

My question is: how can I detect why this old property is being used during upgrade and how to get rid of it?

Additional information: the install scope is PerMachine, ALLUSERS is set to 1. The MSI with upgraded version has this property removed.

1

1 Answers

1
votes

Without a close look at your complete verbose log to see what's going on, remember that an upgrade does an uninstall of the older installed product. This means that a lot of the logic in the older installed product will happen during your upgrade. So you will definitely see the RegistrySearch running as the older product uninstalls, setting AUTO_FOUND_DIR, and you will see the RemoveFolder that runs during the uninstall.

So it's not clear if you actually have an issue if all you're seeing is the uninstall activity of that older product being uninstalled. That activity is embedded in the installed product.