InitializeSetup , ?
InitializeSetup Check, . , ( ) (), Check , [Run].
, Check . , -. , , JRE Check.
Java SE?
64-. WOW node, 64- JRE 64- Windows. - :
[Run]
Filename: "{app}\MyApp.exe"; Flags: nowait postinstall skipifsilent; Check: IsJREInstalled
[Code]
function IsJREInstalled: Boolean;
var
JREVersion: string;
begin
Result := RegQueryStringValue(HKLM32, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
if not Result and IsWin64 then
Result := RegQueryStringValue(HKLM64, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
if Result then
Result := CompareStr(JREVersion, '{#MinJRE}') >= 0;
end;
function InitializeSetup: Boolean;
var
ErrorCode: Integer;
begin
Result := True;
if not IsJREInstalled then
begin
if MsgBox('Java is required. Do you want to download it now ?',
mbConfirmation, MB_YESNO) = IDYES then
begin
Result := False;
ShellExec('', '{#WebJRE}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;
end;