IsFinished: Boolean;
The IsFinished property returns whether update is applied successfully.
The property returns True if update is installed successfully, and False if any errors occurred during installation.
Executing the example requires the update file D:\Work\update.pefx.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
Mb: IMetabase;
Update: IMetabaseUpdate;
Log: IMetabaseUpdateLog;
Progress: CUpdateProgress;
Begin
Mb := MetabaseClass.Active;
// Load update from file
Update := Mb.CreateUpdate;
Update.LoadFromFileNF("D:\Work\update.pefx");
// Apply update
Progress := New CUpdateProgress.Create;
Update.Apply(Progress);
// View general information in update log
Log := Update.Log;
If Log.IsFinished Then
Debug.WriteLine("---Update is finished successfully---");
Else
Debug.WriteLine("---Update failed---");
Debug.WriteLine("Conflicts of correspondence between object in update and in repository: " + Log.HasConflicts.ToString);
Debug.WriteLine("Errors on object update: " + Log.HasErrors.ToString);
Debug.WriteLine("Skipped errors: " + Log.HasErrorSkipped.ToString);
Debug.WriteLine("Inconsistency of object dependencies: " + Log.HasOnResolve.ToString);
End If;
Debug.WriteLine("Update start: " + Log.UpdateStartTimestamp.ToString);
Debug.WriteLine("Update end: " + Log.UpdateFinishTimestamp.ToString);
Debug.WriteLine("Repository, in which update is applied: " + Log.UpdateMetabase);
Debug.WriteLine("User: " + Log.UpdateUserName);
Debug.WriteLine("User SID: " + Log.UpdateUserSID);
Debug.WriteLine("Workstation, from which update was installed: " + Log.UpdateWorkstation);
End Sub UserProc;
Class CUpdateProgress: UpdateProgress
Sub OnError(Data: IMetabaseUpdateProgressData; Var Ignore: Boolean);
Begin
Ignore := True;
End Sub OnError;
End Class CUpdateProgress;
After executing the example the update from the specified file is loaded and installed. General information about installation results will be displayed in the development environment console.
See also: