Click here to Skip to main content
11,639,126 members (64,059 online)
Click here to Skip to main content

Modular InnoSetup Dependency Installer

, 29 Jan 2015 CPOL 674.8K 15.5K 280
Rate this:
Please Sign up or sign in to vote.
A modular InnoSetup script to download and install all available .NET Framework versions and much more

Screenshot - dotnetfx_installer1.jpg

Screenshot - dotnetfx_installer3.jpg

Introduction

This article contains a modular InnoSetup install script that downloads (if setup files don't exist locally) and installs various dependencies like .NET Framework 1.1/2.0/3.5/4.0/4.5 and others on 32-bit and 64-bit Windows.

Background

Once upon a time, I needed an installer for my .NET applications. I knew that I could use the "genius" ClickOnce installer, but in my opinion it has a bad interface and is not very handy. Then I came across a script for InnoSetup that had everything I wanted, but unfortunately it was only for .NET 1.1. So, I spent quite a bit of time in InnoSetup to modify it to my needs and extending it vastly.

Details

The source code is written modular and is structured like this:

Screenshot - dotnetfx_structure.jpg

  • setup.iss - contains the basic setup where you include the modules (products) you need. They need to be included at the top like #include "scripts\products\dotnetfx11.iss" and then you only have to call their main function inside the [Code] part like dotnetfx11();
  • bin - contains the final output of the installer
  • src - contains the application files of your program
  • scripts
    • products.iss - contains the shared code for the product scripts. You only have to change the [CustomMessages] part and [Files] part (inclusion of isxdl language files)
    • isxdl - contains the downloader DLL for the setup (if there is something to download) and its language files (e.g. german.ini). This is the place where you can put your language files for the isxdl downloader in.
    • products - contains the scripts for products which are required by the application (e.g. .NET Framework 2.0)
      • dotnetfx11.iss - .NET Framework 1.1
      • dotnetfx11lp.iss - .NET Framework 1.1 Language Pack
      • dotnetfx11sp1.iss - .NET Framework 1.1 + Service Pack 1
      • dotnetfx20.iss - .NET Framework 2.0
      • dotnetfx20lp.iss - .NET Framework 2.0 Language Pack
      • dotnetfx20sp1.iss - .NET Framework 2.0 + Service Pack 1
      • dotnetfx20sp1lp.iss - .NET Framework 2.0 Service Pack 1 Language Pack
      • dotnetfx20sp2.iss - .NET Framework 2.0 + Service Pack 2
      • dotnetfx20sp2lp.iss - .NET Framework 2.0 Service Pack 2 Language Pack
      • dotnetfx35.iss - .NET Framework 3.5
      • dotnetfx35lp.iss - .NET Framework 3.5 Language Pack
      • dotnetfx35sp1.iss - .NET Framework 3.5 + Service Pack 1
      • dotnetfx35sp1lp.iss - .NET Framework 3.5 Service Pack 1 Language Pack
      • dotnetfx40client.iss - .NET Framework 4.0 Client Profile
      • dotnetfx40full.iss - .NET Framework 4.0 Full
      • dotnetfx45.iss - .NET Framework 4.5.2
      • ie6.iss - Internet Explorer 6
      • iis.iss - Internet Information Services (just a check if it is installed)
      • jet4sp8.iss - Jet 4 + Service Pack 8
      • kb835732.iss - Security Update (KB835732) which is required by .NET Framework 2.0 Service Pack 1 on Windows 2000 Service Pack 4
      • mdac28.iss - Microsoft Data Access Components (MDAC) 2.8
      • msi20.iss - Windows Installer 2.0
      • msi31.iss - Windows Installer 3.1
      • msi45.iss - Windows Installer 4.5
      • sql2005express.iss - SQL Server 2005 Express + Service Pack 3
      • sql2008express.iss - SQL Server 2008 Express R2
      • sqlcompact35sp2.iss - SQL Server Compact 3.5 + Service Pack 2
      • vcredist2005.iss - Visual C++ 2005 Redistributable
      • vcredist2008.iss - Visual C++ 2008 Redistributable
      • vcredist2010.iss - Visual C++ 2010 Redistributable
      • vcredist2012.iss - Visual C++ 2012 Redistributable
      • vcredist2013.iss - Visual C++ 2013 Redistributable
      • wic.iss - Windows Imaging Component
      • winversion.iss - helper functions to determine the installed Windows version
      • fileversion.iss - helper functions to determine the version of a file
      • stringversion.iss - helper functions to correctly parse a version string
      • dotnetfxversion.iss - helper functions to determine the installed .NET Framework version including service packs
      • msiproduct.iss - helper functions to check for installed msi products

Most of the time you need to tweak the setup.iss because of different Windows version checks and inclusion of your required dependencies.

If a dependency (product) is not installed, the script checks if the product's setup exists inside the dependencies directory which is configurable in products.iss. By default it is: .\MyProgramDependencies. If they don't exist there, it tries to download them (except for Windows service packs). This means a support for offline installing via CD or DVD is also possible.

Screenshot - dotnetfx_installer2.jpg

Screenshot - dotnetfx_installer4.jpg

The installation routine of the dependencies is automatic, and they run in quiet or semi quiet mode. Therefore no user interaction is needed (except for Internet Explorer 6). This setup script uses [CostumMessages] so that you can easily add multi-language support to your setup and easily configure settings (like the offline dependencies directory) without looking at the [Code] part.

Applications used for the script are:

  • Inno Setup - setup engine (version 5.5.5)
  • ISTool - extends Inno Setup but I just needed the isxdl.dll downloader (version 5.3.0)

Known Problems

If dependencies are needed, the required free hard drive size shown before installation is incorrect.

Points of Interest

Special thanks to Ted Ehrich who created the .NET Framework 1.1 script.

I also wanted to thank the community for sharing many fixes and improvements. Thanks guys, please keep it up! You can now also easily fork and send pull requests at the official Github repository.

History

  • 14 Oct, 2007
    • Initial version
  • 15 Aug, 2008
    • Now uses dotnetchk.exe to determine which version of .NET Framework and its language pack is installed
    • Added .NET Framework language pack(s) to script
    • Added translation for download page
    • Separated script code into multiple files to make it easier to update the script for different versions of the .NET Framework
  • 1 Jan, 2009
    • Wrote source code modular (each dependency now has one file)
    • Added code for Windows 2000 Security Update KB835732, .NET Framework 1.1, 2.0 SP1, 3.5, 3.5 SP1 and their language packs
    • Remove usage of dotnetchk.exe again as it only worked for .NET Framework 2.0 and below
  • 1 Sep, 2009
    • Code for dependencies installation routine was completely rewritten and is now executed before the actual installation of the application. Setup also checks if all dependencies are installed successfully and if not, displays an error page
    • Added support for 32-bit (x86) and 64-bit (x64) OS including Itanium (ia64)
    • Added code for .NET Framework 2.0 SP2 and its language pack
    • Fixed windows version check bug and language pack check bug
  • 23 Sep, 2011
    • Added support for .NET Framework 4.0, Windows Installer 4.5, Visual C++ 2010 Redistributable, SQL 2008 Express and SQL 3.5 Compact Edition (community)
    • Added helper functions to determine the installed .NET Framework version which removed redundant code
    • Added version strings parser to fix wrong detection for version numbers above 9
    • Added delayed and forced mid-install restart support
    • Added usage of #define in setup.iss (community)
    • Added unicode version of Inno Setup as default for better multi-language support
    • Fixed restart on 3010 resultcode from installers
    • Fixed missing check in Windows 2000 Security Update KB835732
    • Added support for offline files on x64 and IA64 OS
  • 2 Jun, 2014
    • Added support for .NET Framework 4.5 - 4.5.2
    • Fixed installing WIC before .NET Framework 4.0 (community)
    • Fixed Visual C++ 2010 Redistributable install parameters (community)
    • Fixed KB835732 install parameters (community)
  • 29 Jan, 2015
    • Added support for Visual C++ 2005, 2008, 2012, 2013 Redistributable
    • Improved Visual C++ Redistributable detection method (community)
    • Fixed installing products with LCID parameter in certain cases (community)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

stfx
Austria Austria
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionVC++ 2015 Pin
raspopov26-Jul-15 20:56
memberraspopov26-Jul-15 20:56 
GeneralWow... Thanks Pin
Sammy21023-Jul-15 12:33
memberSammy21023-Jul-15 12:33 
QuestionAdd Visual Studio 2010 Tools for Office runtime dependency? Pin
Toxaris8-Apr-15 3:01
memberToxaris8-Apr-15 3:01 
QuestionHelp with Sample Script With .net 45 and VC2012 Pin
Member 1054216523-Mar-15 11:05
memberMember 1054216523-Mar-15 11:05 
AnswerRe: Help with Sample Script With .net 45 and VC2012 Pin
Member 1054216524-Mar-15 6:59
memberMember 1054216524-Mar-15 6:59 
QuestionDependencies with multiple files Pin
nmg19619-Feb-15 7:58
membernmg19619-Feb-15 7:58 
QuestionCant get dotnetfx40 to work Pin
Member 1146151918-Feb-15 4:47
memberMember 1146151918-Feb-15 4:47 
SuggestionNormalise include files / Code syntax expected Pin
Yves Goergen7-Feb-15 23:40
memberYves Goergen7-Feb-15 23:40 
GeneralRe: Normalise include files / Code syntax expected Pin
stfx18-Feb-15 21:27
memberstfx18-Feb-15 21:27 
BugWrong version comparison Pin
Yves Goergen7-Feb-15 11:42
memberYves Goergen7-Feb-15 11:42 
GeneralRe: Wrong version comparison Pin
stfx18-Feb-15 21:03
memberstfx18-Feb-15 21:03 
QuestionGreat Work Pin
Just Russell30-Jan-15 21:57
memberJust Russell30-Jan-15 21:57 
QuestionVery powerful ! Any solution to install VSTO ? Pin
smoinard30-Jan-15 8:58
membersmoinard30-Jan-15 8:58 
AnswerRe: Very powerful ! Any solution to install VSTO ? Pin
Member 1135231931-Jan-15 2:51
memberMember 1135231931-Jan-15 2:51 
GeneralRe: Very powerful ! Any solution to install VSTO ? Pin
smoinard1-Feb-15 19:50
membersmoinard1-Feb-15 19:50 
QuestionPowerShell 2 and SQL Native Client 11? Pin
d_train201427-Dec-14 22:05
memberd_train201427-Dec-14 22:05 
QuestionVisual C++ Redistributable Package for Visual Studio 2013 Pin
daveaton21-Dec-14 10:10
memberdaveaton21-Dec-14 10:10 
AnswerRe: Visual C++ Redistributable Package for Visual Studio 2013 Pin
stfx13-Jan-15 11:06
memberstfx13-Jan-15 11:06 
GeneralRe: Visual C++ Redistributable Package for Visual Studio 2013 Pin
daveaton30-Jan-15 6:33
memberdaveaton30-Jan-15 6:33 
QuestionHow can i Install IE 10 or 11 using InnoSetup Installer ? Pin
kalpesh280419-Nov-14 19:09
memberkalpesh280419-Nov-14 19:09 
QuestionWhy .Net 4.5 has no support for localization? Pin
Mario Vernari7-Oct-14 5:52
memberMario Vernari7-Oct-14 5:52 
SuggestionSupport for SQL Server 2014 LocalDB Pin
Mysteryx9325-Sep-14 12:04
memberMysteryx9325-Sep-14 12:04 
GeneralRe: Support for SQL Server 2014 LocalDB Pin
Petr Šikola12-Jun-15 0:19
memberPetr Šikola12-Jun-15 0:19 
GeneralWIC exe being ignored Pin
FreeDragon8029-Jul-14 4:50
memberFreeDragon8029-Jul-14 4:50 
GeneralRe: WIC exe being ignored Pin
stfx31-Jul-14 2:23
memberstfx31-Jul-14 2:23 
GeneralRe: WIC exe being ignored Pin
FreeDragon8031-Jul-14 2:35
memberFreeDragon8031-Jul-14 2:35 
Question.Net Framework & VCRedist2010 User Interaction Required. Pin
kalpesh280428-Jul-14 21:07
memberkalpesh280428-Jul-14 21:07 
QuestionCrystal Report 2013 Pin
kalpesh280428-Jul-14 19:28
memberkalpesh280428-Jul-14 19:28 
SuggestionVC Runtime 2012 Update 4 Pin
Brisingr Aerowing21-Jun-14 4:38
professionalBrisingr Aerowing21-Jun-14 4:38 
GeneralRe: VC Runtime 2012 Update 4 Pin
stfx24-Jun-14 5:22
memberstfx24-Jun-14 5:22 
GeneralRe: VC Runtime 2012 Update 4 Pin
Brisingr Aerowing25-Jun-14 16:48
professionalBrisingr Aerowing25-Jun-14 16:48 
GeneralRe: VC Runtime 2012 Update 4 Pin
stfx28-Jun-14 6:05
memberstfx28-Jun-14 6:05 
GeneralRe: VC Runtime 2012 Update 4 Pin
Vectorcorp24-Feb-15 13:13
memberVectorcorp24-Feb-15 13:13 
GeneralRe: VC Runtime 2012 Update 4 Pin
stfx1-Mar-15 7:26
memberstfx1-Mar-15 7:26 
SuggestionMy Vote Of 5 Pin
AnthoniG15-Jun-14 3:07
memberAnthoniG15-Jun-14 3:07 
QuestionIs it free for commercial use ?? Pin
Tridip Bhattacharjee2-Jun-14 21:11
memberTridip Bhattacharjee2-Jun-14 21:11 
AnswerRe: Is it free for commercial use ?? Pin
stfx2-Jun-14 21:51
memberstfx2-Jun-14 21:51 
QuestionThis might be useful Pin
Rinat Galyautdinov25-Sep-13 18:48
memberRinat Galyautdinov25-Sep-13 18:48 
QuestionHow to install prerequisite without showing any dialog box Pin
gauravchandok20022-Aug-13 20:38
membergauravchandok20022-Aug-13 20:38 
Question.NET 4 Full vs Client profile - which gets installed? Pin
nmg1963-Jun-13 1:51
membernmg1963-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
memberMember 870685915-May-13 18:02 
QuestionAbout define use_dotnetfx35 Pin
terra.jr8-May-13 4:02
memberterra.jr8-May-13 4:02 
GeneralWhat are the steps to use this tool? Pin
Chaim Tovim7-May-13 10:47
memberChaim Tovim7-May-13 10:47 
QuestionDependencies file name Pin
fandisus28-Feb-13 0:25
memberfandisus28-Feb-13 0:25 
AnswerRe: Dependencies file name Pin
stfx6-May-13 21:59
memberstfx6-May-13 21:59 
GeneralMy vote of 5 Pin
Nicolas Cornet6-Feb-13 22:35
memberNicolas Cornet6-Feb-13 22:35 
QuestionWin 2008 R2 installation using the role manager Pin
torno22-Jan-13 4:47
membertorno22-Jan-13 4:47 
AnswerRe: Win 2008 R2 installation using the role manager Pin
torno24-Jan-13 2:13
membertorno24-Jan-13 2:13 
GeneralRe: Win 2008 R2 installation using the role manager Pin
Harald Binkle4-Apr-13 2:49
memberHarald Binkle4-Apr-13 2:49 
GeneralRe: Win 2008 R2 installation using the role manager Pin
Freddyvdh15-Jan-14 5:22
memberFreddyvdh15-Jan-14 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150728.1 | Last Updated 29 Jan 2015
Article Copyright 2007 by stfx
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid