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

 
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 
SuggestionVC Runtime 2012 Update 4 Pin
Brisingr Aerowing21-Jun-14 4:38
professionalBrisingr Aerowing21-Jun-14 4:38 
GeneralMessage Closed Pin
24-Jun-14 5:22
DomGries24-Jun-14 5:22 
GeneralRe: VC Runtime 2012 Update 4 Pin
Brisingr Aerowing25-Jun-14 16:48
professionalBrisingr Aerowing25-Jun-14 16:48 
If you don't have the ArchitecturesInstallIn64BitMode option set, the install will always be x86, so Is64BitInstallMode will be false, causing all methods that get strings/filenames/etc to return the x86 version.

I have tested this, and it works (I accidentally deleted the script I used to test while cleaning out some files on my HDD, so I can't share it). I am not sure why it didn't work for the person that first reported this, as this isn't really an issue, as InnoSetup takes care of it for us.
What do you get when you cross a joke with a rhetorical question?

GeneralRe: VC Runtime 2012 Update 4 Pin
Vectorcorp24-Feb-15 13:13
Vectorcorp24-Feb-15 13:13 
SuggestionMy Vote Of 5 Pin
AnthoniG15-Jun-14 3:07
AnthoniG15-Jun-14 3:07 
QuestionIs it free for commercial use ?? Pin
Tridip Bhattacharjee2-Jun-14 21:11
professionalTridip Bhattacharjee2-Jun-14 21:11 
QuestionThis might be useful Pin
Rinat Galyautdinov25-Sep-13 18:48
Rinat Galyautdinov25-Sep-13 18:48 
QuestionHow to install prerequisite without showing any dialog box Pin
gauravchandok20022-Aug-13 20:38
gauravchandok20022-Aug-13 20:38 
Question.NET 4 Full vs Client profile - which gets installed? Pin
nmg1963-Jun-13 1:51
nmg1963-Jun-13 1:51 
QuestionSample is not working, windows installer and sql server is not installed in my PC. Pin
Member 870685915-May-13 18:02
Member 870685915-May-13 18:02 
QuestionAbout define use_dotnetfx35 Pin
terra.jr8-May-13 4:02
terra.jr8-May-13 4:02 
GeneralWhat are the steps to use this tool? Pin
Chaim Tovim7-May-13 10:47
Chaim Tovim7-May-13 10:47 
QuestionDependencies file name Pin
fandisus28-Feb-13 0:25
fandisus28-Feb-13 0:25 
AnswerMessage Closed Pin
6-May-13 21:59
DomGries6-May-13 21:59 
GeneralRe: Dependencies file name Pin
hairy_hats4-Sep-15 4:30
hairy_hats4-Sep-15 4:30 
GeneralMy vote of 5 Pin
Nicolas Cornet6-Feb-13 22:35
Nicolas Cornet6-Feb-13 22:35 
QuestionWin 2008 R2 installation using the role manager Pin
torno22-Jan-13 4:47
torno22-Jan-13 4:47 
AnswerRe: Win 2008 R2 installation using the role manager Pin
torno24-Jan-13 2:13
torno24-Jan-13 2:13 
GeneralRe: Win 2008 R2 installation using the role manager Pin
Harald Binkle4-Apr-13 2:49
Harald Binkle4-Apr-13 2:49 
GeneralRe: Win 2008 R2 installation using the role manager Pin
Freddyvdh15-Jan-14 5:22
Freddyvdh15-Jan-14 5:22 

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.