Click here to Skip to main content
15,880,972 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

 
AnswerRe: Add Visual Studio 2010 Tools for Office runtime dependency? Pin
Vincent DUVERNET (Nolmë Informatique)29-Jan-16 21:41
Vincent DUVERNET (Nolmë Informatique)29-Jan-16 21:41 
QuestionHelp with Sample Script With .net 45 and VC2012 Pin
Member 1054216523-Mar-15 11:05
Member 1054216523-Mar-15 11:05 
AnswerRe: Help with Sample Script With .net 45 and VC2012 Pin
Member 1054216524-Mar-15 6:59
Member 1054216524-Mar-15 6:59 
QuestionDependencies with multiple files Pin
nmg19619-Feb-15 7:58
nmg19619-Feb-15 7:58 
QuestionCant get dotnetfx40 to work Pin
Member 1146151918-Feb-15 4:47
Member 1146151918-Feb-15 4:47 
AnswerRe: Cant get dotnetfx40 to work Pin
daveaton9-Aug-15 6:25
daveaton9-Aug-15 6:25 
SuggestionNormalise include files / Code syntax expected Pin
Yves Goergen7-Feb-15 23:40
Yves Goergen7-Feb-15 23:40 
BugWrong version comparison Pin
Yves Goergen7-Feb-15 11:42
Yves Goergen7-Feb-15 11:42 
According to my test, it has a bug that I spotted from reading the code in file "stringversion.iss". I also found this code elsewhere, with the same issue. It says:

1.0 is equal to 1.0.1

Delphi
compareversion('1.0', '1.0.1') = 0


This doesn't seem exactly correct. The problem is that it just stops comparing whenever one version string has no more numbers. If one has more numbers than the other, they are ignored.

Can this be fixed somehow? I tried to rewrite the whole thing but soon quit again. My brain refuses to produce such low-level commands that were required with the available means. Not even arrays and a string split function available, not even dreaming of regular expressions...

Another requirement I'd have for my use is that it ignores anything after /[0-9.]+/. This isn't currently the case because it can only search for a "." and if the suffix is separated by something else, like in "1.0.1-test", it can only parse (1, 0) but not (1, 0, 1). I'd add a preprocessor for that to trim the version strings to any digits or a dot and stop as soon as I find another character.

I have a nice little C# implementation for all that, but still having trouble to fully correctly use it here (can't unload and delete my DLL anymore). Also, using a .NET DLL would somehow defeat the use of a script that can install .NET if it's not there... Pascal code is sooo weak (little power per code line) and lenghty compared to it. Frown | :-(

modified 8-Feb-15 5:33am.

QuestionGreat Work Pin
Just Russell30-Jan-15 21:57
professionalJust Russell30-Jan-15 21:57 
QuestionVery powerful ! Any solution to install VSTO ? Pin
smoinard30-Jan-15 8:58
professionalsmoinard30-Jan-15 8:58 
AnswerRe: Very powerful ! Any solution to install VSTO ? Pin
Member 1135231931-Jan-15 2:51
Member 1135231931-Jan-15 2:51 
GeneralRe: Very powerful ! Any solution to install VSTO ? Pin
smoinard1-Feb-15 19:50
professionalsmoinard1-Feb-15 19:50 
QuestionPowerShell 2 and SQL Native Client 11? Pin
d_train201427-Dec-14 22:05
professionald_train201427-Dec-14 22:05 
QuestionVisual C++ Redistributable Package for Visual Studio 2013 Pin
daveaton21-Dec-14 10:10
daveaton21-Dec-14 10:10 
AnswerMessage Closed Pin
13-Jan-15 11:06
DomGries13-Jan-15 11:06 
GeneralRe: Visual C++ Redistributable Package for Visual Studio 2013 Pin
daveaton30-Jan-15 6:33
daveaton30-Jan-15 6:33 
QuestionHow can i Install IE 10 or 11 using InnoSetup Installer ? Pin
kalpesh280419-Nov-14 19:09
kalpesh280419-Nov-14 19:09 
QuestionWhy .Net 4.5 has no support for localization? Pin
Mario Vernari7-Oct-14 5:52
Mario Vernari7-Oct-14 5:52 
SuggestionSupport for SQL Server 2014 LocalDB Pin
Mysteryx9325-Sep-14 12:04
Mysteryx9325-Sep-14 12:04 
GeneralRe: Support for SQL Server 2014 LocalDB Pin
Petr Šikola12-Jun-15 0:19
Petr Šikola12-Jun-15 0:19 
GeneralWIC exe being ignored Pin
FreeDragon8029-Jul-14 4:50
FreeDragon8029-Jul-14 4:50 
GeneralMessage Closed Pin
31-Jul-14 2:23
DomGries31-Jul-14 2:23 
GeneralRe: WIC exe being ignored Pin
FreeDragon8031-Jul-14 2:35
FreeDragon8031-Jul-14 2:35 
Question.Net Framework & VCRedist2010 User Interaction Required. Pin
kalpesh280428-Jul-14 21:07
kalpesh280428-Jul-14 21:07 
QuestionCrystal Report 2013 Pin
kalpesh280428-Jul-14 19:28
kalpesh280428-Jul-14 19:28 

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.