private static bool IsArcGISInstalled(out string msg)
{
msg = "";
RegistryKey arcgisRegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcGIS");
if (arcgisRegKey == null)
{
msg = "未安装ArcGIS 10.4软件!";
return false;
}
else
{
string realVersion = arcgisRegKey.GetValue("RealVersion").ToString();
string currVersion = realVersion.Remove(realVersion.LastIndexOf('.'));
if (!currVersion.Equals("10.4"))
{
msg = "当前版本为ArcGIS " + currVersion + ",请安装ArcGIS 10.4版本!";
return false;
}
return true;
}
}