/// <summary> /// 判断操作系统是否安装了ArcGIS指定产品 /// </summary> /// <param name="productType"></param> /// <param name="installPath"></param> /// <returns></returns> public virtual bool IsIntall(EArcGisProductType productType, out string installPath) { switch (productType) { case EArcGisProductType.Any: return(IsInstallLicense(out installPath) || IsInstallAdmin(out installPath) || IsIntallDesktop(out installPath) || IsIntallRumtime(out installPath)); case EArcGisProductType.License: return(IsInstallLicense(out installPath)); case EArcGisProductType.Aministrator: return(IsInstallAdmin(out installPath)); case EArcGisProductType.Desktop: return(IsIntallDesktop(out installPath)); case EArcGisProductType.ArcMap: return(IsInstallArcMap(out installPath)); case EArcGisProductType.ArcEngineRuntime: return(IsIntallRumtime(out installPath)); default: throw new Exception($"未实现判断{nameof(productType)}是否安装的功能,请联系系统管理员"); } }
/// <summary> /// 获取ICheckArcGisInstall对象,可通过ICheckArcGisInstall.Version获得当前系统安装的ArcGIS版本 /// </summary> /// <param name="eType">ArcGIS产品类别</param> /// <returns></returns> public static ICheckArcGisInstall GetCheckArcGisInstall(EArcGisProductType eType = EArcGisProductType.Desktop) { var checkers = new ICheckArcGisInstall[] { new CheckArcGis93Install(), new CheckArcGis100Install(), new CheckArcGis101Install(), new CheckArcGis102Install(), new CheckArcGis103Install(), new CheckArcGis104Install(), new CheckArcGis105Install(), new CheckArcGis106Install(), new CheckArcGis107Install(), }; foreach (var checker in checkers) { if (checker.IsIntall(eType, out _)) { return(checker); } } return(null); }
/// <summary> /// 获取ArcGIS指定产品的安装路径 /// </summary> /// <returns></returns> public virtual string GetInstallPath(EArcGisProductType productType) { IsIntall(productType, out var installPath); return(installPath); }
/// <summary> /// 获取ArcGIS指定产品的安装路径 /// </summary> /// <param name="eType">ArcGIS产品类别</param> /// <returns></returns> public static string GetInstallPath(EArcGisProductType eType = EArcGisProductType.Desktop) { return(CheckArcGisInstall?.GetInstallPath(eType)); }