tags:

views:

166

answers:

1

Hello,

I want to check whether hre 1.6 or higher is installed or not. If installed I want to progress my application. If not installed , I want to install jre-6u17-windows-i586-s.exe after successfully installing jre , my control not returns to inno again. Please send a inno script for that.

best regards

SOumen

+1  A: 

For the [FILES] section:

[Files]
Source: "jre-6u17-windows-i586-s.exe"; DestDir: "{app}\JRE 1.6"; Flags: onlyifdoesntexist

For the [CODE] section:

[Code]
Function JREInstallPrompt:Boolean;
begin
  if ((msgBox ('Do you want to install JRE 1.6?',mbinformation,mb_YesNo)=idYes)) then
   begin
     msgBox ('JRE 1.6 will being installing now. Please do not restart the machine or log off until it is complete!',mbinformation,mb_OK);
     Result:=True;
   end
 else Result:=False;
end;

Function JREVerifyInstall:Boolean;
begin
 if ((RegValueExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\JavaSoft','InstallerVersion')) or (JREInstallPrompt=False)) then //Exists or do not install
   Result:=False
 else Result:=True;
end;

And for the RUN section:

[Run]
;SQL Server Express 2005 Installer
Filename: "{app}\JRE 1.6\jre-6u17-windows-i586-s.exe"; WorkingDir: {app}\JRE 1.6; StatusMsg: Installing Java Runtime Environment... Please Wait...;Check:JREVerifyInstall

Hopefully that will get you pointed in the right direction.

Jeff