I\'m creating an Inno Setup installer for a jar app. What I want to do right now is to check if java is present before proceeding with the install. So I only need to be sure the
A simple alternative to the already proposed answers:
[Code]
function InitializeSetup(): boolean;
var
ResultCode: integer;
begin
if Exec('java', '-version', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
Result := true;
end
else begin
if MsgBox('This tool requires Java Runtime Environment version 1.6 or newer to run. Please download and install the JRE and run this setup again. Do you want to download it now?', mbConfirmation, MB_YESNO) = idYes then begin
Result := false;
ShellExec('open', 'https://java.com/download/', '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
end;
end;
end;