autoupgrader CheckUpdate method
Return to Introduction  Previous page  Next page
Applies to
auAutoUpgrader component.  

Declaration
function CheckUpdate(JustCheckIsUpdateAvailable: Boolean = False): Boolean;  

Description
Call CheckUpdate method to check for the application updates and initiate the upgrade process (if newer version are really exists, and JustCheckIsUpdateAvailable parameter is False on function call).  
 
In case if you just want to check whether update available, without any message boxes — call this method as CheckUpdate(True), and check whether update are available in function result.  

How does it works?
When you call CheckUpdate method, the AutoUpgrader will download the file which contains the upgrade information (Info-file) from the URL specified in InfoFileURL property. If AutoUpgrader can not read remote information file, the OnNoInfoFile event occurs (or OnHostUnreachable, in case if user currently disconnected from Internet).  
 
If file which contains the upgrade information has successfully downloaded, AutoUpgrader parses it to check whether the newer version of application already available for download. If compares the #date variable in Info-file with VersionDate property, or #number variable with VersionNumber property (this depends on method which you using for VersionContorl).  
 
If new version are really exists, it fires OnBeginUpgrade event, then initiate downloading of all updated files to replace them locally.  

Example
Delphi:
procedure TForm1.CheckUpdateBtnClick(Sender: TObject);  
begin  
  auAutoUpgrader1.CheckUpdate;  
end;  



C++ Builder:

void __fastcall TForm1::CheckUpdateBtn1Click(TObject *Sender)  
{  
  auAutoUpgrader1->CheckUpdate();  
}  

See also
Abort method; Info-file example;  
AutoCheck and VersionControl properties;  
OnBeginUpgrade, OnNoUpdateAvailable and OnNoInfoFile events.