Code Monkey home page Code Monkey logo

windows-installer's Introduction

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

$ npm install --save windows-installer

Query the database

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.

windows-installer's People

Contributors

vktr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.