Click here to Skip to main content
15,662,754 members
Articles / .NET / .NET6

Tagged as

Stats

1.5M views
24.6K downloads
417 bookmarked

Inno Setup Dependency Installer

Rate me:
Please Sign up or sign in to vote.
4.91/5 (181 votes)
5 Jan 2022CPOL2 min read
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 the Github repository.
  3. Open the extracted CodeDependencies.iss file.
  4. Comment out dependency defines to disable installing them in the example setup and leave only dependencies that need to be installed:
    • #define UseVC2013 <-- installed in example setup
      ;#define UseVC2013 <-- commented out and not installed in example setup
  5. Modify other sections like [Setup] [Files] [Icons] as necessary.
  6. Build setup using Inno Setup compiler.

Integration

You can include CodeDependencies.iss file into your setup by disabling compilation of the example setup before and calling the desired Dependency_Add functions:

Pascal
#define public Dependency_NoExampleSetup
#include "CodeDependencies.iss"

[Setup]
; ...

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

  Result := True;
end;

Details

You have two ways to distribute the dependency installers. By default, the dependency will be downloaded from the official website once it is defined as required in the CodeDependencies.iss file. 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
    • .NET Core Runtime 3.1
    • ASP.NET Core Runtime 3.1
    • .NET Desktop Runtime 3.1
    • .NET Runtime 5.0
    • ASP.NET Core Runtime 5.0
    • .NET Desktop Runtime 5.0
    • .NET Runtime 6.0
    • ASP.NET Core Runtime 6.0
    • .NET Desktop Runtime 6.0
  • 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 2 Express
    • SQL Server 2017 Express
    • SQL Server 2019 Express
  • DirectX End-User 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

 
PraiseVery useful Pin
Member 1512713420-Feb-23 0:37
Member 1512713420-Feb-23 0:37 
GeneralMy vote of 5 Pin
peterboulton15-Feb-23 5:16
professionalpeterboulton15-Feb-23 5:16 
GeneralMy vote of 5 Pin
peterboulton15-Feb-23 5:14
professionalpeterboulton15-Feb-23 5:14 
BugRuntime error Line 230: ExtractTemporaryFile: The file "netcorecheck.exe" was not found Pin
Member 1451903415-Jul-22 8:25
Member 1451903415-Jul-22 8:25 
GeneralRe: Runtime error Line 230: ExtractTemporaryFile: The file "netcorecheck.exe" was not found Pin
Member 1450438427-Oct-22 8:17
Member 1450438427-Oct-22 8:17 
Questionit's a good base Pin
Member 1359953113-Feb-22 5:01
Member 1359953113-Feb-22 5:01 
QuestionPython Pin
LarryAU3-Jan-22 22:10
LarryAU3-Jan-22 22:10 
GeneralMy vote of 5 Pin
stag9212-Dec-21 23:16
stag9212-Dec-21 23:16 
QuestionSupport for SQL Server 2019 LocalDB Pin
Rubal Walia29-Sep-21 13:07
Rubal Walia29-Sep-21 13:07 
GeneralMy vote of 5 Pin
Ștefan-Mihai MOGA28-Sep-21 18:24
professionalȘtefan-Mihai MOGA28-Sep-21 18:24 
GeneralMy vote of 5 Pin
Member 1370414323-Jun-21 3:11
Member 1370414323-Jun-21 3:11 
QuestionLatest version fails to install dependency Pin
coder1129-Jun-21 9:56
coder1129-Jun-21 9:56 
QuestionNo way to report issues for InnoDependecyInstaller Pin
coder1129-Jun-21 8:25
coder1129-Jun-21 8:25 
QuestionVB dependencies Pin
gwittlock23-Dec-20 6:57
gwittlock23-Dec-20 6:57 
AnswerRe: VB dependencies Pin
Michael.Ragsdale23-Dec-20 7:33
Michael.Ragsdale23-Dec-20 7:33 
GeneralRe: VB dependencies Pin
gwittlock23-Dec-20 9:01
gwittlock23-Dec-20 9:01 
GeneralRe: VB dependencies Pin
Michael.Ragsdale23-Dec-20 9:03
Michael.Ragsdale23-Dec-20 9:03 
SuggestionMicrosoft WebView2 (Edge Chromium) Pin
Michael.Ragsdale23-Dec-20 7:29
Michael.Ragsdale23-Dec-20 7:29 
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 

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.