Click here to Skip to main content
15,888,269 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: isxdl.dll fails to be loaded on win98 starting at least from ISTool 5.3.0 Pin
ek4yasu20-Feb-10 22:58
ek4yasu20-Feb-10 22:58 
GeneralRe: isxdl.dll fails to be loaded on win98 starting at least from ISTool 5.3.0 Pin
Peter Lee7-Feb-11 13:19
Peter Lee7-Feb-11 13:19 
GeneralExcellent! Pin
Ondra Spilka18-Dec-09 2:10
professionalOndra Spilka18-Dec-09 2:10 
GeneralVersion Comparison Pin
Loki Man1-Dec-09 1:47
Loki Man1-Dec-09 1:47 
GeneralMessage Closed Pin
1-Dec-09 4:24
DomGries1-Dec-09 4:24 
GeneralRe: Version Comparison Pin
runeb24-Mar-10 12:01
runeb24-Mar-10 12:01 
GeneralBug with kb835732 on Windows XP Prof Pin
Batzen5-Nov-09 16:22
Batzen5-Nov-09 16:22 
GeneralUrgent: Error installing .Net Framework 3.5 sp1 on Vista Pin
Anthony Daly30-Oct-09 0:54
Anthony Daly30-Oct-09 0:54 
Dear stfx,

I have read through your article and used your scripts to provide the installation of the .Net Framework 3.5 sp1 in my installer if it is not present on the user's computer.

On a new Vista Home Premium machine, everything runs fine until after the .Net Framework is downloaded and goes through the process of installing the files. It comes up with an error page (in my installer) stating that an error has occured while trying to install the framework.

However, the strange thing is that after exiting the installer, under Add/Remove programs, the .Net Framework 3.5 sp1 is listed there as being installed. And, when I run the installer again it installs my program (without downloading the framework this time), which runs correctly.

So this leads me to believe that the Framework is being installed, only for some reason an error message is appearing stating the opposite. Could you kindly advise me on this issue?

Regards,
Anthony

P.S. Below is an extract from my InitializeSetup() function that deals with the prerequisites. Just to make sure that nothing is wrong in there. Also I am using the latest version of your code.

//init windows version
initwinversion();
	
//check if dotnetfx35 can be installed on this OS
if not minwinspversion(5, 0, 3) then begin
	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('win2000sp3_title')]), mbError, MB_OK);
	exit;
end;
if not minwinspversion(5, 1, 2) then begin
	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('winxpsp2_title')]), mbError, MB_OK);
	exit;
end;
	
msi31('3.1');

dotnetfx35sp1();
dotnetfx35sp1lp();

Result := true;


Check out my desktop conversion software for Windows -
www.universalconverter.net

GeneralMessage Closed Pin
31-Oct-09 0:53
DomGries31-Oct-09 0:53 
GeneralRe: Urgent: Error installing .Net Framework 3.5 sp1 on Vista Pin
Anthony Daly31-Oct-09 9:33
Anthony Daly31-Oct-09 9:33 
QuestionPossible bug? Unknown type PChar Pin
Stumproot16-Sep-09 23:19
Stumproot16-Sep-09 23:19 
AnswerMessage Closed Pin
17-Sep-09 7:16
DomGries17-Sep-09 7:16 
GeneralRe: Possible bug? Unknown type PChar Pin
McoreD26-Sep-09 13:06
McoreD26-Sep-09 13:06 
QuestionPrepareToInstall - stupid question ? Pin
barabum15-Sep-09 7:10
barabum15-Sep-09 7:10 
AnswerMessage Closed Pin
17-Sep-09 7:23
DomGries17-Sep-09 7:23 
GeneralRe: PrepareToInstall - stupid question ? Pin
barabum18-Sep-09 0:23
barabum18-Sep-09 0:23 
GeneralRe: PrepareToInstall - stupid question ? Pin
www.anumo.de19-Mar-10 21:15
www.anumo.de19-Mar-10 21:15 
QuestionWrong options Pin
alex_ger14-Sep-09 9:37
alex_ger14-Sep-09 9:37 
Generalcheck for file is use Pin
Brandon Holland9-Sep-09 3:47
Brandon Holland9-Sep-09 3:47 
QuestionOffline files Pin
alex_ger8-Sep-09 12:40
alex_ger8-Sep-09 12:40 
QuestionIs this Correct? Pin
voilapjr7-Sep-09 4:20
voilapjr7-Sep-09 4:20 
AnswerMessage Closed Pin
7-Sep-09 6:29
DomGries7-Sep-09 6:29 
GeneralRe: Is this Correct? Pin
voilapjr10-Sep-09 8:08
voilapjr10-Sep-09 8:08 
GeneralMessage Closed Pin
10-Sep-09 9:15
DomGries10-Sep-09 9:15 
GeneralRe: Is this Correct? Pin
voilapjr10-Sep-09 12:00
voilapjr10-Sep-09 12:00 

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.