Inno Setup Node.js Compiler Wrapper

6.4.1 · active · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

const compileInno = require('innosetup-compiler');
const path = require('path');

const scriptPath = path.join(__dirname, 'my-installer.iss');

// Example .iss content for my-installer.iss (save this file next to your script)
// [Setup]
// AppName=My Awesome App
// AppVersion=1.0
// DefaultDirName={autopf}\My Awesome App
// FileName=MyAppSetup.exe
// OutputBaseFilename=MyAppInstaller
// compression=lzma2
// SolidCompression=yes
// PrivilegesRequired=admin
// SourceDir=.\
// [Files]
// Source: "MyApp.exe"; DestDir: "{app}"

compileInno(scriptPath, {
    gui: false,
    verbose: true,
    O: path.join(__dirname, 'output'), // Specifies output directory
    signtoolname: 'signtool',
    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'
}, function(error) {
    if (error) {
        console.error('Inno Setup compilation failed:', error);
        process.exit(1);
    } else {
        console.log('Inno Setup compilation successful!');
        console.log(`Installer saved to: ${path.join(__dirname, 'output', 'MyAppInstaller.exe')}`);
    }
});

view raw JSON →