
- #Where does msecure install executable install
- #Where does msecure install executable code
- #Where does msecure install executable Pc
This function can find all the per-machine installations and Use the MsiEnumProductsEx function to enumerate Windows Installer applications that are installed in the If your application is being installed you could find out where CMG STARS is located during installation Using Windows Installer to Inventory Products and Patches: In my opinion its better to use Method 1 as its faster and doesn't create all the "Windows Installer reconfigured the product." event logs. If (fileDescription = fileDescriptionToFind)ĮxeName = GetSpecificFileProperties(filePath, 0).Replace(Environment.NewLine, string.Empty) Įither method (1 or 2) you use I recommend that you save the location of exe name so you only do this operation once. String fileDescription = GetSpecificFileProperties(filePath, 34).Replace(Environment.NewLine, string.Empty)
#Where does msecure install executable install
Neither of the above methods tell you the name of the executable, however it is quite easy to work out by iterating over all the files in the install path and using a technique I discuss here to look at file properties to detect the EXE with the correct File Description, eg: private string GetFileExeNameByFileDescription(string fileDescriptionToFind, string installPath)įoreach (string filePath in Directory.GetFiles(installPath, "*.exe")) ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_Product") įoreach (ManagementObject mo in mos.Get())ĭebug.Print(mo.ToString() + "," + mo.ToString() + Environment.NewLine) Net DLL to get the InstallLocation although it is heaps slower and creates "Windows Installer reconfigured the product" event log messages for every installed product on your system.
#Where does msecure install executable code
REF: I modified the above code from here to return the install path. To get the nameOfAppToFind you'll need to look in the registry at the DisplayName: String installPath = InstalledApplications.GetApplictionInstallPath(nameOfAppToFind) Return subkey.GetValue("InstallLocation") as string If (nameOfAppToFind.Equals(displayName, StringComparison.OrdinalIgnoreCase) = true) Using (RegistryKey key = root.OpenSubKey(subKeyName))įoreach (string kn in key.GetSubKeyNames())ĭisplayName = subkey.GetValue(attributeName) as string Private static string ExistsInSubKey(RegistryKey root, string subKeyName, string attributeName, string nameOfAppToFind) KeyName = ExistsInSubKey(Registry.LocalMachine, keyName, "DisplayName", nameOfAppToFind) If (!string.IsNullOrEmpty(installedPath)) KeyName = ExistsInSubKey(Registry.CurrentUser, keyName, "DisplayName", nameOfAppToFind) Public static string GetApplictionInstallPath(string nameOfAppToFind) Public static class InstalledApplications Here is an class that returns the installed location of an application: using Microsoft.Win32 SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall in LocalMachine SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall inside LocalMachineģ.

SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall inside CurrentUserĢ. In your case I am pretty sure that CMG STARS will be listed and you will be able to search for it by iterating over all subkeys looking at the DisplayName value and fetching the InstallLocation.Īlso note that this Uninstall registry key exists in 3 places in the registry:ġ.
#Where does msecure install executable Pc
Note: It doesn't list all EXE applications on the PC as some dont require installation. The registry keys SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall provides a list of where most applications are installed:
