autoupgrader OnEndUpgrade event
Return to Introduction  Previous page  Next page
Applies to
acAutoUpgrader component.  

Declaration
type  
  TacAUEndUpgradeEvent = procedure(Sender: TObject; var RestartImediately: Boolean) of object;  
 
property OnEndUpgrade: TacAUEndUpgradeEvent;  

Description
The OnEndUpgrade event occurs when application has successfully updated and about to be restarted.  
 
iiinfo If you are using the built-in Application Update Wizard, this event will occur when user press OK button on Wizard form.  
 
tip Set RestartImediately parameter to False, if you don't want to restart your application imediately after processing this event handler, and prefer to call RestartApplication method later, to restart and upgrade the application "manually".  

Example // overrides restarting the application, awaiting until user click some "Finish" button to restart the app
procedure TForm2.acAutoUpgrader1EndUpgrade(Sender: TObject);  
begin  
  RestartImediately := False; // restart it later when user click "Finish" button  
end;  
 
procedure TForm2.FinishButtonClick(Sender: TObject);  
begin  
  RestartApplication(''); // restart with default parameters  
                          // (RestartParams + use upgrade method specified in the Info-file)  
end;  

See also
RestartParams property and RestartApplication method;  
OnDoOwnCloseAppMethod, OnAfterRestart and OnBeginUpgrade events.