Example #1
0
        private XenClientGuestWCFService(Udbus.Core.Logging.ILog log)
        {
            this.log = log;

            // Initialize the uuid field from XenStore.
            XenStoreLib.XenStoreWrapper xenStoreWrapper = new XenStoreLib.XenStoreWrapper();
            string vm       = xenStoreWrapper.ReadString("vm");
            string uuidPath = string.Format("{0}/uuid", vm);

            this.uuid_ = xenStoreWrapper.ReadString(uuidPath);

            // Work out the install directory.
            this.installDir = System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("PROGRAMFILES") ?? "C:\\Program Files", "Citrix");
            this.installDir = System.IO.Path.Combine(installDir, "XenGuestPlugin");

            Microsoft.Win32.RegistryKey installKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(InstallRegkeyName);
            if (installKey != null)
            {
                string installVal = (string)installKey.GetValue(XcInstallDirName);
                if (!string.IsNullOrEmpty(installVal))
                {
                    this.installDir = installVal;
                }
            }
        }
Example #2
0
 public bool XenStoreWrite(string path, string value)
 {
     using (XenStoreLib.XenStoreWrapper xenStoreWrapper = new XenStoreLib.XenStoreWrapper())
     {
         string data = path + " = " + value;
         EventLog.WriteEntry("xenStoreWrite", data);
         return(xenStoreWrapper.Write(path, value));
     }
 }
        private XenClientGuestWCFService(Udbus.Core.Logging.ILog log)
        {
            this.log = log;

            // Initialize the uuid field from XenStore.
            XenStoreLib.XenStoreWrapper xenStoreWrapper = new XenStoreLib.XenStoreWrapper();
            string vm = xenStoreWrapper.ReadString("vm");
            string uuidPath = string.Format("{0}/uuid", vm);
            this.uuid_ = xenStoreWrapper.ReadString(uuidPath);

            // Work out the install directory.
            this.installDir = System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("PROGRAMFILES") ?? "C:\\Program Files", "Citrix");
            this.installDir = System.IO.Path.Combine(installDir, "XenGuestPlugin");

            Microsoft.Win32.RegistryKey installKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(InstallRegkeyName);
            if (installKey != null)
            {
                string installVal = (string)installKey.GetValue(XcInstallDirName);
                if (!string.IsNullOrEmpty(installVal))
                {
                    this.installDir = installVal;
                }
            }
        }
 public bool XenStoreWrite(string path, string value)
 {
     using (XenStoreLib.XenStoreWrapper xenStoreWrapper = new XenStoreLib.XenStoreWrapper())
     {
         string data = path + " = " + value;
         EventLog.WriteEntry("xenStoreWrite", data);
         return xenStoreWrapper.Write(path, value);
     }
 }