Inno Setup #pascal #utils #tools #setup

Martijn Laan 460a3fa18c Merge branch 'gotofile' 7 hodín pred
.github 46fbcb551f Setting BDS appears to be needed as well. 1 týždeň pred
Components b09f623d08 Add search. Uses new PathStrFind which uses Win32 FindStringOrdinal. 22 hodín pred
Examples 2f89b6249c Improve [Code] dontcopy examples & doc: should use noencryption as well, like isdonateandmail.iss already did. 6 dní pred
Files f2200d958d Fix: Support function SameStr is now properly case-sensitive. Has 'always' been buggy. 5 dní pred
ISHelp 6455243ea1 Fix typos in ispp.xml (#581) 11 hodín pred
Projects eacff82fa4 Dont show files which dont have a memo because MaxMemos was reached. 7 hodín pred
.gitignore 42d33b8547 Add missing ignores. 6 mesiacov pred
.gitmodules e6d83c6252 Removed PS submodule 7 rokov pred
CONTRIBUTING.md 5bd3654291 Remove confusing/outdated note about Github .isl editing. 6 mesiacov pred
README.md 5870744f10 Add /KEEPEXEDATMSG command line param to Uninstall to make debugging it much less annoying. 3 dní pred
build-ce.bat 8381221a67 Add a build group to the .groupproj to define which targets sould be build per project. This keeps compile-msbuild.bat simple. Switch to 64-bit build for ISHelpGen at same time. 1 týždeň pred
build.bat 2f3b233d95 Bump version. Doesn't mean there will be a release soon. 1 týždeň pred
compile-msbuild.bat 20630ac632 Make EnvOptionsWarn=false work for the build group + bit of cleanup. 1 týždeň pred
compile.bat 629ba03c08 Enable typed @ operator in Compil32 and ISCmplr. So now it's enabled in all projects, including ISHelpGen. 1 týždeň pred
def01.ispublickey 345730dbc0 Improve on fc09be12, don't actually need the .txt for easy linking. 5 mesiacov pred
def02.ispublickey 345730dbc0 Improve on fc09be12, don't actually need the .txt for easy linking. 5 mesiacov pred
getit.bat cc3c5b47c3 Fix left over 'cd ..'. 1 týždeň pred
isdonate.bmp dc538b82a4 Add ismail button to Setup. 5 rokov pred
isdonate_dark.bmp a75a2bf09d Add dark versions of isdonate.bmp and ismail.bmp. 4 týždňov pred
isdonateandmail.iss e95f5b9a56 Whitespace. 4 týždňov pred
ismail.bmp dc538b82a4 Add ismail button to Setup. 5 rokov pred
ismail_dark.bmp a75a2bf09d Add dark versions of isdonate.bmp and ismail.bmp. 4 týždňov pred
isportable.iss 684b229dc8 Improve. Closes #382. 5 rokov pred
issig.bat 786de6063e Fix build. 5 mesiacov pred
license.txt 6bd3ad99e7 With 9pt Segoe and at 100% DPI, some of the lines need to be a bit less wide. 1 mesiac pred
setup.allowedpublickeys.iss 345730dbc0 Improve on fc09be12, don't actually need the .txt for easy linking. 5 mesiacov pred
setup.iss 2f3b233d95 Bump version. Doesn't mean there will be a release soon. 1 týždeň pred
whatsnew.htm 0ac6151290 Update. 8 hodín pred

README.md

Inno Setup

Copyright (C) 1997-2025 Jordan Russell. All rights reserved. Portions Copyright (C) 2000-2025 Martijn Laan. All rights reserved. For conditions of distribution and use, see LICENSE.TXT.

Source code README

Getting Started

  1. Obtain sources

    First you need to download the sources from Github. From the command line do:

    > git clone https://github.com/jrsoftware/issrc.git issrc
    > cd issrc
    > git submodule init
    > git submodule update
    

    If you don't have the Git client (git), get it from:

    https://git-scm.com/

    To update your sources from the command line do:

    > git pull
    > git submodule update
    

    To be able to contribute to Inno Setup, clone your own fork instead of cloning the main Inno Setup repository, commit your work on topic branches and make pull requests. See CONTRIBUTING.md.

  2. Install Embarcadero Delphi

We compile all of Inno Setup's projects under Delphi 12.3 Athens with the May Patch installed.

There's a free version of Delphi available called the Community Edition. See https://www.embarcadero.com/products/delphi/starter/free-download.

After installation of Delphi, you must install GetIt dependencies by running getit.bat and following the instructions.

  1. Install Microsoft HTML Help Workshop

Install Microsoft HTML Help Workshop if you haven't already done so. See https://docs.microsoft.com/en-us/previous-versions/windows/desktop/htmlhelp/microsoft-html-help-downloads and http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe

Note: Microsoft HTML Help Workshop is only needed to be able to compile the help file.

  1. Build Inno Setup

Unfortunately, Embarcadero has removed command line compilation support from the Community Edition, which means there's two different build scripts.

Community Edition: To build all files in Release mode run build-ce.bat and follow the instructions.

Otherwise: To build all files in Release mode run build.bat and follow the instructions.

To just compile Inno Setup in Release mode run compile.bat and follow the instructions. This batch file cannot be used with the Community Edition, open Projects\Projects.groupproj instead.

To just compile the Inno Setup help file and its web version run ISHelp\ISHelpGen\compile.bat and ISHelp\compile.bat and follow the instructions. The former batch file cannot be used with the Community Edition, open Projects\Projects.groupproj instead.

Component Installation

If you intend to view or modify the Setup project's forms, you must install the following component units, which can be found in the Components directory.

  • BitmapButton
  • BitmapImage
  • FolderTreeView
  • NewCheckListBox
  • NewCtrls
  • NewNotebookReg
  • NewProgressBar
  • NewStaticText
  • PasswordEdit
  • RichEditViewer

If you intend to view or modify the Compil32 project's forms, you must additionally install the following components.

  • DropListBox
  • NewTabSet

The Components directory contains a Components.dpk file which you can use to install all these components.

If you only want to edit code, then you may skip installation of the components, and choose "Cancel" if the Delphi IDE tells you a class can't be found.

The Components directory also includes various units that are not installable components; however, they are still considered components because they can function independently from Inno Setup.

Overview

Inno Setup consists of eight projects:

Compil32 - This is the GUI front-end for the compiler, also known as the Compiler IDE. Compil32 does not do the actual compilation itself; it relegates it to ISCmplr.dll. If the ISCmplr project is changed, you normally don't need to recompile Compil32 since it's essentially a text editor, and is not affected by internal changes to the compiler.

ISCC - This is the command-line front-end to the compiler. Like Compil32, it depends on ISCmplr.dll to do the actual compiling.

ISCmplr - This is a DLL which is loaded by Compil32 and ISCC to compile scripts. The actual compiler code is in Compiler.SetupCompiler.pas. See Shared.CompInt.pas for the various structures and function declarations used to interface to the DLL.

ISPP - This is a DLL implementing Inno Setup's preprocessor interface.

Setup - This is the actual "Setup" program. It displays the wizard, and performs all (un)installation-related tasks.

SetupCustomStyle - Identical to Setup, except that it includes code to support VCL Styles.

SetupLdr - This is the "setup loader." It self-extracts a compressed Setup program into the user's TEMP directory and runs it from there. It also displays the "This will install..." and /HELP message boxes.

ISSigTool - This is a command-line utility which can be used to sign and verify any of your files. Compil32, ISCC, and ISCmplr use these signatures to verify the authenticity of a number of DLL, E32 and EXE files before loading them. Note: this utility does not replace Microsoft's signtool.exe in any way and is in fact not related to Authenticode Code Signing at all.

How do the projects link together?

  • Compil32, ISCmplr, ISPP, Setup, SetupCustomStyle, and SetupLdr share the unit Shared.Struct.pas. This unit contains various data structures and constants shared by the projects. If Shared.Struct.pas is changed, you usually will need to recompile all these projects so that everything is in synch.

  • There are more units which are shared between projects. Search the .dpr files of the projects if you aren't sure if a project uses a particular unit.

Source code tips

  • When building the projects in Release mode, it outputs to Files. Before running Compil32, ensure that all .issig files are up to date.

  • When building the projects in Debug mode, it outputs to Projects\Bin and when debugging, it will run from within this directory. To prepare this directory with some extra files you must run Projects\Bin\synch-isfiles.bat. Running the aforementioned build.bat or build-ce.bat first is not necessary.

  • To debug the Setup project, you should first build all projects in Debug mode, then run the Compil32 project and compile the Debug.iss script which should open automatically, and finally open and run the Setup project. This way you can simulate an actual installation while running under the Delphi debugger.

  • To debug the SetupLdr project, build all projects in Debug mode and compile the Debug.iss script as explained above, except with the UseSetupLdr=no line set to yes. Then open and run the SetupLdr project with a 32-bit or 64-bit target (latter does not require using UseSetupLdr=x64). It will automatically set a special debug-only /SELFFILENAME=Setup.exe command line parameter, which will cause it to load and run the Setup.exe you just compiled using Compil32, instead of the SetupLdr.e32 or .e64 just compiled by Delphi.

  • To debug the uninstaller first run Setup.exe to completion with the /DETACHEDMSG command line parameter set. Afterwards copy uninst000.dat and uninst000.msg as setup.dat and setup.msg to the Projects\Bin directory in your issrc path. Then open the Setup project and set the command line parameters to /UNINSTMODE /KEEPEXEDATMSG "/SECONDPHASE=<your issrc path\Projects\Bin\Setup.exe" and start debugging. Note: each time setup.dat and setup.msg will be deleted if you allow the uninstaller to complete so make sure to keep copies.

  • All of the forms in the Setup project have Scaled set to False. This is because they dynamically scale themselves at run-time by calling a function named InitializeFont.

  • A note for those curious: Compil32 creates single exe Setups by first creating the Setup.exe as usual, then concatenating the Setup.0 and Setup-1.bin to the end of the Setup.exe, and finally modifying an internal data block in Setup.exe so it knows it's in "single exe" form.

Precompiled executables and libraries

The source code contains several precompiled and code-signed executables and libraries:

Files\is7z.dll, Files\is7zxa.dll, Files\is7zxr.dll - Compiled by Visual Studio 2022 from 7-Zip source code in the is7z repository.

Files\isbunzip.dll, Files\isbzip.dll - Compiled by Visual Studio 2005 from the bzlib directory in the iscompress repository.

Files\isunzlib.dll, Files\iszlib.dll - Compiled by Visual Studio 2005 from the zlib-dll directory in the iscompress repository.

Files\islzma.dll, Files\islzma32.exe, Files\islzma64.exe - Compiled by Visual Studio 2022 from the Projects\Src\Compression.LZMACompressor\islzma directory.

Files\isscint.dll - Compiled by Visual Studio 2022 from Scintilla source code in the isscint repository.

Projects\Src\Setup.HelperEXEs\Helper\x64\Release\Helper.exe, Projects\Src\Setup.HelperEXEs.res - Compiled by Visual Studio 2005 from the Projects\Src\Setup.HelperEXEs\Helper directory and then stored in a compiled resource file.

Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec.obj - Compiled by Visual Studio 2022 from the Projects\Src\Compression.LZMADecompressor\Lzma2Decode directory.

Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno(.x86|.x64).obj - Compiled by Visual Studio 2022 from the Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode directory.

Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec.obj - Compiled by Visual Studio 2022 from the Projects\Src\Compression.SevenZipDecoder\7zDecode directory.

Examples\MyProg.exe, Examples\MyProg-x64.exe, Examples\MyProg-Arm64.exe - Compiled by Visual Studio 2022 from the Examples\MyProg directory.

Each precompiled file is accompanied by an .issig signature file, and can be verified using Inno Setup Signature Tool and this public key file.

Inno Setup-specific editing guidelines for the help files

  • When mentioning something the user would type in a script, e.g. "MinVersion", surround it by <tt></tt> so that it's displayed in a monospaced font. This is a convention used throughout the help file. Example: <tt>MinVersion</tt>

Setting up Continuous Integration

Inno Setup's source code includes a GitHub workflow named build.yml that performs unattended builds upon push events, it requires some setting up, though.

Note: The following instructions assume that you have a correctly-licensed version of Delphi installed and ran getit.bat as mentioned above. Your Delphi version may not be a Community Edition because it does not support command line compilation. Also ensure your current Delphi license still allows you to copy a subset of the Delphi files to another machine for the specific purpose of supporting unattended builds.

First, run rsvars.bat from your Delphi Bin directory and then in the same session generate an encrypted .zip file containing the files needed to build Inno Setup using 7-Zip:

cd /d "%BDS%"
"%ProgramFiles%\7-Zip\7z.exe" a -mx9 -mem=AES256 -p"<password>" ^
  %USERPROFILE%\issrc-build-env.zip ^
  bin\dcc32.exe bin\rlink32.dll bin\lnk*.dll ^
  lib\win32\release\Sys*.dcu lib\win32\release\*.res ^
  lib\win32\release\System.*.dcu lib\win32\release\System.Generics.*.dcu ^
  lib\win32\release\System.Internal.*.dcu lib\win32\release\System.Net.*.dcu ^
  lib\win32\release\System.Net.HttpClient.*.dcu lib\win32\release\System.Win.*.dcu ^
  lib\win32\release\Vcl.*.dcu lib\win32\release\Vcl.Imaging.*.dcu ^
  lib\win32\release\Winapi.*.dcu ^
  bin\dcc64.exe ^
  lib\win64\release\Sys*.dcu lib\win64\release\*.res ^
  lib\win64\release\System.*.dcu lib\win64\release\System.Generics.*.dcu ^
  lib\win64\release\System.Internal.*.dcu lib\win64\release\System.Net.*.dcu ^
  lib\win64\release\System.Net.HttpClient.*.dcu lib\win64\release\System.Win.*.dcu ^
  lib\win64\release\Vcl.*.dcu lib\win64\release\Vcl.Imaging.*.dcu ^
  lib\win64\release\Winapi.*.dcu ^
  bin\cgrc.exe bin\lnkdfm*.dll bin\rc.exe bin\RcDLL.dll ^
  bin\Borland.Build.Tasks.Common.dll bin\Borland.Build.Tasks.Delphi.dll bin\Borland.Build.Tasks.Shared.dll bin\Borland.Globalization.dll ^
  bin\CodeGear.Common.targets bin\CodeGear.Delphi.Targets bin\CodeGear.Group.Targets bin\CodeGear.Profiles.Targets
cd /d "%BDSCOMMONDIR%"
"%ProgramFiles%\7-Zip\7z.exe" a -mx9 -mem=AES256 -p"<password>" ^
  %USERPROFILE%\issrc-build-env.zip ^
  Styles\SlateClassico.vsf ^
  Styles\Windows11_Modern_Dark.vsf ^
  Styles\Windows11_Modern_Light.vsf ^
  Styles\Windows11_Polar_Dark.vsf ^
  Styles\Windows11_Polar_Light.vsf ^
  Styles\Zircon.vsf

Then, upload this encrypted file somewhere public. After that, add its URL as a new repository secret, under the name ISSRC_BUILD_ENV_ZIP_URL, and the password as ISSRC_BUILD_ENV_ZIP_PASSWORD.

Finally, indicate that your fork of the repository has those secrets, by adding the topic has-issrc-build-env (click the gear icon next to the "About" label at https://github.com/YOUR-USER-NAME/issrc to add the topic).

Once that's done, you're set! The next time you push a branch to your fork, the workflow will be triggered automatically.

To set up automatic synchronization for your fork, first create a Fine-Grained Personal Access Token (at https://github.com/settings/personal-access-tokens) with access to your fork or all repositories you own, ensuring it has Read and Write permissions for Contents, Workflows, and (see below) optionally also for Pull Requests. After that, add this token as a new repository secret, under the name ISSRC_BUILD_ENV_SYNC_TOKEN. Finally, indicate that your fork has this secret, by adding the topic has-issrc-build-env-sync-token. Your fork will now synchronize daily, and will automatically run the aforementioned build workflow on changes, if it's configured.

If you also create a draft PR to merge main into a branch named copilot-review, and you have included permissions for Pull Requests as well as access to Copilot reviews, then it will automatically request a review from Copilot once the synchronization completes. You should then regularly fast-forward your branch to the commit immediately preceding the head of main. Do not fast-forward to the head of main, as this will close your PR and you will not be able to recreate it until another commit is made. After fast-forwarding, close and reopen the PR on GitHub to make it display updated information.

Both automatic synchronization and automatic review use workflow sync-fork.yml.

To perform a second unattended build using a different Delphi version, add topic has-issrc-build2-env and secrets ISSRC_BUILD2_ENV_ZIP_URL and ISSRC_BUILD2_ENV_ZIP_PASSWORD. Unlike the main build, the second build does not produce any artifacts. It uses workflow build2.yml.