Click here to Skip to main content
15,498,506 members
Articles / .NET / .NET6

Tagged as

Stats

1.5M views
24.4K downloads
413 bookmarked

Inno Setup Dependency Installer

Rate me:
Please Sign up or sign in to vote.
4.91/5 (177 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

 
AnswerRe: Issues with vcredist2017 Pin
tweber201227-Apr-19 14:24
Membertweber201227-Apr-19 14:24 
GeneralMy vote of 5 Pin
Member 1369809026-Feb-18 12:54
MemberMember 1369809026-Feb-18 12:54 
QuestionCzech translation Pin
Milan Cizek30-Oct-17 21:04
MemberMilan Cizek30-Oct-17 21:04 
QuestionFile encoding Pin
justscribe26-Aug-17 12:09
Memberjustscribe26-Aug-17 12:09 
PraiseWell done ! Pin
RickZeeland23-Aug-17 1:53
mveRickZeeland23-Aug-17 1:53 
QuestionInstalling vcredist offline version displays error message: "An error occured while installing the dependencies..." Pin
acegs15-Aug-17 0:30
Memberacegs15-Aug-17 0:30 
AnswerRe: Installing vcredist offline version displays error message: "An error occured while installing the dependencies..." Pin
acegs17-Aug-17 14:45
Memberacegs17-Aug-17 14:45 
Question.net 4.5 and 4.5.2 missing Pin
nmg19625-May-17 1:28
Membernmg19625-May-17 1:28 
The release notes say
Quote:
Added support for .NET Framework 4.5 - 4.5.2

..however there is no script for this. How would you install 4.5.2?

Thanks
PraiseExcellent!! Pin
Marco Giovanni19-Sep-16 3:51
MemberMarco Giovanni19-Sep-16 3:51 
Question.Net 4.5 Pin
f.digiugno12-May-16 2:42
Memberf.digiugno12-May-16 2:42 
QuestionHelppp Pin
Member 1233397118-Feb-16 5:49
MemberMember 1233397118-Feb-16 5:49 
AnswerRe: Helppp Pin
Member 1233397118-Feb-16 7:22
MemberMember 1233397118-Feb-16 7:22 
QuestionVerify if already installed Visual C++ Redistributable Pin
Omar.Pessoa16-Feb-16 3:24
MemberOmar.Pessoa16-Feb-16 3:24 
QuestionSQL 2014 Pin
Vincent DUVERNET (Nolmë Informatique)24-Jan-16 10:56
MemberVincent DUVERNET (Nolmë Informatique)24-Jan-16 10:56 
AnswerRe: SQL 2014 Pin
DPlayer5-Mar-16 5:59
MemberDPlayer5-Mar-16 5:59 
SuggestionVC++ 2010 SP1; HTTPS URLs Pin
Yves Goergen10-Dec-15 0:22
MemberYves Goergen10-Dec-15 0:22 
GeneralRe: VC++ 2010 SP1; HTTPS URLs Pin
Vincent DUVERNET (Nolmë Informatique)14-Feb-16 22:38
MemberVincent DUVERNET (Nolmë Informatique)14-Feb-16 22:38 
GeneralRe: VC++ 2010 SP1; HTTPS URLs Pin
Yves Goergen16-Feb-16 11:52
MemberYves Goergen16-Feb-16 11:52 
GeneralRe: VC++ 2010 SP1; HTTPS URLs Pin
Vincent DUVERNET (Nolmë Informatique)19-Feb-16 11:21
MemberVincent DUVERNET (Nolmë Informatique)19-Feb-16 11:21 
SuggestionGerman translation Pin
Yves Goergen2-Dec-15 10:24
MemberYves Goergen2-Dec-15 10:24 
GeneralRe: German translation Pin
Vincent DUVERNET (Nolmë Informatique)25-Jan-16 7:29
MemberVincent DUVERNET (Nolmë Informatique)25-Jan-16 7:29 
GeneralRe: German translation Pin
Yves Goergen25-Jan-16 7:37
MemberYves Goergen25-Jan-16 7:37 
GeneralRe: German translation Pin
Vincent DUVERNET (Nolmë Informatique)26-Jan-16 6:23
MemberVincent DUVERNET (Nolmë Informatique)26-Jan-16 6:23 
GeneralRe: German translation Pin
Yves Goergen26-Jan-16 7:14
MemberYves Goergen26-Jan-16 7:14 
GeneralRe: German translation Pin
Vincent DUVERNET (Nolmë Informatique)26-Jan-16 12:51
MemberVincent DUVERNET (Nolmë Informatique)26-Jan-16 12:51 

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.