Skip to content
Bandwidth edited this page Nov 25, 2021 · 3 revisions

Welcome to the LuaRegistry Wiki!

Functions:

  1. getKey: Returns the contents of a registry key.
  2. createKey: Creates a registry key.
  3. deleteKey: Deletes a registry key.
  4. writeValue: Writes a registry value.
  5. deleteValue: Deletes a registry value.
  6. getValue: Returns a registry value.

1. getKey

returns a tree structure with the registry key

  • the key-table has fields:
    • key: the full key, eg. "HKEY_CLASSES_ROOT\somekey\subkey\subsubkey"
    • keys: table (indexed by name) with key-table of the sub key (same structure)
    • values: table (indexed by name) with a values-table having fields:
      • value: the value.
      • type: the registry value type, eg. REG_SZ, REG_MULTI_SZ, etc.
      • name : the name.

Parameters

  1. key string - full key eg. `"HKLM\SOFTWARE\xPL"
  2. recursive boolean - if truthy, then a recursive tree will be generated will all sub keys as well.

2. createKey

Parameters

  1. key string - the registry key to create.

return true on success, nil, err on failure.

3. deleteKey

Deletes a key. (and all of its contents)

Parameters

  1. key string - the registry key to delete.

return true on success, nil, err on failure. (deleting a non-existing key returns success)

4. writeValue

writes a value, will overwrite existing values without prompt. use name = "(Default)" (or nil) for default value

Parameters

  1. key string the registry key to which to add a value.
  2. name string the name of the value to add.
  3. vtype string the value type to add.
  4. value ? the actual value.

return true on success, nil, err on failure.

5. deleteValue

use name = "(Default)" for default value, or name = nil

Parameters

  1. key string the registry key from which to delete a value.
  2. name string the name of the value to delete.

return true on success, nil, err on failure. (deleting a non-existing value returns success)

6. getValue

Parameters

  1. key string the registry key from which to get the value.
  2. name string the name of the value.

return value, type or nil if it doesn't exist.


Additional function: shellExecute - executes a shell command, Parameter: string