Consider the following scenario--
Let's assume you are writing an application that needs to use a specific Windows application. Specifically, it's an application that installs various API tools intended to provide application integration into some other Microsoft software or service.
Now, let's make a couple of other assumptions, which are as follows:
- Your application doesn't care which version of this tool is installed since version changes tend to be only minor updates that fix bugs or are patches to get the components to properly install on different versions of Windows.
- You are writing an international tool, so there is a chance that the Microsoft component tool that you need is installed on your end-users machine, but it could be installed under a non-English name.
- Also, your application is distributed within a zip file. Your user does not install your software, so you can't create an installer perquisite. Instead, you must run your application and then check to see if the needed Microsoft tool has been installed.
Using C#, is there a standardized way of checking to see if an application has been installed. Specifically, is there some WMI call or registry query that when executed returns some form of unique identifier that is intended to represent a value uniquely representing the installed application, regardless of the applications installation name or version?
Every question on SO, or other places on the web, that I can find regarding checking for installed software recommends checking to see if the software has been installed by looking it up by name. This would work, however, our software is a global tool that is used on machines with various cultural settings. What we've found is that this naive check doesn't work, even after we provide the install file, because the localization settings in the Microsoft Installer are renaming the application on the machines that are setup for a different, non-English locale.
Is there a "formalized" solution to this problem? As in, is there a documented approach as to how one may check for such software, assuming the developer of the specific tool you are checking for has properly setup their installers to properly configure these ID values?
As an aside, we actually have a couple of Microsoft tools that we need to check for. I didn't want to include a list because I'm hoping there is a moderately straight-forward approach to solving this need for multiple, different tools.