function CheckMSSQLServerISSetup: Boolean;
Var //判断当前计算机是否安装MSSQQLServer
SQLPath,SQLDataRoot,SourcePath:String;
begin
Result:=False;
//得到SQL安装目录
IF RegValueExists(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SQLPath') Then
RegQueryStringValue(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SQLPath',SQLPath)
Else
Exit;
Result:=True;
//得到SQL数据存放路径
IF RegValueExists(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SQLDataRoot') Then
RegQueryStringValue(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SQLDataRoot',SQLDataRoot);
//得到SQL安装程序所在目录
IF RegValueExists(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SourcePath') Then
RegQueryStringValue(HKLM,'SoftwareMicrosoftMSSQLServerSetup','SourcePath',SourcePath);
end;