Reputation: 37701
I'm developing the installer for a Java 64 bit application with Inno Setup.
It is possible with Inno Setup to check if Java 64 bit is present in the computer and if not to display the user a link for download Java 64 bit?
What should I add to Inno Setup script it to achieve that behaviour?
Upvotes: 3
Views: 1154
Reputation: 1710
Below you can find a script that could check if JRE is installed then prompt a message for the user I used this Stack Overflow post as reference: How do I install a JRE from an Inno Setup?
[Code]
{ Script to check if a JRE is installed }
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
JavaVer: string;
begin
RegQueryStringValue(
HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', JavaVer);
Result := (Length(JavaVer) > 0);
if not Result then
begin
if MsgBox('YOUR MESSAGE GOES HERE', mbConfirmation, MB_YESNO) = idYes then
begin
ShellExec(
'open', 'https://www.java.com/en/download/manual.jsp#win',
'', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;
end;
Upvotes: 2