• TwitterFacebookGoogle PlusLinkedInRSS FeedEmail

Inno Setup Install Prerequisites

10.09.2019 
Inno Setup Install Prerequisites

I need to install some prerequisites for an app using Inno. I want the prerequisites to only install if the prerequisite does not exist or is an earlier version. I have found some solutions such as. The process is easy, if the Check function of the.NET setup entry of the Files section evaluates to True (FrameworkIsNotInstalled), the entry is processed, which copies the setup binary into the Inno Setup's temporary folder and if that succeeds, the AfterInstall function InstallFramework is.

Active1 month ago

This question already has an answer here:

Inno Setup Install Prerequisites
  • How can I install .NET framework as a prerequisite using Inno Setup? 4 answers
  • Inno Setup: Verify that .NET 4.0 is installed 3 answers

I need to install some prerequisites for an app using Inno. I want the prerequisites to only install if the prerequisite does not exist or is an earlier version. I have found some solutions such as:

That does not look like it checks to see if the framework exists already or what version may already be installed.

What is the pattern to use to look for a previously installed version, if it exists then check version and if version is older or does not exist then install?

EricEric
3932 gold badges4 silver badges15 bronze badges

marked as duplicate by Martin Prikryl inno-setupAug 1 at 8:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

This a simple answer to head you in one of many possible solutions.

In the testing environment (or in your computer) you install the application and all the required components, so you have them appear in the control panel's Programs and Features

Then you search in the registry for the name that appears in the Programs and Features

You want to find the value DisplayName that contains that name. You'll find it in one key of

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall, HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionUninstall

or

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionUninstall

, depending of the type of installation.

Note: Some components can be hidden from the Programs and Features if the value SystemComponent is 1 in the correspondent key.

Then you can check the registry key existence with something like this in pascal script Fundamentals of nanoelectronics hanson free.

You can call this function inside function PrepareToInstall(var NeedsRestart: Boolean): String; or using check parameters (search in inno setup help)

Inno Setup Install Prerequisites
JPBJPB
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Inno Setup Install Prerequisites Free

Not the answer you're looking for? Browse other questions tagged inno-setup or ask your own question.