Take a look at Variable class in docs.
Tony T has a example floating around and
http://www.theswamp.org/index.php?topic=40774.msg460505#msg460505 (http://www.theswamp.org/index.php?topic=40774.msg460505#msg460505)
Code - C#: [Select]
// snip //hive = Registry.LocalMachine; RegistryKey hive = Registry.LocalMachine; // using (RegistryKey ack = hive.OpenSubKey(prodk, true)) { // Create the sysvar definition key using (RegistryKey vark = ack.OpenSubKey("Variables", true)) { if (vark.GetSubKeyNames().Contains("LAYLOCKSEL")) { MessageBox.Show("LAYLOCKSEL is already installed", "LAYLOCKSEL"); return; } else { using (RegistryKey rk = vark.CreateSubKey("LAYLOCKSEL")) { rk.SetValue("", 0, RegistryValueKind.String); rk.SetValue("LowerBound", 0, RegistryValueKind.DWord); rk.SetValue("PrimaryType", 5003, RegistryValueKind.DWord); rk.SetValue("StorageType", 1, RegistryValueKind.DWord); rk.SetValue("UpperBound", 1, RegistryValueKind.DWord); } } } // snip
Hi,
I had a private discussion with Kean about custom sysvar ceation, here's his reply:
"Yes, my understanding is that writing to HKLM is currently required for sysvar registration, whether you use an EXE, an MSI with elevated privileges or even a REG file to create it."
IMO,using these custom sysvar isn't so intersting with LISP as with .NET where it's possible to handle the Variable.Changing and Variable.Changed events.
2 RenderMan
As variant for problem's solving (about HKLM): IT can to change ACL only for this registry key - to add necessary permissions for your windows profile.
Where can I read about 'PrimaryType' parameter? Which values is allowed?