Skip to content

Commit a23daab

Browse files
author
Steven Edouard
committed
Merge pull request #26 from CatalystCode/doc_typos
Typo Fixes
2 parents 4451f70 + ab74f92 commit a23daab

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Read and Write to the Windows registry in-process from Node.js. Easily set appli
66

77
## Install
88

9-
This library interacts with natvive Windows apis. Ensure you have Visual Studio 2013 or newer build tools. Using Visual Studio is not
9+
This library interacts with native Windows APIs. Ensure you have Visual Studio 2013 or newer build tools. Using Visual Studio is not
1010
required. Then install the package:
1111

1212
```
@@ -15,11 +15,11 @@ npm install windows-registry-node
1515

1616
## Creating File Associations
1717

18-
To create a file association you can call the `fileAssociation.associateExeForFile` api which will make windows assign a default program for
18+
To create a file association, you can call the `fileAssociation.associateExeForFile` api which will make windows assign a default program for
1919
an arbitrary file extension:
2020

2121
```js
22-
var utils = require('windows-registry');
22+
var utils = require('windows-registry').utils;
2323
utils.associateExeForFile('myTestHandler', 'A test handler for unit tests', 'C:\\path\\to\\icon', 'C:\\Program Files\\nodejs\\node.exe %1', '.zzz');
2424
```
2525
## Reading / Writing to the Windows Registry
@@ -39,6 +39,7 @@ var key = new Key(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_A
3939
Or you can open a sub key from an already opened key:
4040

4141
```js
42+
var Key = require('windows-registry').Key;
4243
var key = new Key(windef.HKEY.HKEY_CLASSES_ROOT, '', windef.KEY_ACCESS.KEY_ALL_ACCESS);
4344
var key2 = key.openSubKey('.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS);
4445
```
@@ -54,8 +55,9 @@ key.close();
5455
Creating a key just requires that you have a [Key](lib/key.js) object by either using the [predefined keys](https://github.com/CatalystCode/windows-registry-node/blob/master/lib/windef.js#L27) within the `windef.HKEY` or opening a subkey from an existing key.
5556

5657
```js
58+
var Key = require('windows-registry').Key;
5759
// predefined key
58-
var key = registry.openKeyFromPredefined(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS);
60+
var key = new Key(windef.HKEY.HKEY_CLASSES_ROOT, '', windef.KEY_ACCESS.KEY_ALL_ACCESS);
5961
var createdKey = key.createSubKey('\test_key_name', windef.KEY_ACCESS.KEY_ALL_ACCESS);
6062
```
6163

@@ -69,9 +71,12 @@ createdKey.deleteKey();
6971

7072
### Write a Value to a Key
7173

72-
To write a value, you'll again need a [Key](lib/key.js) object and just need to call the `registry.setValueForKeyObject` function:
74+
To write a value, you'll again need a [Key](lib/key.js) object and just need to call the `Key.setValue` function:
7375

7476
```js
77+
var Key = require('windows-registry').Key,
78+
windef = require('windows-registry').windef;
79+
7580
var key = new Key(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS);
7681
key.setValue('test_value_name', windef.REG_VALUE_TYPE.REG_SZ, 'test_value');
7782
```
@@ -91,9 +96,11 @@ The return value depends on the type of the key (REG_SZ for example will give yo
9196
To launch a process as an Administrator, you can call the `uac.elevate` api, which will launch a process as an Administrator causing the UAC (User Account Control) elevation prompt to appear if required. This is similar to the Windows Explorer command "Run as administrator". Pass in `FILEPATH` to the process you want to elevate. Pass in any`PARAMETERS` to run with the process. Since this is an asychronous call, pass in a callback to handle user's selection.
9297

9398
```js
99+
var uac = require('windows-registry').uac;
94100
uac.elevate('C:\\Program Files\\nodejs\\node.exe', 'index.js', function (err, result){console.log('callback');});
95101
```
96102

97103
## More Docs?
98104

99105
Make your way over to the [tests section](test) to see how the module can be used.
106+

0 commit comments

Comments
 (0)