Inno Setup script examples: a complete .iss file and the snippets you'll need

A complete Inno Setup script you can copy, followed by a short example for each thing people get stuck on. It covers AppId, per-user installs, 64-bit mode, shortcuts, the uninstall icon, file associations, signing, a license key page and compiling from the command line.

A blank card propped against a row of small jars with blank labels

Inno Setup turns a text file into a Windows installer. The text file is the script, it ends in .iss, and it's made of sections like [Setup], [Files] and [Icons]. You describe what should be installed, and the Inno Setup compiler builds a single setup program from it.

This page starts with a complete script, then gives a short example for each job you're likely to need next.

Every directive, flag and function here was checked against the Inno Setup documentation on November 26, 2026, when the current releases were 7.1.1 and 6.7.4. The examples follow the official sample scripts and the script that Inno Setup's own wizard writes.

A complete script you can copy

This installs a 64-bit app for the current user, with a Start menu shortcut, an optional desktop shortcut, and a checkbox to launch the app at the end. Save it as MyApp.iss next to a build folder that holds your app's files.

; MyApp.iss
#define MyAppName "My App"
#define MyAppVersion "1.4.0"
#define MyAppPublisher "My Company"
#define MyAppExe "MyApp.exe"

[Setup]
; Generate your own GUID once, and never change it after your first release
AppId={{8C2F1E5A-3B7D-4E2A-9F61-0A1B2C3D4E5F}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL=https://example.com
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\{#MyAppExe}
; Install for the current user, with no administrator prompt
PrivilegesRequired=lowest
; A 64-bit app: run only where x64 code runs, and install in 64-bit mode
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
OutputDir=dist
OutputBaseFilename=MyApp-{#MyAppVersion}-setup

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExe}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExe}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent

Three things to change before you use it:

  • The GUID in AppId. Make a new one. In PowerShell, [guid]::NewGuid() prints one. The UUID generator makes one in the browser. Keep the doubled {{ at the start: a single { starts a constant, so a literal one has to be written twice
  • The four #define lines at the top
  • The build\* path, which is relative to the folder the script is in

The #define lines belong to the preprocessor, which is built in. {#MyAppName} is replaced with the value before the script is compiled, so you only type the name and version once.

If your app is 32-bit, delete the two Architectures lines.

The Inno Setup compiler

"Inno Setup Compiler" is the name of two programs that do the same job:

  • The Compiler IDE, the editor you get when you open Inno Setup. Open your .iss file and compile it there. It also has a wizard that writes a starter script for you
  • ISCC.exe, the command-line compiler, for build scripts and CI. There's a section on it further down

The current releases are Inno Setup 7.1.1 and 6.7.4, both dated October 28, 2026. The download page recommends version 7, which comes in a 64-bit and a 32-bit edition. Either edition can build 32-bit or 64-bit installers, and version 7 can be installed alongside version 6. The scripts on this page use only directives that both versions document.

Inno Setup is free to download and use. Its authors ask commercial users to buy a license to fund development.

The [Setup] lines that matter

AppId

AppId={{8C2F1E5A-3B7D-4E2A-9F61-0A1B2C3D4E5F}

AppId is how Setup recognises that your app is already installed. A new installer with the same AppId upgrades the existing install: same folder, same entry in Windows' list of installed apps. Change it, and your update installs a second copy next to the first.

It's never shown to anyone, so a GUID is a good choice. If you leave it out, it defaults to AppName, which means renaming your app would break upgrades. Set it explicitly from your first release.

AppName, AppVersion and AppVerName

AppName=My App
AppVersion=1.4.0

AppName is the name without a version number. AppVersion is the version shown in the Version column of Windows' installed apps list.

AppVerName is the name and version together. You don't need to set it: it defaults to AppName followed by AppVersion, so the two lines above give you "My App 1.4.0". That combined text is the title of your app's uninstall entry, and it's what Setup's window title shows.

Set AppVerName yourself only when you want different wording:

AppVerName=My App 1.4 beta

One of AppVersion and AppVerName has to be present. Use AppVersion, and let the other follow from it.

Where it installs

DefaultDirName={autopf}\My App

{autopf} is Program Files for an all-users install, and the current user's own programs folder for a per-user install. The "auto" constants switch by themselves, which is why the documentation recommends them: {autoprograms} for the Start menu, {autodesktop} for the desktop, {autoappdata} for application data.

When someone upgrades, Setup reuses the folder they chose the first time. That's UsePreviousAppDir, and it's on by default.

The output file

OutputDir=dist
OutputBaseFilename=MyApp-1.4.0-setup

Without these you get Output\mysetup.exe. Don't name the file plain setup: the documentation warns that Windows treats every setup.exe specially, in a way that loads extra DLLs unsafely.

Compression

Compression=lzma2
SolidCompression=yes

lzma2 is already the default, at its max level. SolidCompression=yes compresses all files as one stream, which makes installers with many similar files a lot smaller. The cost is that Setup can't jump straight to a single file, so it's a little slower.

Install for one user or for everyone

PrivilegesRequired=lowest
Setting Asks for administrator rights Installs to
PrivilegesRequired=admin (the default) Yes, every time Program Files, for all users
PrivilegesRequired=lowest No The current user's profile

A per-user install has no administrator prompt, which also means none when your app updates itself. That's the main reason to choose it.

To let the person installing decide, add one line:

PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog

Setup then asks whether to install for everyone or just for them. Allowing dialog also accepts two command-line switches, /ALLUSERS and /CURRENTUSER, which is what an IT department wants.

In a per-user install your script must not write anywhere that needs administrator rights. Use HKA in [Registry] and the "auto" constants for folders, and the same script works in both modes.

64-bit apps

ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible

The first line stops Setup from running on a system that can't run your code. The second makes it use the real 64-bit Program Files folder and the 64-bit view of the registry.

x64compatible matches x64 Windows, and also Windows 11 on Arm, which runs x64 apps through emulation. For a build compiled for Arm, use arm64.

Older scripts say x64 here. Since Inno Setup 6.3 that's a deprecated alias for x64os, which matches only true x64 Windows. x64compatible is the one you want for a normal app.

Adding files

[Files]
Source: "build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "docs\Readme.txt"; DestDir: "{app}"; Flags: isreadme
Source: "defaults\settings.json"; DestDir: "{localappdata}\My App"; Flags: onlyifdoesntexist uninsneveruninstall
Flag What it does
ignoreversion Replaces the existing file without comparing version numbers. Use it for your own files, never for shared system files
recursesubdirs Includes subfolders
createallsubdirs Creates empty subfolders too. Only valid with recursesubdirs
onlyifdoesntexist Installs the file only if it isn't there yet. Good for a default settings file you don't want an update to overwrite
uninsneveruninstall Leaves the file behind when the app is uninstalled
isreadme Offers to open the file on the last page of the wizard
deleteafterinstall Installs the file, then deletes it when Setup finishes. For helpers that are only run during install

Shortcuts, tasks and the uninstall icon

Start menu and desktop shortcuts

[Icons]
Name: "{autoprograms}\My App"; Filename: "{app}\MyApp.exe"
Name: "{autodesktop}\My App"; Filename: "{app}\MyApp.exe"; Tasks: desktopicon

The first line puts a shortcut straight into the Start menu. With DisableProgramGroupPage=yes in [Setup], the wizard skips the page that asks for a Start menu folder, which most apps don't need.

If you'd like a folder with several shortcuts, set DefaultGroupName and use {group}:

[Setup]
DefaultGroupName=My App

[Icons]
Name: "{group}\My App"; Filename: "{app}\MyApp.exe"
Name: "{group}\Uninstall My App"; Filename: "{uninstallexe}"

Tasks, and what Flags: unchecked does

A task is a checkbox on the wizard's "Select Additional Tasks" page. On its own it does nothing. Other entries opt in to it with a Tasks: parameter, as the desktop shortcut above does.

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "startup"; Description: "Start My App when I sign in"; Flags: unchecked

Flags: unchecked means the box starts empty, and the person has to tick it. Without the flag, the box starts ticked. Related flags:

  • checkedonce starts ticked on a first install and unticked when Setup finds an earlier version already installed
  • exclusive turns sibling tasks into radio buttons, so only one can be chosen

{cm:CreateDesktopIcon} and {cm:AdditionalIcons} are built-in messages, so the text is translated when you add languages.

The icon in Windows' installed apps list

[Setup]
UninstallDisplayIcon={app}\MyApp.exe

This sets the icon shown next to your app in "Installed apps" and in the old "Programs and Features" Control Panel. It can point to an .exe or an .ico. If the file holds several icons, add an index: {app}\MyApp.exe,1. Leave the line out and Windows picks an icon itself, which may not be the one you want.

The icon of the installer file is a separate setting:

SetupIconFile=installer.ico

The documentation recommends an icon with 16, 32, 48, 64 and 256 pixel sizes. The ICO converter makes one from a PNG or SVG.

Launch the app when Setup finishes

[Run]
Filename: "{app}\MyApp.exe"; Description: "{cm:LaunchProgram,My App}"; Flags: nowait postinstall skipifsilent
  • postinstall adds a "Launch My App" checkbox to the last page. The app is started as the user who launched Setup, not as administrator
  • nowait lets Setup close without waiting for your app to exit
  • skipifsilent skips the entry when the installer runs silently. Add unchecked if you want the box to start empty

To open a document or a web page, add shellexec, which is required for anything that isn't an .exe.

Show a license agreement

[Setup]
LicenseFile=license.txt

Setup shows the file, plain text or RTF, before the folder page, and the person has to accept it to continue. If you don't have one yet, our EULA template gives you a starting point.

Clean up on uninstall

The uninstaller removes what Setup installed. Files your app created later, like a cache or logs, stay unless you list them:

[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\My App\Cache"
Type: dirifempty; Name: "{localappdata}\My App"

filesandordirs deletes the folder and everything in it. dirifempty removes a folder only when nothing is left inside. Be careful about deleting people's settings or documents: someone who uninstalls to fix a problem and reinstalls will expect them back.

Registry entries

A file association

[Setup]
ChangesAssociations=yes

[Registry]
Root: HKA; Subkey: "Software\Classes\.myp\OpenWithProgids"; ValueType: string; ValueName: "MyAppFile.myp"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\MyAppFile.myp"; ValueType: string; ValueName: ""; ValueData: "My App File"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\MyAppFile.myp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyApp.exe,0"
Root: HKA; Subkey: "Software\Classes\MyAppFile.myp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyApp.exe"" ""%1"""

HKA is the root that follows the install mode: HKEY_LOCAL_MACHINE for an all-users install, HKEY_CURRENT_USER for a per-user one. ChangesAssociations=yes tells Explorer to refresh, so the new icon shows up without signing out.

Registry entries aren't removed on uninstall unless you add an uninsdelete flag, as the first two lines do.

A custom URL protocol

This makes links that start with myapp:// open your app, which is handy for sign-in callbacks and "open in app" links:

[Registry]
Root: HKA; Subkey: "Software\Classes\myapp"; ValueType: string; ValueName: ""; ValueData: "URL:My App"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\myapp"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""
Root: HKA; Subkey: "Software\Classes\myapp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyApp.exe"" ""%1"""

The empty URL Protocol value is the part that marks the key as a protocol handler. Treat whatever arrives in %1 as untrusted input: any web page can make that link.

Adding your app to PATH

[Setup]
ChangesEnvironment=yes

[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath(ExpandConstant('{app}'))

[Code]
function NeedsAddPath(Dir: String): Boolean;
var
  Paths: String;
begin
  if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Paths) then
    Result := True
  else
    Result := Pos(';' + UpperCase(Dir) + ';', ';' + UpperCase(Paths) + ';') = 0;
end;

{olddata} stands for the value that's already there, so the line appends to the user's PATH. The Check function stops a second install from adding the folder twice.

Don't put an uninsdeletevalue flag on this entry. It would delete the user's whole PATH on uninstall, not only your folder.

Install a prerequisite

Bundle the prerequisite's installer, extract it to Setup's temporary folder, and run it only when it's needed. This example installs the Visual C++ runtime for an x64 app:

[Files]
Source: "redist\vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: VCRuntimeMissing

[Run]
Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing the Visual C++ runtime..."; Check: VCRuntimeMissing

[Code]
function VCRuntimeMissing: Boolean;
begin
  Result := not RegKeyExists(HKLM32, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64');
end;

The registry key is the one Microsoft documents for the runtime. This check only tests that some version is installed. If your app needs a minimum version, read the Version value in that key and compare. Microsoft's installer also refuses to replace a newer runtime with an older one, so running it when it isn't needed does no harm.

The runtime's installer needs administrator rights, so this pattern fits an all-users install best.

Current versions of Inno Setup also have a download flag for [Files], which fetches a file during installation so you don't have to bundle it.

Close the running app before an update

[Setup]
CloseApplications=yes
RestartApplications=yes
AppMutex=MyAppIsRunning

CloseApplications is on by default. When Setup finds that a running program holds a file it needs to replace, it offers to close that program, using the Windows Restart Manager. In a silent install it closes it without asking. force closes it even if it has unsaved work, so use that one with care.

RestartApplications starts the app again afterwards, but only if your app registered for restart with the Windows RegisterApplicationRestart function.

AppMutex is a second line of defence. Your app creates a named mutex when it starts. While that mutex exists, Setup and the uninstaller tell the person the app is running and ask them to close it:

CreateMutex(NULL, FALSE, "MyAppIsRunning");

The name is case sensitive. The page on Inno Setup auto updates covers the full update flow that these settings support.

Sign the installer and the uninstaller

Windows warns people before it runs an unsigned installer. Signing the finished setup.exe by hand isn't enough: the uninstaller inside it stays unsigned, and so do the temporary copies of itself that Setup runs. The documentation notes that security software can block those copies and stop the installer from starting.

Let the compiler do the signing. Name a sign tool in the script:

[Setup]
SignTool=mysign

Then define what mysign runs. In the Compiler IDE that's under Tools, then Configure Sign Tools. On the command line, pass it to the compiler:

iscc '/Smysign=signtool.exe sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /a $f' MyApp.iss

$f is replaced with the file being signed, and it's required. Use single quotes in PowerShell so that $f reaches the compiler untouched. If the command itself needs quotes, write $q for each one.

With a sign tool set, Inno Setup signs the installer, the uninstaller and its temporary copies. To sign your own executables during the same build, add a flag in [Files]:

[Files]
Source: "build\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion signonce

signonce signs the source file unless it's already signed.

The signing command is ordinary SignTool, so anything that works there works here, including Azure Trusted Signing. If you're still choosing a certificate, the page on EV code signing certificates explains what you get for the money.

Take the version number from your exe

Typing the version in two places is how installers end up labelled with the wrong one. The preprocessor can read it from the file you're shipping:

#define MyAppVersion GetVersionNumbersString(AddBackslash(SourcePath) + "build\MyApp.exe")

[Setup]
AppVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
OutputBaseFilename=MyApp-{#MyAppVersion}-setup

GetVersionNumbersString returns the file version in four parts, such as 1.4.0.0. SourcePath is the folder the script is in. VersionInfoVersion stamps the same number into the installer's own file properties.

To pass the version in from a build script, define it on the command line and give the script a fallback:

#ifndef MyAppVersion
  #define MyAppVersion "0.0.0"
#endif
iscc /DMyAppVersion=1.4.0 MyApp.iss

Ask for a license key during install

If you sell your app, you can collect the customer's license key in the installer so they don't have to type it on first launch. This adds a page after the folder page and saves what was entered where your app can read it:

[Registry]
Root: HKCU; Subkey: "Software\My Company\My App"; ValueType: string; ValueName: "LicenseKey"; ValueData: "{code:GetLicenseKey}"; Check: HasLicenseKey

[Code]
var
  KeyPage: TInputQueryWizardPage;

procedure InitializeWizard;
begin
  KeyPage := CreateInputQueryPage(wpSelectDir,
    'License key', 'Enter the key from your purchase email',
    'Paste your license key and click Next. Leave it empty to enter it later in the app.');
  KeyPage.Add('License key:', False);
  { Lets a silent install pass the key as /LICENSEKEY=XXXXX }
  KeyPage.Values[0] := ExpandConstant('{param:LICENSEKEY|}');
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = KeyPage.ID then
    KeyPage.Values[0] := Trim(KeyPage.Values[0]);
  Result := True;
end;

function HasLicenseKey: Boolean;
begin
  Result := KeyPage.Values[0] <> '';
end;

function GetLicenseKey(Param: String): String;
begin
  Result := KeyPage.Values[0];
end;

Notice what this does and doesn't do. It collects the key and hands it to your app. It doesn't decide whether the key is valid.

That's deliberate. Anything the installer checks can be read out of the installer, and a check that runs once at install time says nothing about a refund next week. Validate the key in the app itself, against your licensing server, each time it matters. The installer page is a convenience on top.

Two smaller points. The key is stored as plain text in the user's registry, which is fine for a key the customer already has in their inbox. And if you need test keys while you build this, the license key generator makes them.

Check whether the app is already installed

Setup records each install under a registry key named after your AppId with _is1 on the end. You can look for it in [Code]:

[Code]
function IsUpgrade: Boolean;
begin
  Result := RegKeyExists(HKEY_AUTO,
    'Software\Microsoft\Windows\CurrentVersion\Uninstall\{8C2F1E5A-3B7D-4E2A-9F61-0A1B2C3D4E5F}_is1');
end;

HKEY_AUTO looks in the place that matches the current install mode. Inside a [Code] string the GUID has single braces, because constants aren't expanded there.

To test for a file instead, there's FileExists(ExpandConstant('{app}\MyApp.exe')).

Compile from the command line and in CI

iscc MyApp.iss
iscc /Qp /O"dist" /F"MyApp-1.4.0-setup" MyApp.iss
Option Meaning
/O"path" Output folder. Overrides OutputDir
/F"name" Output file name, without .exe. Overrides OutputBaseFilename
/Dname=value Defines a preprocessor variable, like #define
/Sname=command Defines a sign tool
/Q Quiet. /Qp is quiet but still shows progress

The compiler exits with 0 on success, 1 if the options were wrong, and 2 if the compile failed, so a build script can stop on an error.

These slash options work in Inno Setup 6 and 7. Version 7 also accepts longer names, such as --output-dir= and --define=.

GitHub Actions

GitHub's Windows runners come with Inno Setup installed and iscc on the PATH. At the time of writing that's version 6.7.1:

jobs:
  installer:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      # build your app into the build folder here
      - name: Build the installer
        run: iscc /Qp MyApp.iss
      - uses: actions/upload-artifact@v4
        with:
          name: installer
          path: dist/*.exe

On your own build machine, install it first. The download page gives the winget IDs: JRSoftware.InnoSetup.7 for version 7 and JRSoftware.InnoSetup for version 6.

Signing in CI needs your certificate available to the runner, which is easier with a cloud signing service than with a hardware token.

After the installer

The installer is one step of shipping. The ones that follow:

  • Silent installs. Companies deploy with no wizard. The switches are on the silent install switches page
  • Updates. Inno Setup doesn't check for new versions. Inno Setup auto updates shows how apps installed this way update themselves
  • The format question. If a customer's IT department asks for an MSI, MSI vs EXE explains what they're asking for, and MSIX covers Microsoft's newer package format

If you're selling the app, you'll also need license keys. LicenseSeat issues a key for each sale and gives you an SDK for C#, C++, Swift or JavaScript to validate it inside your app. From the Starter plan it also hosts your releases and serves the update feed. It charges a flat monthly fee and takes 0% of your revenue.

Common questions about Inno Setup scripts

What is an .iss file?

An Inno Setup script. It's a plain text file, arranged in sections such as [Setup], [Files] and [Icons], that describes what your installer should do. The Inno Setup compiler reads it and produces the setup program.

What is the difference between AppName, AppVersion and AppVerName?

AppName is the name alone and AppVersion is the version alone. AppVerName is both together and defaults to "AppName AppVersion". Set the first two and leave AppVerName out, unless you want different wording in the uninstall entry.

What does Flags: unchecked do in Inno Setup?

On a [Tasks] entry it makes the checkbox start unticked, so the person installing has to opt in. On a [Run] entry with postinstall it does the same for the checkbox on the last page. Without the flag, both start ticked.

How do I set the icon shown in Control Panel for my app?

Add UninstallDisplayIcon={app}\MyApp.exe to [Setup]. It controls the icon next to your app in Windows' installed apps list. SetupIconFile is a different setting: it's the icon of the installer file itself.

Why does my new installer install a second copy?

Usually because AppId changed, or was never set and the app's name changed. It also happens when the new installer runs in a different mode from the old one: all users instead of per user, or 64-bit instead of 32-bit. Setup treats those as different applications.

How do I make an Inno Setup installer that doesn't need administrator rights?

Set PrivilegesRequired=lowest, use {autopf} for the install folder, and use HKA for registry entries. Setup then installs into the user's profile and never shows a User Account Control prompt.

How do I compile an Inno Setup script from the command line?

Run iscc MyApp.iss. ISCC.exe is in the Inno Setup install folder. Add /O for the output folder, /F for the file name and /D to define preprocessor variables.

Can Inno Setup build a 64-bit installer?

Yes. Set ArchitecturesAllowed=x64compatible and ArchitecturesInstallIn64BitMode=x64compatible and Setup installs into the 64-bit Program Files folder and uses the 64-bit registry. Inno Setup 7 can also build the setup program itself as a 64-bit executable.

Can I check a license key in the installer?

You can collect one with a custom wizard page. Don't rely on the installer to judge it: installer checks are easy to bypass and only run once. Store the key and have the app validate it.

Is Inno Setup free for commercial use?

It's free to download and use, including for commercial software. Its authors ask commercial users to buy a license to support development.