Table of Content
HAL Forum
function boolean DirExists (
string DirPath)
Description:
Checks if the directory on given path exists. Uses HansaWorld root as the default directory.
Parameters:
DirPath The name and path of the directory that we are validating
function boolean CheckVersion(record HansaVersionVc HVr)
begin
  boolean res;
  res = false;
  
  if (DirExists(HVr.ProgramFolder)==false) then begin
    LogText(0,"CheckVersion failed, " & HVr.ProgramFolder & " does not exist");
    goto LCheckVersion;
  end;
  
  if (DirExists(HVr.ProgramFolder & "/hob")==false) then begin
    LogText(0,"CheckVersion failed, " & HVr.ProgramFolder & "/hob does not exist");
    goto LCheckVersion;
  end;
  
  if (FileExists(HVr.ProgramFolder & "/hob/startup.hob")==false) then begin
    LogText(0,"CheckVersion failed, " & HVr.ProgramFolder & "/hob/startup.hob does not exist");
    goto LCheckVersion;
  end;
  
  if (FileExists(HVr.ProgramFolder & "/hansa-server")==false) then begin
    LogText(0,"CheckVersion failed, " & HVr.ProgramFolder & "/hansa-server does not exist");
    goto LCheckVersion;
  end;
  
  res = true;
  
LCheckVersion:;
  CheckVersion = res;
  return;
end;
Related topics:
««