{"id":16090,"library":"innosetup","title":"Inno Setup Node.js Compiler Wrapper","description":"The `innosetup-compiler` package provides a Node.js wrapper for the Inno Setup Compiler (`ISCC.exe`), enabling programmatic or command-line compilation of `.iss` scripts. Currently at version 6.4.1, it primarily facilitates integrating Inno Setup compilation into Node.js-based build workflows, including CLI and Grunt tasks. Its key differentiator is cross-platform compatibility, allowing compilation on Linux and macOS environments provided Wine is installed, translating calls to the Windows-native `ISCC.exe`. This package acts as an orchestrator, executing the official Inno Setup compiler, rather than reimplementing the compiler itself, ensuring compatibility with the latest Inno Setup features. While not on a strict release cadence, it is actively maintained to support current Node.js and Inno Setup versions.","status":"active","version":"6.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/joaomoreno/node-innosetup-compiler","tags":["javascript","inno","innosetup","setup","windows","installer","gruntplugin","node","cli"],"install":[{"cmd":"npm install innosetup","lang":"bash","label":"npm"},{"cmd":"yarn add innosetup","lang":"bash","label":"yarn"},{"cmd":"pnpm add innosetup","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for running the Inno Setup compiler (ISCC.exe) on Linux and macOS platforms.","package":"wine","optional":false}],"imports":[{"note":"The package exports a function directly, primarily used with CommonJS `require()`. Direct ESM imports (e.g., `import`) will not work without a transpilation layer or explicit module resolution configuration. The common pattern is `require('innosetup-compiler')('path/to/script.iss', options, callback);`","wrong":"import compileInnoSetup from 'innosetup-compiler';","symbol":"compileInnoSetup","correct":"const compileInnoSetup = require('innosetup-compiler');"},{"note":"Install globally via `npm install -g innosetup-compiler` to use the CLI directly. All Inno Setup compiler options can be passed via command line flags (e.g., `--O=output.exe`).","symbol":"CLI","correct":"innosetup-compiler myscript.iss --gui"},{"note":"When used with Grunt, the package registers a task named `innosetup_compiler`. It is consumed by calling `loadNpmTasks`, not via direct import statements.","wrong":"import { innosetup_compiler } from 'innosetup-compiler';","symbol":"GruntTask","correct":"grunt.loadNpmTasks('innosetup-compiler');"}],"quickstart":{"code":"const compileInno = require('innosetup-compiler');\nconst path = require('path');\n\nconst scriptPath = path.join(__dirname, 'my-installer.iss');\n\n// Example .iss content for my-installer.iss (save this file next to your script)\n// [Setup]\n// AppName=My Awesome App\n// AppVersion=1.0\n// DefaultDirName={autopf}\\My Awesome App\n// FileName=MyAppSetup.exe\n// OutputBaseFilename=MyAppInstaller\n// compression=lzma2\n// SolidCompression=yes\n// PrivilegesRequired=admin\n// SourceDir=.\\\n// [Files]\n// Source: \"MyApp.exe\"; DestDir: \"{app}\"\n\ncompileInno(scriptPath, {\n    gui: false,\n    verbose: true,\n    O: path.join(__dirname, 'output'), // Specifies output directory\n    signtoolname: 'signtool',\n    signtoolcommand: '\"C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\bin\\\\10.0.19041.0\\\\x64\\\\signtool.exe\" sign /f \"C:\\\\absolute\\\\path\\\\to\\\\mycertificate.pfx\" /t http://timestamp.digicert.com /p \"MY_PASSWORD\" $f'\n}, function(error) {\n    if (error) {\n        console.error('Inno Setup compilation failed:', error);\n        process.exit(1);\n    } else {\n        console.log('Inno Setup compilation successful!');\n        console.log(`Installer saved to: ${path.join(__dirname, 'output', 'MyAppInstaller.exe')}`);\n    }\n});","lang":"javascript","description":"This quickstart demonstrates how to compile an Inno Setup script (`my-installer.iss`) using the Node.js API, including options for verbose output, specifying an output directory, and configuring code signing with a placeholder command. It includes error handling for the compilation process."},"warnings":[{"fix":"Ensure Wine is properly installed and configured on your system. For macOS users, `brew install wine --devel` is often recommended to get the latest development version.","message":"Running `innosetup-compiler` on non-Windows operating systems (Linux, macOS) requires a working installation of Wine to execute the Windows-native `ISCC.exe` compiler.","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"Set `gui: false` for automated, headless compilation where all options are controlled programmatically. Only use `gui: true` if manual intervention and visual feedback from the Inno Setup compiler GUI are explicitly desired.","message":"When the `gui` option is set to `true`, `innosetup-compiler` will launch `Compil32.exe` (the Inno Setup GUI compiler), and all other programmatic options passed to the function will be ignored. The user must manually interact with the GUI.","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"Double escape backslashes in JavaScript string literals: `\"C:\\\\absolute\\\\path\\\\to\\\\mycertificate.pfx\"`. Alternatively, use forward slashes if the underlying tool supports them or leverage Node.js `path` module for cross-platform path construction, though `signtoolcommand` typically expects Windows-style paths.","message":"When defining `signtoolcommand` or other paths in JavaScript strings, especially for Windows paths, backslashes must be escaped with an additional backslash (e.g., `C:\\\\path\\\\to\\\\file.pfx`).","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"None required for functionality, but be aware that behavior with very recent Node.js features might be untested. Consider contributing to update the `engines` field if compatibility is verified for newer Node.js LTS versions.","message":"The package's `engines.node` specifies `>=0.8.0`. While it may still function on modern Node.js versions, this outdated engine declaration might indicate a lack of testing or specific optimizations for newer Node.js features (e.g., native ESM).","severity":"deprecated","affected_versions":">=0.8.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Update Wine to the latest development version using Homebrew: `brew update && brew install wine --devel`.","cause":"An outdated or unstable version of Wine on macOS is attempting to run the Inno Setup compiler, leading to an application launch failure.","error":"err:macdrv:process_attach Failed to start Cocoa app main loop"},{"fix":"Ensure all Inno Setup compiler options passed via the Node.js API or CLI are provided without the leading slash (e.g., `{ O: 'output/directory' }` for Node.js, or `--O=output/directory` for CLI) as the wrapper adds it automatically. Review the official Inno Setup Command Line Compiler Execution documentation for valid parameters.","cause":"Inno Setup compiler options are being passed incorrectly, specifically with a leading slash `/O=` instead of without for this wrapper's API.","error":"Error: Command failed: C:\\Program Files (x86)\\Inno Setup 6\\ISCC.exe \"path\\to\\my\\script.iss\" [...] /O=\"output\\directory\"\n[...] Error on line X: Unknown parameter 'O'."}],"ecosystem":"npm"}