Best Answer deramor , 18 July 2018 - 16:17
Always overwrite sets the file version manually for the key file in the component. This is not a good thing to do IMHO.
Refer to the File Version rules on Microsoft's website: https://docs.microso...ersioning-rules
The best way to handle this is to not revert your file versions and to completely remove the old release from the machine before installing the new one.
However only doing the latter will have the results you want. The former is just good development practice.
Installers have a step called "Costing". https://docs.microso...si/file-costing
These steps attempt to make the installer very efficient. Microsoft expects that we all are installing many thousands of files and that takes a long time. In practice however we are usually not doing that. Combined with the file version rules, costing steps attempt to see which components can be skipped for installing. This sometimes results in missing files as they are marked as "do not install" at runtime but then also removed during an upgrade. (Especially with .Net and the GAC)
I have seen this behavior in the past and to get around it, I have manually moved the "RemoveExistingProducts" action to just after 'ValidateProductID".
This does 2 things. It removes the old product before costing happens. Since there is nothing to compare any files to, all components are marked as "to be installed".
However secondly, if something goes wring with your install process, you have nothing to roll back to.
Personally, I like to not try to guard against the situations that might happen and deal with those that will happen. Every release has the potential to upgrade from an older release. (and thus leave you with missing files) Whereas, the installer is authored to the best of your ability not to ever fail. So on one hand, you've got a situation that will almost always happen and another that may never happen. I move the action as mentioned above and live with the potential to have nothing left over if there is a failure.Go to the full post