We create our installation packages with WiX Toolset. I'm trying to enable 4-digit product versioning (like 188.8.131.52, 184.108.40.206 etc). The problem is that when product is upgraded the previous version is not uninstalled.
I am aware of ProductVersionskytvservices limitation. And my current approach to the problem is writing a C++ custom action. This action successfully detects the installed product, I have its upgrade code. The custom action is also capable of setting MSI properties through https://docs.microsoft.com/en-us/windows/win32/api/msiquery/nf-msiquery-msisetpropertyaskytvpackages. But what do I need to do to force removal of the installed product?
Per this link I see that in MSI there is Upgrade table that I might have to modify. But how do I do it for running installation? MsiGetActiveDatabase gives a read-only handle. MsiOpenDatabase opens MSI files by path.
Am I going the wrong way?