/// <summary> /// Validate whether Java is installed in execution system. /// </summary> /// <returns></returns> public static string ValidateJavaSoftwareInstalled() { int flagJava = 0; string softwareKey = Property.JavaKeyString; try { using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(softwareKey)) { foreach (string skName in rk.GetSubKeyNames()) { if (skName.Equals(Property.JavaRunTimeEnvironmentString)) { flagJava = 1; } } if (flagJava == 1) { return(ExecutionStatus.Pass); } return(ExecutionStatus.Fail); } } catch (Exception e) { throw new KryptonException(Utility.GetCommonMsgVariable("KRYPTONERRCODE0004").Replace("{MSG}", e.Message)); } }
/// <summary> /// Validate whether the version of java is heigher or equals to 1.5. /// </summary> /// <returns>Return String with status Pass OR Fail.</returns> public static string validateJavaVersion() { bool isAbove = false; string SoftwareKey = Property.JavaRunTimeEnvironmentKeyString; try { using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey)) { foreach (string skName in rk.GetSubKeyNames()) { string sk = skName.Substring(2, 1); if (int.Parse(sk) >= 5) { isAbove = true; } } if (isAbove) { return(ExecutionStatus.Pass); } else { return(ExecutionStatus.Fail); } } } catch (Exception e) { throw new KryptonException(Utility.GetCommonMsgVariable("KRYPTONERRCODE0005").Replace("{MSG}", e.Message)); } }
public string ValidateBrowserInstalled() { bool isChrome = false; string softwareKey = Property.ChromeSpecificKeyString; try { using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(softwareKey)) { if (rk != null && rk.GetSubKeyNames().Any(skName => skName.Contains(KryptonConstants.BROWSER_CHROME))) { isChrome = true; } if (isChrome) { return(ExecutionStatus.Pass); } return(ExecutionStatus.Fail); } } catch (Exception) { throw new KryptonException(Utility.GetCommonMsgVariable("KRYPTONERRCODE0003")); } }
public string ValidateBrowserInstalled() { bool isFf = false; string softwareKey = Property.BrowserKeyString; try { using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(softwareKey)) { foreach (string skName in rk.GetSubKeyNames()) { if (skName.Contains("Mozilla Firefox")) { isFf = true; } } if (isFf) { return(ExecutionStatus.Pass); } return(ExecutionStatus.Fail); } } catch (Exception e) { Console.WriteLine(e); throw new KryptonException(Utility.GetCommonMsgVariable("KRYPTONERRCODE0002")); } }
public string ValidateBrowserInstalled() { bool x = false; string softwareKey = Property.BrowserKeyString; try { using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(softwareKey)) { if (rk != null) { foreach (string skName in rk.GetSubKeyNames()) { if (skName.ToLower().Trim().Contains("ie")) { x = true; } } } if (x) { return(ExecutionStatus.Pass); } return(ExecutionStatus.Fail); } } catch (Exception e) { throw new KryptonException(Utility.GetCommonMsgVariable("KRYPTONERRCODE0001")); } }