Click here to Skip to main content
15,892,480 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: Contribution of additional scripts Pin
Phil Jollans3-Mar-11 9:20
Phil Jollans3-Mar-11 9:20 
GeneralNew version Pin
Donsw14-Jun-09 17:01
Donsw14-Jun-09 17:01 
GeneralRequire Restart Pin
Nick Olsen8-Jun-09 13:44
Nick Olsen8-Jun-09 13:44 
GeneralRe: Require Restart Pin
Member 649271319-Aug-09 2:59
Member 649271319-Aug-09 2:59 
GeneralMicrosoft Download URL Pin
Steve Legendre28-May-09 8:21
Steve Legendre28-May-09 8:21 
QuestionRestart Pin
lizzle2shizzle25-May-09 22:00
lizzle2shizzle25-May-09 22:00 
AnswerRe: Restart Pin
Nick Olsen8-Jun-09 13:45
Nick Olsen8-Jun-09 13:45 
GeneralRunning Downloaded/Supplied Files not in quite mode Pin
Nick Olsen12-May-09 14:21
Nick Olsen12-May-09 14:21 
Hello,

First off...thank you. This solved an issue we have been trying to solve for a really long time now.

I incorporated this into our setup and it detects that the .net framework 3.5 needs to be installed and downloads it correctly but when it gets to installing it, there seems to be no notification to the user that anything is happening. The window appears saying Microsoft .net Frameworkd 3.5 sp1 is being installed but the progress bar never moves. After 10 minutes or so it completes but there is no indication to the user of any progress.

I noticed that the exe is being run with the /quiet parameter (see below) and thus none of the UI for .net framework installation is shown. One solution I thought of was to run the installation using the /qb rather than /quiet as the UI would be shown but no users interaction would be required. Is there any way to do this?

[17:11:01.030] *** Setup started
[17:11:03.051] Setup version: Inno Setup version 5.2.3
[17:11:03.055] Original Setup EXE: C:\Users\nickolsen\Desktop\dotnetfx_innosetup\bin\setup.exe
[17:11:03.058] Setup command line: /SL5="$C12E6,75676,53248,C:\Users\nickolsen\Desktop\dotnetfx_innosetup\bin\setup.exe" /SPAWNWND=$A137A /NOTIFYWND=$2607AC /DEBUGWND=$271054
[17:11:03.059] Windows version: 6.00.6001 SP1 (NT platform: Yes)
[17:11:03.060] 64-bit Windows: No
[17:11:03.061] Processor architecture: x86
[17:11:03.062] User privileges: Administrative
[17:11:03.069] 64-bit install mode: No
[17:11:03.072] Created temporary directory: C:\Users\NICKOL~1\AppData\Local\Temp\is-DVRJL.tmp
[17:11:04.865] Message box (Yes/No):
The following applications are required before setup can continue:
.NET Framework 3.5 Service Pack 1 (3 MB - 232 MB)

Download and install now?
[17:11:06.315] User chose Yes.
[17:11:07.196] Starting the installation process.
[17:11:07.203] Installation process succeeded.
[17:11:07.208] -- Run entry --
[17:11:07.210] Run as: Current user
[17:11:07.212] Type: Exec
[17:11:07.215] Filename: C:\Users\NICKOL~1\AppData\Local\Temp\is-DVRJL.tmp\dotnetfx35sp1.exe
[17:11:07.217] Parameters: /lang:enu /quiet /norestart
[17:12:00.106] Process exit code: 0
[17:12:00.113] Need to restart Windows? No


Thanks

Nick
GeneralMessage Closed Pin
13-May-09 5:19
DomGries13-May-09 5:19 
GeneralRe: Running Downloaded/Supplied Files not in quite mode Pin
Nick Olsen13-May-09 6:28
Nick Olsen13-May-09 6:28 
GeneralMessage Closed Pin
14-May-09 5:56
DomGries14-May-09 5:56 
GeneralRe: Running Downloaded/Supplied Files not in quite mode Pin
Nick Olsen15-May-09 6:14
Nick Olsen15-May-09 6:14 
GeneralRe: Running Downloaded/Supplied Files not in quite mode Pin
Jazar35721-May-09 8:34
Jazar35721-May-09 8:34 
GeneralMessage Closed Pin
22-May-09 2:31
DomGries22-May-09 2:31 
GeneralRe: Running Downloaded/Supplied Files not in quite mode Pin
Nick Olsen8-Jun-09 13:38
Nick Olsen8-Jun-09 13:38 
Questionwhere is check for already installed is done? Pin
Priyank Bolia31-Mar-09 7:16
Priyank Bolia31-Mar-09 7:16 
AnswerMessage Closed Pin
1-Apr-09 6:29
DomGries1-Apr-09 6:29 
GeneralRe: where is check for already installed is done? Pin
Priyank Bolia1-Apr-09 7:39
Priyank Bolia1-Apr-09 7:39 
GeneralSuccess (somewhat) on Server 2008 x64 Pin
RandomEngy26-Mar-09 16:51
RandomEngy26-Mar-09 16:51 
GeneralSmall enhancement Pin
LittleBoy27-Feb-09 0:11
LittleBoy27-Feb-09 0:11 
GeneralTesting on a XP that does not have Windows Installer 3.1 Pin
McoreD13-Feb-09 13:03
McoreD13-Feb-09 13:03 
GeneralMessage Closed Pin
13-Feb-09 19:48
DomGries13-Feb-09 19:48 
GeneralRe: Testing on a XP that does not have Windows Installer 3.1 Pin
McoreD13-Feb-09 20:02
McoreD13-Feb-09 20:02 
GeneralThanks - at last a way to overcome Microsoft OneClick failings [modified] Pin
the berkshire pig25-Jan-09 11:14
the berkshire pig25-Jan-09 11:14 
GeneralTruly great! Pin
McoreD17-Jan-09 14:47
McoreD17-Jan-09 14:47 

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.