As developers, we always want to pack more value into our software. Better textures, richer audio and larger datasets. But, it all adds up, and eventually your single Setup.exe can grow to several gigabytes. And, If you've ever tried to distribute a massive application, you know that a single 50 GB installer file isn't always practical.
Gigantic installers create real problems like: users may have to restart huge downloads if their connection drops, FAT32 drives can’t store files larger than 4 GB, free cloud hosting often limits individual file size, and in rare cases you might still need to ship software across multiple discs.
Fortunately, Inno Setup, one of the most robust free installer tools available, provides a built-in solution: Disk Spanning. This feature automatically splits a large application into a main executable (Setup.exe) and multiple data files (Setup-1.bin, Setup-2.bin, and so on), each capped to a size you choose, making distribution far more reliable and flexible.
And this guide will walk you through enabling disk spanning, controlling the size of your installer parts, and customizing the user experience.
What is Inno Setup?
Inno Setup is one of the most popular tools for creating Windows installers. It is free, open-source, and uses a text-based script (.iss file) to define how your application should be installed. It handles everything from creating registry keys to creating shortcuts, and crucially for us, it supports Disk Spanning.
What is Disk Spanning?
Disk Spanning is a feature that automatically splits your installer's data into multiple parts instead of bunching them into one giant executable. By default, Inno Setup compresses all your files into one Setup.exe. But when disk spanning is enabled, Inno Setup changes this behavior and generates:
- Setup.exe (The main launcher)
- Setup-1.bin, Setup-2.bin, etc. (The data files)
The user runs the Setup.exe, and Inno Setup automatically detects the Setup-XX.bin files sitting next to it and installs them seamlessly.
Step 1: Create Your Basic Script
To enable this, first you need a basic Inno Setup script. You can generate one using the Script Wizard (File > New) which walks you through adding your Application Name, Version, and main executable. Skip this step, if you already have a script for your application.
Step 2: Enable Disk Spanning
To turn on disk spanning, you simply need to add the DiskSpanning directive to the [Setup] section of your script and set it to yes. This is the master switch, setting this tells Inno Setup:- If the total size of the files exceeds a certain amount, start chopping it up into separate .bin files.
[Setup]
...
DiskSpanning=yes
...
If you compile your script now, Inno Setup will try to split the files based on default media sizes (like CD-ROMs). However, you likely want more control over the size of each chunk.
Step 3: Customize the Slice Size
If you aren't using physical CDs or DVDs, you probably want to define a specific file size for each part (like 1 GB per part). You can control this using the DiskSliceSize directive. This directive tells Inno Setup exactly how big those chunks should be.
The value must be provided in bytes. So, You need to convert your desired target size into bytes. The formula is: MB x 1024 x 1024 = Bytes. As an example, to split files into roughly 1 GB chunks:
[Setup]
...
DiskSpanning=yes
; 1024 * 1024 * 1024 = 1073741824 bytes (1 GB)
DiskSliceSize=1073741824
...
Note: The default behavior often assumes you are burning to disks, so it might ask for Disk 2 during installation. To make this smoother for digital downloads, ensure all .bin files are in the same folder as Setup.exe when the user runs the installer.
The Code
Here is a complete example of a [Setup] section configured for 1 GB chunks:
[Setup]
AppName=My Massive App
AppVersion=1.5
DefaultDirName={autopf}\My Massive App
DefaultGroupName=My Massive App
OutputDir=C:\Installer\Output
OutputBaseFilename=Setup
; --- DISK SPANNING SETTINGS ---
; 1. Enable disk spanning
DiskSpanning=yes
; 2. Set the slice size (1 GB calculated in bytes)
; Inno Setup will create new .bin files once a file hits this limit.
DiskSliceSize=1073741824
; Keep 1 slice per "disk" for simplicity (default)
SlicesPerDisk=1
; --- VISUALS & COMPRESSION ---
; Best compression (LZMA2 is great for large files)
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
Step 4: Customizing the Insert Disk Message
The default message usually says "Please insert Disk 2...". But, if you are distributing this via USB or a cloud download, the word Disk might confuse users. You can change this text using the [Messages] section:
[Messages]
; %1 is the disk number (e.g., "2")
SetupNeedsNextDisk=Please locate Part %1 of the installation files.
Now, instead of asking for a Disk, it asks users to locate the next Part, which feels much more natural for a multi-part digital download.
Step 5: Compile the Script
Press Compile (or Ctrl+F9) to run the compiler. If your source files are large enough to trigger the spanning, then in your output folder, instead of a single massive Setup.exe, you will now see something like this:
- Setup.exe (Small executable, contains the logic)
- Setup-1.bin (First 1 GB of data)
- Setup-2.bin (Next 1 GB of data)
- Setup-3.bin (And so on.....)
How it Works for the End User
-
For Digital Downloads: If distributing online, clearly instruct the users that they must download all the files (.exe and all .bin files) and place them in the same folder. When they run the Setup.exe, Inno Setup automatically detects the Setup-XX.bin files sitting next to it and installs seamlessly without prompting.
-
For Physical Media (CD/DVD): If you burn these onto separate discs, the installer will run from Disk 1. And when it needs data from Setup-2.bin, it will eject the tray and prompt the user: "Please insert Disk 2 that contains the file Setup-2.bin."
Pro Tips & Best Practices
-
Always use Bytes: Triple-check your math when setting DiskSliceSize.
-
Test the Install: Don't just compile and assume it works, always test your installer. Copy the output files to a different drive or try installing it on a VM to ensure the spanning logic holds up. Also try moving Setup-2.bin to a different folder than Setup.exe, then Run the installer and ensure it correctly prompts you to find the missing file.
-
ReserveBytes: If you are burning to physical media, you might need space on the first disk for other files (like a Readme.txt or autorun.inf). Use the ReserveBytes directive to force the first .bin file to be smaller, leaving room for your extras.
[Setup] ; Reserve 1MB on the first disk ReserveBytes=1048576 -
SolidCompression: In older versions, people advised against SolidCompression for multi-disk setups because a read error on Disk 2 could ruin the whole install. However, with modern reliability, SolidCompression=yes is generally fine and highly recommended to keep file sizes down.
Final Thoughts
Disk spanning in Inno Setup is a powerful legacy feature that has found new life in the age of cloud storage limits. By using it, you ensure that even your largest applications remain accessible and easy to deploy, regardless of distribution medium or bandwidth limitations. This ensures your users don't have to struggle with massive single-file downloads and allows for easier distribution on limited-capacity media.
Last updated on December 8, 2025