{"_id":"@bun-win32/msi","_rev":"4-8b9838736a2fedf3a14279dcf042b512","name":"@bun-win32/msi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/msi","version":"1.0.0","keywords":["bun","ffi","win32","windows","msi","installer","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/msi@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"a7d0e935b9a0c429b2c6d08f5b09cf29fde91c04","tarball":"https://registry.npmjs.org/@bun-win32/msi/-/msi-1.0.0.tgz","fileCount":6,"integrity":"sha512-di3RA/9rsX3SPYl2tFoghVNfLKeflgBYk9dQBGRjqiGiHmqcNpjhUWj9Q97wd/HQcl099tBANM26QyKNxZMMJg==","signatures":[{"sig":"MEUCIQCCpQEu9Lw1hK8Z4yRKynPdZT2oKU4znZ2jy+voQ25/twIgVolSyxwIR6biY04e/eNaxKgqeyfjAYTrAvcbaUUkVrU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":139826},"main":"./index.ts","type":"module","module":"index.ts","shasum":"a7d0e935b9a0c429b2c6d08f5b09cf29fde91c04","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:installer-audit":"bun ./example/installer-audit.ts","example:package-watcher":"bun ./example/package-watcher.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-di3RA/9rsX3SPYl2tFoghVNfLKeflgBYk9dQBGRjqiGiHmqcNpjhUWj9Q97wd/HQcl099tBANM26QyKNxZMMJg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/msi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MSI bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/msi_1.0.0_1775700031339_0.7348129291935621","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/msi","version":"1.0.1","keywords":["bun","ffi","win32","windows","msi","installer","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/msi@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"65e6ae2111b3c3f59dcc602d8c8723308bfba960","tarball":"https://registry.npmjs.org/@bun-win32/msi/-/msi-1.0.1.tgz","fileCount":6,"integrity":"sha512-jamFbzJmqPAZxX8h4xOBzIbQ/KDWAUcqSBsL8bG79W2fi882Ql6usLYh2o553wSshqThzRESEob+VEK8xkVhoQ==","signatures":[{"sig":"MEQCIEvdgF9wfxRS5i+u/5vXh0PjQVdE2m/qJyjPU5k9lmPJAiBjZw2xmUp2z9RjwbPx90cukhGzyHm42WBrZ6ZtYi71Dg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":139938},"main":"./index.ts","type":"module","module":"index.ts","shasum":"65e6ae2111b3c3f59dcc602d8c8723308bfba960","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:installer-audit":"bun ./example/installer-audit.ts","example:package-watcher":"bun ./example/package-watcher.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-jamFbzJmqPAZxX8h4xOBzIbQ/KDWAUcqSBsL8bG79W2fi882Ql6usLYh2o553wSshqThzRESEob+VEK8xkVhoQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/msi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MSI bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/msi_1.0.1_1780581913387_0.3540869527675057","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/msi","version":"2.0.0","keywords":["bun","ffi","win32","windows","msi","installer","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/msi@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"86ab2c4d3334fac502fd4b822d0460c525c151b0","tarball":"https://registry.npmjs.org/@bun-win32/msi/-/msi-2.0.0.tgz","fileCount":6,"integrity":"sha512-hcPFONVZLRiveqCYH33c1ZaJ6wPhNrthVEKrWROSi+T43IXGqgXGOm27e1KsdcXKOEFBUy52YvGDzIh5x0dp2Q==","signatures":[{"sig":"MEYCIQCKrckdFaZtjPxuYB+W0/OEENZ5yEY315adjkY/eox04wIhAIJJqu80EOfNcoUMHHlRl/tNiJbkNftKQRJzZmWqz3Pg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145481},"main":"./index.ts","type":"module","module":"index.ts","shasum":"86ab2c4d3334fac502fd4b822d0460c525c151b0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:installer-audit":"bun ./example/installer-audit.ts","example:package-watcher":"bun ./example/package-watcher.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-hcPFONVZLRiveqCYH33c1ZaJ6wPhNrthVEKrWROSi+T43IXGqgXGOm27e1KsdcXKOEFBUy52YvGDzIh5x0dp2Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/msi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MSI bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/msi_2.0.0_1782435475923_0.5885579622349606","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 MSI bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/msi","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/msi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","msi","installer","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:installer-audit":"bun ./example/installer-audit.ts","example:package-watcher":"bun ./example/package-watcher.ts"},"_id":"@bun-win32/msi@2.0.1","_integrity":"sha512-mfideg0mlqcT7+BdrsBPAScBnOWNiwtXSgqbjt3zkL6iHEYKgbtuJ6Z/lW/RiTeF67StnK54C8Q6CtlCV9jmZw==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"083ee1cc25919a74758b4b5ab9e20a8013e750d5","dist":{"integrity":"sha512-mfideg0mlqcT7+BdrsBPAScBnOWNiwtXSgqbjt3zkL6iHEYKgbtuJ6Z/lW/RiTeF67StnK54C8Q6CtlCV9jmZw==","shasum":"083ee1cc25919a74758b4b5ab9e20a8013e750d5","tarball":"https://registry.npmjs.org/@bun-win32/msi/-/msi-2.0.1.tgz","fileCount":6,"unpackedSize":145481,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBrz1Ws0iMveWx0EhU+G3aLWl+Yd4GJLAbBZ3m5g23JgAiAHbnV0wF4mDj8tVg4+QJBPT4FAzP+tSuEvC2WyvH+zBQ=="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/msi_2.0.1_1782438134430_0.3479180156862127"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T02:00:31.212Z","modified":"2026-06-26T01:42:14.722Z","1.0.0":"2026-04-09T02:00:31.480Z","1.0.1":"2026-06-04T14:05:13.541Z","2.0.0":"2026-06-26T00:57:56.058Z","2.0.1":"2026-06-26T01:42:14.602Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","msi","installer","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/msi"},"description":"Zero-dependency, zero-overhead Win32 MSI bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/msi\n\nZero-dependency, zero-overhead Win32 MSI bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/msi` exposes the `msi.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Msi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `msi.dll` (product enumeration, install state queries, database access, patching, source lists, and more).\n- In-source docs in `structs/Msi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Msi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Msi.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/msi\n```\n\n## Quick Start\n\n```ts\nimport Msi, { INSTALLSTATE } from '@bun-win32/msi';\n\n// Enumerate installed products\nconst productBuf = Buffer.alloc(78); // 39 WCHARs (GUID + NUL)\nlet index = 0;\n\nwhile (Msi.MsiEnumProductsW(index, productBuf.ptr) === 0) {\n  const productCode = new TextDecoder('utf-16le')\n    .decode(productBuf)\n    .replace(/\\0.*$/, '');\n\n  const state = Msi.MsiQueryProductStateW(\n    Buffer.from(productCode + '\\0', 'utf16le').ptr,\n  );\n\n  if (state === INSTALLSTATE.INSTALLSTATE_DEFAULT) {\n    console.log(productCode);\n  }\n\n  index++;\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:installer-audit    # Full audit of every installed product\nbun run example:package-watcher    # Live product installation monitor\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Msi.Preload()`.\n- `MSIHANDLE` is `number` (32-bit), **not** `bigint`. Do not confuse with kernel `HANDLE`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}