I have a c# application that runs on both 32-bit and 64-bit OS.In my app, how can I programatically check that solidworks is installed or not on computer.If we can check it by reading registry key ,then provide me path for both 32-bit and 64-bit.Tell me if there are other ways also to check it.
You could use WMI as follows
private static bool IsInstalled(string ProductName)
{
bool rv = false;
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
ManagementObjectCollection Products = searcher.Get();
if (Products.Count != 0)
{
foreach (ManagementObject product in Products)
{
if (product.Properties["Name"].Value.ToString() == ProductName)
{
rv = true;
}
}
}
return rv;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With