Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip installation in Inno Setup if other program is not installed

I have to find way how to skip installation if other program is not installed. I can detect registry of other program (basic script returns true/false), it is not problem. But I don't know how to skip installation.

In short: if one key in registry is not set, print message 'instal program xyz before this one' and finish installator.

like image 605
Ajax Avatar asked May 06 '11 08:05

Ajax


People also ask

Is Inno Setup free?

Inno Setup is a free installer for Windows programs by Jordan Russell and Martijn Laan.

How do I make an inno file executable?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.

Is Inno Setup open source?

Inno Setup grew popular due to being free and open source; free for both commercial and non-commercial use, many software companies switched to the tool.

What does Inno Setup do?

Inno Setup is an open source script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997. Since Jordan Russell wasn't satisfied with InstallShield Express which he had received upon purchase of Borland Delphi, he decided to make his own installer.


1 Answers

This is very easy. Just add

[Code]

function IsApp2Installed: boolean;
begin
  result := RegKeyExists(HKEY_LOCAL_MACHINE,
    'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\app2.exe');
end;

function InitializeSetup: boolean;
begin
  result := IsApp2Installed;
  if not result then
    MsgBox('You need to install App2 before you install ThisApp. Install App2 and then run this installer again.', mbError, MB_OK);
end;

to your ISS file. InitializeSetup is a so-called event function that is executed when the installer starts (even before the wizard GUI is shown). If you return false, the installer will exit immediately.

like image 180
Andreas Rejbrand Avatar answered Sep 18 '22 00:09

Andreas Rejbrand