Good morning,
I am looking to achieve an external handler for msiexec, but not stopping msiexec from acting any different. I would like to be able to intercept all m
I cannot see why intercepting the UI has anything to do with cache locations that you cannot alter while the install is in progress. However it's not clear exactly what usage of "cache" you are intending here. I'll assume that you are referring to the complete MSI file which may have been extracted to some location for install, or is otherwise at the location it was installed from.
Let's assume that the install has finished and you know (or can get) its ProductCode. All you need do to obtain all the official source locations is call MsiSourceListEnumSources () and that will tell you the actual locations that Windows will use to find the MSI for maintenance, upgrade, repair, etc, if and when required.
If the source MSI is at a location you do not approve of, then use MsiSourceListClearSource () to delete that entry, copy the MSI to a location of your choice, then use MsiSourceListAddSource () to add that location. There are plenty of sourcelist APIs for exactly this type of management activity, such as when products were installed from network locations that are no longer available.
I don't believe you should be moving or altering the internal cached (obfuscated name) MSI file that is typically in \windows\installer. That us sometimes referred to as the cached location, but you seem to be referring to the complete MSI used to install the product.