Best Practices for Building nLite Addons with Inno Setup: Tips and Examples

Inno Setup nLite Addon: Simplify Silent Windows Installs with nLite Integration

Automating Windows installs for multiple machines saves time and reduces errors. Combining Inno Setup’s powerful installer scripting with nLite’s unattended Windows customization creates a streamlined workflow for creating silent, deployable Windows setups. This guide explains what the Inno Setup nLite Addon does, when to use it, and gives a practical step‑by‑step example to produce a single, silent installer that integrates customized Windows files, drivers, and post‑installation tasks.

What the Inno Setup nLite Addon does

  • Integrates nLite output into Inno Setup packages. It takes an nLite‑customized Windows source (slipstreamed files, drivers, tweaks, and unattended answer files) and packages it so Inno Setup can extract and apply it during installation.
  • Enables silent or unattended installations. By combining nLite’s unattended answer files (e.g., unattend.xml) with Inno Setup’s silent install switches, you can perform fully unattended Windows deployments.
  • Automates post‑setup actions. Run scripts, install drivers, apply registry tweaks, and copy files after Windows setup completes using Inno Setup’s scripting and nLite’s customization points.

When to use this approach

  • Deploying the same Windows image to multiple machines without user interaction.
  • Adding drivers, updates, or OEM customizations to stock Windows media.
  • Creating an installable package that prepares a machine (OS files + post‑install configuration) from within Windows or a recovery environment.

Requirements

  • nLite (for Windows XP/2003) or a similar slipstreaming tool if targeting older Windows — ensure compatibility with your target OS.
  • Inno Setup (current stable release).
  • The Inno Setup nLite Addon (or custom scripts that perform extraction and deployment).
  • A working Windows installation source (ISO or extracted files) and any drivers/updates you want to include.
  • Optional: tools for creating bootable media if you plan to use pre‑installation environments.

High‑level workflow

  1. Customize Windows source with nLite (add drivers, remove components, set unattended options).
  2. Export nLite output (a customized Windows installation folder or ISO).
  3. Create an Inno Setup script that includes the nLite output as files to deploy.
  4. Use Inno Setup to build a self‑extracting installer that runs silently and applies the nLite customizations.
  5. Deploy the resulting installer on target machines (via USB, network share, or remote tools).

Example: Build a silent installer that applies nLite customizations

This example assumes you have a customized Windows source folder from nLite named “WinCustom” and want an Inno Setup installer that extracts the files to C:\WinInstall and runs a scripted setup.

Files to prepare
  • WinCustom\ (nLite output)
  • SetupWrapper.iss (Inno Setup script)
  • postinstall.cmd (commands to run after extraction; e.g., copying files, invoking unattended setup)
Key Inno Setup script snippets
  • Include the nLite output in the [Files] section so it’s bundled.
  • Use [Run] to execute postinstall.cmd silently.
  • Use setup switches (/VERYSILENT /SUPPRESSMSGBOXES /NORESTART) when invoking the installer for unattended runs.

Example Inno Setup sections (conceptual — adapt paths and names):

Code

[Setup] AppName=WinCustom Installer AppVersion=1.0 DefaultDirName={tmp}\WinInstall DisableDirPage=yes DisableProgramGroupPage=yes OutputBaseFilename=WinCustom_Installer Compression=lzma[Files] Source: “WinCustom*”; DestDir: “{tmp}\WinInstall”; Flags: recursesubdirs createallsubdirs

[Run] Filename: “{tmp}\WinInstall\postinstall.cmd”; Parameters: “”; Flags: runhidden; StatusMsg: “Applying Windows customizations…”

postinstall.cmd might:

  • Copy files to the Windows installation path or to a USB drive.
  • Launch the Windows setup from the extracted files with unattended switches (e.g., setup.exe /unattend:winnt.sif or use the nLite‑generated answer file).
  • Schedule tasks or place scripts into %windir%\Setup\Scripts for post‑setup actions.
Building and deploying
  1. Compile the Inno Setup script to produce a single EXE.
  2. Transfer EXE to target machine.
  3. Run EXE directly or via network deployment tools with silent switches if desired:
    • To run silently: WinCustom_Installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

Tips and best practices

  • Test in a VM first. Always verify your combined process in a virtual machine before mass deployment.
  • Keep unattended files current. Ensure unattend/answer files match the Windows version and edition.
  • Minimize installer size. Remove unwanted components from the nLite source and use LZMA compression in Inno Setup.
  • Handle drivers carefully. Use signed drivers where possible and verify driver paths in nLite.
  • Use logging. Have postinstall scripts log actions to a file for troubleshooting.
  • Manage reboots. Coordinate reboot behavior between Inno Setup and Windows setup to avoid interrupted flows.

Troubleshooting common issues

  • Installer extracts but Windows setup fails: check unattend file paths and permissions.
  • Drivers not installed: ensure drivers are integrated properly into nLite or use pnputil/DPInst in postinstall scripts.
  • Long extraction times: use temporary extraction on a fast local drive (e.g., {tmp}) and ensure adequate disk space.

Summary

Using the Inno Setup nLite Addon combines two powerful tools to produce self‑contained, silent Windows deployment packages. Customize Windows with nLite, bundle the result with Inno Setup, and automate installation and post‑setup configuration with scripts and unattended files. Test thoroughly, keep files updated, and use logging to streamline large deployments.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *