|
|
|
| acAutoUpgrader component.
|
| var
|
| TacAULostFileEvent = procedure(Sender: TObject; const FileURL: String; ErrorCode: Integer; var ContinueUpgrade: Boolean) of object;
|
|
|
| property OnLostFile: TacAULostFileEvent;
|
| The OnLostFile event occurs if some file, of that which listed in the downloaded Info-file, can not be downloaded by specified URL (error code has received in the response header from HTTP server).
|
|
|
| Most common error reason is HTTP error #404 (document not found), but please check out all HTTP status codes for more information about HTTP errors.
|
|
|
| The AutoUpgrader passes following parameters to the OnLostFile event handler:
|
| Parameter | Meaning
|
| FileURL | the Internet address of the file which we just tryed to download;
|
| ErrorCode | integer number which identifies the HTTP error (see the list of HTTP Status Codes to recognize an error).;
|
| ContinueUpgrade | set this flag variable to True if you wish to skipinaccessible file and still continue the upgrade.
|
|
|
| procedure TForm1.acAutoUpgrader1LostFile(Sender: TObject;
|
| FileURL: string; ErrorCode: Integer;
|
| var ContinueUpgrade: Boolean);
|
| begin
|
| ContinueUpgrade := Application.MessageBox(PChar('File "' + FileURL + '" not found or inaccessible.'#13#13'Try to skip this file and continue upgrade?'),
|
| PChar('Error #' + IntToStr(ErrorCode)),
|
| MB_YESNO or MB_ICONWARNING) = ID_YES;
|
| end;
|
| void __fastcall TForm1::acAutoUpgrader1LostFile(TObject *Sender,
|
| AnsiString FileURL, int ErrorCode, bool &ContinueUpgrade)
|
| {
|
| AnsiString Msg =
|
| "File \'" + FileURL + "\' not found or inaccessible.\n\n"
|
| "Try to skip this file and continue upgrade?";
|
| AnsiString Capt =
|
| "Error #" + IntToStr(ErrorCode);
|
|
|
| ContinueUpgrade = Application->MessageBox(Msg.c_str(),
|
| Capt.c_str(), MB_YESNO | MB_ICONWARNING) == ID_YES;
|
| }
|
| ShowMessages property;
|
| Info-file example; HTTP Status Codes.
|