void addXDInfoToStore() { try { string vdapath; if (Win32Impl.is64BitOS() && (!Win32Impl.isWOW64())) { vdapath = "Software\\Wow6432Node\\Citrix\\VirtualDesktopAgent"; } else { vdapath = "Software\\Citrix\\VirtualDesktopAgent"; } try { if (Array.Exists(Registry.LocalMachine.OpenSubKey(vdapath).GetValueNames(), delegate(string s) { return(s.Equals("ListOfDDCs")); })) { xdvdapresent.value = "1"; } else { // ListOfDDCs not found xdvdapresent.value = "0"; } try { if (Registry.LocalMachine.OpenSubKey(vdapath).GetValueKind("ProductInstalled") == RegistryValueKind.DWord) { try { xdvdaproductinstalled.value = ((int)Registry.LocalMachine.OpenSubKey(vdapath).GetValue("ProductInstalled")).ToString(); } catch (Exception e) { wmisession.Log("addXDInfoToStore Can't read ProductInstalled : " + e.ToString()); } } else { wmisession.Log("addXDInfoToStore ProductInstalled is not a DWORD"); } } catch { //ProductInstalled doesn't exist } } catch { // Unable to read vdapath xdvdapresent.value = "0"; } } catch (Exception e) { wmisession.Log("addXDInfoToStore Failed : " + e.ToString()); } }
public bool installing() { try { string installstate; if (Win32Impl.is64BitOS() && (!Win32Impl.isWOW64())) { installstate = (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Citrix\\XenToolsInstaller", "InstallStatus", "Installed"); } else { installstate = (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Citrix\\XenToolsInstaller", "InstallStatus", "Installed"); } if (installstate == null) { installstate = "Installed"; } if (installstate.Equals("Installed")) { needsinstalling = false; return(false); } needsinstalling = true; return(true); } catch { needsinstalling = true; return(true); } }