ChrisMDrew
asked on
C# Detect if SMO is installed on a client PC
I have an application which uses SQL Server Management Objects which is installed onto client PCs. I need to know whether or not SMO is installed on the PC and if not to install it. I thought that code of
try
{
Server server = new Server(connection);
}
catch (Exception)
{
// SMO not installed so install
...
}
would work but the exception is not caught even if SMO is not installed - I only get an exception when I try and use the object which is a bit late really Is there a way in .NET 3.5 to determine whether or not the SMO Dlls are installed?
try
{
Server server = new Server(connection);
}
catch (Exception)
{
// SMO not installed so install
...
}
would work but the exception is not caught even if SMO is not installed - I only get an exception when I try and use the object which is a bit late really Is there a way in .NET 3.5 to determine whether or not the SMO Dlls are installed?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Found another registry key which did work! Also checked for the DLL in the appropriate fold4er for safety
ASKER