# windows-installer

> Node.js bindings for the Windows Installer API.

Latest version **0.2.0** (published 2018-03-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install windows-installer
pnpm add windows-installer
yarn add windows-installer
bun add windows-installer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-26 |
| First published | 2018-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 49.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 4 |
| Author | Viktor Elofsson |
| Maintainers | vktr |
| Keywords | wix, windows-installer, msi, windows |

## Links

- npm: https://www.npmjs.com/package/windows-installer
- Repository: https://github.com/vktr/windows-installer
- Homepage: https://github.com/vktr/windows-installer#readme
- Issues: https://github.com/vktr/windows-installer/issues
- npm.io page: https://npm.io/package/windows-installer

## Dependencies (1)

- [node-gyp](https://npm.io/package/node-gyp.md) ^3.6.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-03-26
- 0.1.0 — 2018-03-23

## 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(<Path>, <PersistMode>)`.

| Win32 Function                 | Node.js function                     |
| ------------------------------ | ------------------------------------ |
| `MsiDatabaseCommit`            | `db.commit()`                        |
| `MsiDatabaseGetPrimaryKeys `   | `db.getPrimaryKeys(<TableName>)`     |
| `MsiDatabaseIsTablePersistent` | `db.isTablePersistent(<TableName>)`  |
| `MsiDatabaseOpenView`          | `db.openView(<Query>)`               |
| `MsiOpenDatabase`              | `new Database(<Path>, <PeristMode>)` |


### 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(<InfoType>)`     |
| `MsiViewClose`                 | `view.close()`                       |
| `MsiViewExecute`               | `view.execute()`                     |
| `MsiViewFetch`                 | `view.fetch()`                       |
| `MsiViewGetError`              | `view.getError()`                    |
| `MsiViewModify`                | `view.modify(<Mode>, <Record>)`      |


### 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(<NumFields>)`.

| Win32 Function                 | Node.js function                     |
| ------------------------------ | ------------------------------------ |
| `MsiCreateRecord`              | `new Record(<NumFields>)`            |


## License

Code licensed under the [MIT License](LICENSE.txt).

---
_Source: https://npm.io/package/windows-installer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
