https://github.com/vktr/windows-installer
Node.js bindings for the Windows Installer API.
https://github.com/vktr/windows-installer
msi win32 windows-installer
Last synced: 10 months ago
JSON representation
Node.js bindings for the Windows Installer API.
- Host: GitHub
- URL: https://github.com/vktr/windows-installer
- Owner: vktr
- License: mit
- Created: 2018-03-23T00:11:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T17:53:15.000Z (over 3 years ago)
- Last Synced: 2025-08-02T11:48:46.509Z (10 months ago)
- Topics: msi, win32, windows-installer
- Language: C++
- Size: 118 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Node.js bindings for the Windows Installer API
This package lets you open, query and modify MSI files from Node.js. It
provides some abstraction on top of the native Windows Installer API but
otherwise just passes through any arguments.
The API is currently synchronous and will throw errors at the Windows Installer
API's behalf.
## Usage
### Install the package
```sh
$ npm install --save windows-installer
```
### Query the database
```js
const wi = require('windows-installer');
const db = new wi.Database('C:/Installer.msi', wi.MSIDBOPEN_READONLY);
const view = db.openView("SELECT * FROM _Tables");
view.execute();
let record = null;
while ((record = view.fetch())) {
console.log(record.getString(1));
}
```
## API coverage
### Database functions
Database functions requires a `Database` (named `db` in the examples
below). This can be obtained by running `new Database(, )`.
| Win32 Function | Node.js function |
| ------------------------------ | ------------------------------------ |
| `MsiDatabaseCommit` | `db.commit()` |
| `MsiDatabaseGetPrimaryKeys ` | `db.getPrimaryKeys()` |
| `MsiDatabaseIsTablePersistent` | `db.isTablePersistent()` |
| `MsiDatabaseOpenView` | `db.openView()` |
| `MsiOpenDatabase` | `new Database(, )` |
### View functions
View functions requires a `View` (named `view` in the examples below). This
can be obtained by running `openView` on a `Database` instance.
| Win32 Function | Node.js function |
| ------------------------------ | ------------------------------------ |
| `MsiViewGetColumnInfo` | `view.getColumnInfo()` |
| `MsiViewClose` | `view.close()` |
| `MsiViewExecute` | `view.execute()` |
| `MsiViewFetch` | `view.fetch()` |
| `MsiViewGetError` | `view.getError()` |
| `MsiViewModify` | `view.modify(, )` |
### Record functions
Record functions requires a `Record` (named `rec` in the examples below). This
can be obtained by running `fetch` on a `View` instance or by running
`new Record()`.
| Win32 Function | Node.js function |
| ------------------------------ | ------------------------------------ |
| `MsiCreateRecord` | `new Record()` |
## License
Code licensed under the [MIT License](LICENSE.txt).