Click here to Skip to main content
15,879,535 members
Articles / Programming Languages / SQL

Inno Setup Dependency Installer

Rate me:
Please Sign up or sign in to vote.
4.91/5 (191 votes)
7 Aug 2023CPOL2 min read 1.7M   24.9K   427   392
Download and install any dependency such as .NET, Visual C++ or SQL Server during your application's installation!
In this article, you will see installation, usage, integration, details, and dependencies of Inno Setup Dependency Installer.

Inno Setup Dependency Installer

Introduction

Inno Setup Dependency Installer can download and install any dependency such as .NET, Visual C++ or SQL Server during your application's installation. In addition, it is easy to add your own dependencies as well.

Installation and Usage

  1. Download and install Inno Setup 6.2+.
  2. Download the script from here or from the Github repository.
  3. Open the extracted ExampleSetup.iss file.
  4. Comment out dependency function calls inside InitializeSetup function to disable installing them:
    • Pascal
      Dependency_AddVC2013;   // installed in example setup
      //Dependency_AddVC2013; // commented out and not installed in example setup
  5. Modify other sections like [Setup] [Files] [Icons] as necessary.
  6. Build the setup using Inno Setup compiler.

Integration

You can also just include CodeDependencies.iss file into your setup and call the desired Dependency_Add functions (some may need defining their exe file path before the include):

Pascal
#define public Dependency_Path_NetCoreCheck "dependencies\"

#include "CodeDependencies.iss"

[Setup]
; ...

[Code]
function InitializeSetup: Boolean;
begin
  // add the dependencies you need
  Dependency_AddDotNet70;
  // ...

  Result := True;
end;

Details

You have two ways to distribute the dependency installers. By default, most dependencies will be downloaded from the official website. Another way is to pack the dependency into a single executable setup like so:

  • Include the dependency setup file by defining the source:

    Pascal
    Source: "dxwebsetup.exe"; Flags: dontcopy noencryption
  • Call ExtractTemporaryFile() before the corresponding Dependency_Add function:

    Pascal
    ExtractTemporaryFile('dxwebsetup.exe');

The dependencies are installed based on the system architecture. If you want to install 32-bit dependencies on a 64-bit system, you can force 32-bit mode like so:

Pascal
Dependency_ForceX86 := True;  // force 32-bit install of next dependencies
Dependency_AddVC2013;
Dependency_ForceX86 := False; // disable forced 32-bit install again

If you only deploy 32-bit binaries and dependencies, you can also instead just not define ArchitecturesInstallIn64BitMode in [Setup].

Dependencies

  • .NET
    • .NET Framework 3.5 Service Pack 1
    • .NET Framework 4.0
    • .NET Framework 4.5.2
    • .NET Framework 4.6.2
    • .NET Framework 4.7.2
    • .NET Framework 4.8.1
    • .NET Core 3.1 (Runtime, ASP.NET, Desktop)
    • .NET 5.0 (Runtime, ASP.NET, Desktop)
    • .NET 6.0 (Runtime, ASP.NET, Desktop)
    • .NET 7.0 (Runtime, ASP.NET, Desktop)
  • C++
    • Visual C++ 2005 Service Pack 1 Redistributable
    • Visual C++ 2008 Service Pack 1 Redistributable
    • Visual C++ 2010 Service Pack 1 Redistributable
    • Visual C++ 2012 Update 4 Redistributable
    • Visual C++ 2013 Update 5 Redistributable
    • Visual C++ 2015-2022 Redistributable
  • SQL
    • SQL Server 2008 R2 Service Pack 2 Express
    • SQL Server 2012 Service Pack 4 Express
    • SQL Server 2014 Service Pack 3 Express
    • SQL Server 2016 Service Pack 3 Express
    • SQL Server 2017 Express
    • SQL Server 2019 Express
    • SQL Server 2022 Express
  • Access
    • Access Database Engine 2010
    • Access Database Engine 2016
  • DirectX End-User Runtime
  • WebView2 Runtime

Credits

Thanks to the community for sharing many fixes and improvements. To contribute, please create a pull request.

This article was originally posted at https://github.com/DomGries/InnoDependencyInstaller

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionnetcorecheck.exe source code Pin
SparkyDude7-Dec-20 13:36
SparkyDude7-Dec-20 13:36 
AnswerRe: netcorecheck.exe source code Pin
Michael.Ragsdale23-Dec-20 7:29
Michael.Ragsdale23-Dec-20 7:29 
QuestionVisual C++ 2010 SP1 Pin
Yves Goergen1-Dec-20 2:26
Yves Goergen1-Dec-20 2:26 
QuestionBest way Pin
ltdeta25-Nov-20 0:37
ltdeta25-Nov-20 0:37 
GeneralMy vote of 5 Pin
Veli V25-Nov-20 0:01
Veli V25-Nov-20 0:01 
QuestionCould you please add Universal C Runtime 2019 support? Pin
tweber20121-May-19 8:00
tweber20121-May-19 8:00 
QuestionExtracting Pin
tweber201227-Apr-19 13:18
tweber201227-Apr-19 13:18 
QuestionIssues with vcredist2017 Pin
Daniel Montero Hernández5-Jun-18 9:09
Daniel Montero Hernández5-Jun-18 9:09 
I've only left use_dotnetfx47 and use_vc2017 defined, I commented out the rest of the files, when I try debugging or compiling the setup I get the following error:

Starting compile.  [Tuesday, June 05 2018 at 3:06:29 PM]
Compiling script with Inno Setup 5.5.9 (a) [ISDLLCompileScriptA]

[PreCompile] Processing.
[PreCompile] Processing is still being tested.
[PreCompile] Processing finished.

[ISPP] Preprocessing.
[ISPP] Preprocessed.

Parsing [Setup] section, line 41
Parsing [Setup] section, line 42
Parsing [Setup] section, line 43
Parsing [Setup] section, line 44
Parsing [Setup] section, line 45
Parsing [Setup] section, line 46
Parsing [Setup] section, line 47
Parsing [Setup] section, line 48
Parsing [Setup] section, line 49
Parsing [Setup] section, line 50
Parsing [Setup] section, line 51
Parsing [Setup] section, line 52
Parsing [Setup] section, line 53
Parsing [Setup] section, line 54
Parsing [Setup] section, line 55
Parsing [Setup] section, line 56
Parsing [Setup] section, line 57
Parsing [Setup] section, line 58
Parsing [Setup] section, line 59
Parsing [Setup] section, line 60
Reading file (WizardImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNIMAGE.BMP
Reading file (WizardSmallImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNSMALLIMAGE.BMP
Preparing Setup program executable
Reading default messages from Default.isl
Parsing [LangOptions], [Messages], and [CustomMessages] sections
   File: C:\Program Files (x86)\Inno Setup 5\Default.isl
   Messages in script file
Reading [Code] section
Parsing [Registry] section, line 80
Parsing [Run] section, line 73
Parsing [UninstallRun] section, line 76
Parsing [UninstallRun] section, line 77
Parsing [Files] section, line 63
Parsing [Files] section, line 64
Parsing [Files] section, line 65
Parsing [Files] section, line 66
   Reading version info: *\cert.pem
Parsing [Files] section, line 67
   Reading version info: *\config.json
Parsing [Files] section, line 68
Parsing [Files] section, line 69
Parsing [Files] section, line 70
Parsing [Files] section, line 2 of *\scripts\isxdl\isxdl.iss
   Reading version info: *\scripts\isxdl\isxdl.dll
Compiling [Code] section
Compiler Error!
File: *\scripts\products\vcredist2017.iss  Line 22: Column 11: Unknown identifier 'msiproductupgrade'


Am I doing anything wrong? I haven't really changed anything from the original script and didn't find anything relevant to it on this page or google Cry | :((

EDIT: fixed error message

modified 5-Jun-18 15:19pm.

AnswerRe: Issues with vcredist2017 Pin
tweber201227-Apr-19 13:24
tweber201227-Apr-19 13:24 
GeneralMy vote of 5 Pin
Member 1369809026-Feb-18 11:54
Member 1369809026-Feb-18 11:54 
QuestionCzech translation Pin
Milan Cizek30-Oct-17 20:04
Milan Cizek30-Oct-17 20:04 
QuestionFile encoding Pin
justscribe26-Aug-17 11:09
justscribe26-Aug-17 11:09 
PraiseWell done ! Pin
RickZeeland23-Aug-17 0:53
mveRickZeeland23-Aug-17 0:53 
QuestionInstalling vcredist offline version displays error message: "An error occured while installing the dependencies..." Pin
acegs14-Aug-17 23:30
acegs14-Aug-17 23:30 
AnswerRe: Installing vcredist offline version displays error message: "An error occured while installing the dependencies..." Pin
acegs17-Aug-17 13:45
acegs17-Aug-17 13:45 
Question.net 4.5 and 4.5.2 missing Pin
nmg19625-May-17 0:28
nmg19625-May-17 0:28 
PraiseExcellent!! Pin
Marco Giovanni19-Sep-16 2:51
Marco Giovanni19-Sep-16 2:51 
Question.Net 4.5 Pin
f.digiugno12-May-16 1:42
f.digiugno12-May-16 1:42 
QuestionHelppp Pin
Member 1233397118-Feb-16 4:49
Member 1233397118-Feb-16 4:49 
AnswerRe: Helppp Pin
Member 1233397118-Feb-16 6:22
Member 1233397118-Feb-16 6:22 
QuestionVerify if already installed Visual C++ Redistributable Pin
Omar.Pessoa16-Feb-16 2:24
Omar.Pessoa16-Feb-16 2:24 
QuestionSQL 2014 Pin
Vincent DUVERNET (Nolmë Informatique)24-Jan-16 9:56
Vincent DUVERNET (Nolmë Informatique)24-Jan-16 9:56 
AnswerRe: SQL 2014 Pin
DPlayer5-Mar-16 4:59
DPlayer5-Mar-16 4:59 
SuggestionVC++ 2010 SP1; HTTPS URLs Pin
Yves Goergen9-Dec-15 23:22
Yves Goergen9-Dec-15 23:22 
GeneralRe: VC++ 2010 SP1; HTTPS URLs Pin
Vincent DUVERNET (Nolmë Informatique)14-Feb-16 21:38
Vincent DUVERNET (Nolmë Informatique)14-Feb-16 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.