Detect Java Runtime

//===========================================================================
//
//  Topic:    CheckandInstallJavaRuntime
//
//  Description: 
//
//  My Name    :  
//
//===========================================================================
 
 function BOOL CheckandInstallJavaRuntime()
      NUMBER nType,nvSize;
      STRING sPathRegitrySetup,svValue;
      
 begin

		nType = REGDB_STRING;
		 
		RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
		
		sPathRegitrySetup = "SOFTWARE\\JavaSoft\\Java Runtime Environment";
		          
		RegDBGetKeyValueEx ( sPathRegitrySetup, "CurrentVersion", nType,svValue, nvSize ); 
		
		if(svValue=="")  then        
		     
		      if (LaunchAppAndWait(SRCDIR^"Java\\jre-6u7-windows-i586-p-s.exe", "", LAAW_OPTION_WAIT) ="1.6") then
		    return TRUE;
	 else
	 		return FALSE;
	 
	 endif;
end; 

//===========================================================================
//
//  Topic:    InformFinishJavaRuntime
//
//  Description: 
//
//  My Name    :  
//
//===========================================================================
 
function InformFinishJavaRuntime()
	 number  nResult, nLevel, nSize, nSetupType;
    string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
    string  szName, szCompany, szTargetPath, szDir, szFeatures;
    BOOL    bLicenseAccepted;	
    
    STRING   szProductName;

    STRING   szMsg1, szMsg2;

    BOOL     bvOpt1, bvOpt2;

    NUMBER   nReturn;
                        
    number	 nType, nMediaFlags;
    string	szIgnore,svOldPath;
    STRING szKey, szNumName, szNumValue, svNumValue;  
    
begin
	   	szTitle =@PRODUCT_NAME + "  Installation is not Completed.";

   
        szMsg1 = "Java Runtime Environment installation is not completed";
            

    	szMsg2  = "Click Finish to complete %P Setup.";
    
		SdFinish (szTitle, szMsg1, szMsg2, szOpt1, szOpt2, bvOpt1, bvOpt2);

 		abort;
 

end;

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: