Click here to Skip to main content
15,867,308 members
Articles / Programming Languages / SQL

Inno Setup Dependency Installer

Rate me:
Please Sign up or sign in to vote.
4.91/5 (190 votes)
7 Aug 2023CPOL2 min read 1.7M   24.9K   426   384
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

 
GeneralRe: sql compact fails install Pin
Freddyvdh9-May-12 3:02
Freddyvdh9-May-12 3:02 
Questionnewer c++ 2010 residistributable package already installed Pin
matthias_791-Mar-12 22:52
matthias_791-Mar-12 22:52 
AnswerRe: newer c++ 2010 residistributable package already installed Pin
Member 874435120-Mar-12 14:04
Member 874435120-Mar-12 14:04 
GeneralRe: newer c++ 2010 residistributable package already installed Pin
Member 865677420-Jun-12 8:39
Member 865677420-Jun-12 8:39 
QuestionDetecting/Installing VC++ 2008 Runtime Pin
Member 865677418-Feb-12 7:04
Member 865677418-Feb-12 7:04 
AnswerRe: Detecting/Installing VC++ 2008 Runtime Pin
Member 865677419-Feb-12 23:00
Member 865677419-Feb-12 23:00 
GeneralMessage Closed Pin
11-Apr-12 11:58
DomGries11-Apr-12 11:58 
GeneralRe: Detecting/Installing VC++ 2008 Runtime Pin
Member 865677420-Jun-12 8:37
Member 865677420-Jun-12 8:37 
QuestionNeed the following scripts... Pin
Hrizip6-Feb-12 2:05
Hrizip6-Feb-12 2:05 
QuestionMaybe a stupid question, but... Pin
Hrizip3-Feb-12 6:49
Hrizip3-Feb-12 6:49 
AnswerRe: Maybe a stupid question, but... Pin
Hrizip6-Feb-12 2:02
Hrizip6-Feb-12 2:02 
QuestionComponents Pin
BARTO_1827-Jan-12 7:50
BARTO_1827-Jan-12 7:50 
AnswerRe: Components Pin
Freddyvdh25-Sep-12 0:15
Freddyvdh25-Sep-12 0:15 
AnswerRe: Components Pin
Freddyvdh25-Sep-12 3:50
Freddyvdh25-Sep-12 3:50 
GeneralMy vote of 5 Pin
Jesus Ibañez15-Jan-12 22:06
Jesus Ibañez15-Jan-12 22:06 
QuestionThanks. Pin
Jesus Ibañez15-Jan-12 22:02
Jesus Ibañez15-Jan-12 22:02 
GeneralMy vote of 5 Pin
Yasser Sobhy4-Jan-12 1:54
Yasser Sobhy4-Jan-12 1:54 
QuestionDetecting presence of VC++ 2010 re-distributables Pin
SanjayGangadhara22-Dec-11 9:37
SanjayGangadhara22-Dec-11 9:37 
SuggestionRe: Detecting presence of VC++ 2010 re-distributables Pin
intelli_edvo11-Feb-12 5:22
intelli_edvo11-Feb-12 5:22 
GeneralMy vote of 5 Pin
Valery Possoz10-Dec-11 11:04
professionalValery Possoz10-Dec-11 11:04 
QuestionBug in wic.iss Pin
djarvis27030-Nov-11 9:18
djarvis27030-Nov-11 9:18 
QuestionVC++ Redistributable version (x86/x64) does NOT depend on target architecture version Pin
euclectus22-Nov-11 2:38
euclectus22-Nov-11 2:38 
QuestionRe: VC++ Redistributable version (x86/x64) does NOT depend on target architecture version Pin
euclectus6-Dec-11 0:35
euclectus6-Dec-11 0:35 
GeneralRe: VC++ Redistributable version (x86/x64) does NOT depend on target architecture version Pin
SohailB28-Dec-11 0:47
SohailB28-Dec-11 0:47 
GeneralRe: VC++ Redistributable version (x86/x64) does NOT depend on target architecture version Pin
matthias_791-Mar-12 23:48
matthias_791-Mar-12 23:48 

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.