Reputation: 1078
I'm installing Visual C++ Redistributable 2013 as a prerequisite (if its not installed)through my installer. But sometimes already installed VC++ is corrupted then my installer does not work because I'm having DLL functions called in CustomAction.
So my question : Is there any way to find whether the installed VC++ redistributables is corrupted or not ?
Upvotes: 0
Views: 894
Reputation: 15905
Health checks in general are a pretty difficult topic. For files built into Windows, there are tools like SFC, but that doesn't extend to other installed packages. For MSI packages, you can choose to run repair, and in some cases Windows will do this automatically; this topic in general is called Resiliency. But unless auto- or manual-repair fixes the sorts of problems you encounter in the wild, it's not very relevant.
So the question becomes what sorts of problems do you actually encounter, with what frequency, what their fix is, and what problems can be caused by attempting to fix them. If it's sufficient to invoke a manual repair of the VC++ redist, that's fairly easy to implement. If a full uninstall and reinstall is required, that's much more invasive; the idea of making that part of an installation rubs me the wrong way. If you have to do this only in very specific situations, it may depend on how well you can identify those situations.
Alternately, if your focus is ensuring that your installation succeeds, you may be able to statically link your custom action DLLs so that they no longer depend on the state of the VC++ package. This will not help your application much if the application also depends on the VC++ package, however. Perhaps a privatized copy of the VC++ DLLs can address that (if the 2013 version supports that--I forget), at the cost of more difficulties servicing your copy of the VC++ DLLs in case of security updates.
But again, this all depends on what sorts of problems occur, whether they're frequent enough to merit addressing them, and whether the cure is worse than the disease.
Upvotes: 1