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

 
GeneralRe: Looking for testers for next version! [important] Pin
GJSVB12323-Jul-11 14:33
GJSVB12323-Jul-11 14:33 
GeneralMessage Closed Pin
23-Jul-11 21:08
DomGries23-Jul-11 21:08 
GeneralRe: Looking for testers for next version! [important] Pin
GJSVB12324-Jul-11 12:32
GJSVB12324-Jul-11 12:32 
GeneralMessage Closed Pin
24-Jul-11 22:13
DomGries24-Jul-11 22:13 
GeneralRe: Looking for testers for next version! [important] Pin
GJSVB12325-Jul-11 13:54
GJSVB12325-Jul-11 13:54 
GeneralMessage Closed Pin
25-Jul-11 20:38
DomGries25-Jul-11 20:38 
GeneralRe: Looking for testers for next version! [important] Pin
GJSVB12326-Jul-11 8:03
GJSVB12326-Jul-11 8:03 
GeneralRe: Looking for testers for next version! [important] Pin
Andrzej Lenkowski9-Sep-11 8:14
Andrzej Lenkowski9-Sep-11 8:14 
Installer of SQL 3.5 Compact Edition (community) doesn't seem to work. I have changed the "scceruntime.iss" to work:
[CustomMessages]
ssceruntime_titlex86=SQL Server Compact 3.5 Service Pack 2 (x86)
ssceruntime_titlex64=SQL Server Compact 3.5 Service Pack 2 (x64)

en.ssceruntime_size=5.3 MB
pl.ssceruntime_size=5,3 MB


[Code]
const
ssceruntime_urlx86 = 'http://go.microsoft.com/fwlink/?LinkId=166085&clcid=0x409';
ssceruntime_urlx64 = 'http://go.microsoft.com/fwlink/?LinkId=166086&clcid=0x409';

procedure ssceruntime();
begin
if (not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5')) then
begin
AddProduct('ssceruntimex86.msi',
'/qb',
CustomMessage('ssceruntime_titlex86'),
CustomMessage('ssceruntime_size'),
ssceruntime_urlx86,
false, false);

if(IsX64()) then
AddProduct('ssceruntimex64.msi',
'/qb',
CustomMessage('ssceruntime_titlex64'),
CustomMessage('ssceruntime_size'),
ssceruntime_urlx64,
false, false);
end;
end;

But it doesn't always work. Do you have some solution for that?
BugRe: Looking for testers for next version! [important] Pin
yvisek20-Sep-11 6:39
yvisek20-Sep-11 6:39 
GeneralRe: Looking for testers for next version! [important] [modified] Pin
Member 865677418-Feb-12 7:07
Member 865677418-Feb-12 7:07 
GeneralUnknown identifier 'init' Pin
HEMICRO20-May-11 13:42
HEMICRO20-May-11 13:42 
GeneralUnderstanding AddProduct parameters Pin
Hrizip3-Apr-11 11:15
Hrizip3-Apr-11 11:15 
GeneralMy vote of 5 Pin
Rei Masi23-Feb-11 1:49
Rei Masi23-Feb-11 1:49 
GeneralDownload Page Does Not Support Unicode At All Pin
Peter Lee7-Feb-11 17:34
Peter Lee7-Feb-11 17:34 
GeneralMy vote of 4 Pin
Ath_TonHu2-Jan-11 3:56
Ath_TonHu2-Jan-11 3:56 
General2011-01: Updated scripts available from my blog Pin
Ath_TonHu2-Jan-11 3:53
Ath_TonHu2-Jan-11 3:53 
GeneralCompatibility with Inno Setup 5.40 Pin
McoreD30-Dec-10 16:31
McoreD30-Dec-10 16:31 
GeneralRe: Compatibility with Inno Setup 5.40 Pin
joseph ni24-Jul-11 21:42
joseph ni24-Jul-11 21:42 
GeneralBug when using [Components] [modified] Pin
blaktro15-Dec-10 11:05
blaktro15-Dec-10 11:05 
GeneralRe: Bug when using [Components] Pin
blaktro16-Dec-10 2:16
blaktro16-Dec-10 2:16 
Generalshow intalling progress. Pin
pedpedo1-Dec-10 23:49
pedpedo1-Dec-10 23:49 
GeneralRe: show intalling progress. Pin
Peter Lee6-Feb-11 12:46
Peter Lee6-Feb-11 12:46 
QuestionInstall Service Pack 2 Pin
NoiadoX24-Nov-10 4:32
NoiadoX24-Nov-10 4:32 
GeneralFramework 4.0 Client french/english Pin
Pascal Hubert22-Nov-10 3:47
Pascal Hubert22-Nov-10 3:47 
QuestionIs there a way to run a procedure from an downloaded dependency ? Pin
daveaton21-Nov-10 3:15
daveaton21-Nov-10 3:15 

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.