TabOrder = 1
OnClick = NightBuildCheckButtonClick
end
+ object CancelBitBtn: TBitBtn
+ Left = 96
+ Top = 8
+ Width = 97
+ Height = 25
+ Cancel = True
+ Caption = #12461#12515#12531#12475#12523
+ Enabled = False
+ TabOrder = 2
+ OnClick = CancelBitBtnClick
+ Glyph.Data = {
+ DE010000424DDE01000000000000760000002800000024000000120000000100
+ 0400000000006801000000000000000000001000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
+ 333333333333333333333333000033338833333333333333333F333333333333
+ 0000333911833333983333333388F333333F3333000033391118333911833333
+ 38F38F333F88F33300003339111183911118333338F338F3F8338F3300003333
+ 911118111118333338F3338F833338F3000033333911111111833333338F3338
+ 3333F8330000333333911111183333333338F333333F83330000333333311111
+ 8333333333338F3333383333000033333339111183333333333338F333833333
+ 00003333339111118333333333333833338F3333000033333911181118333333
+ 33338333338F333300003333911183911183333333383338F338F33300003333
+ 9118333911183333338F33838F338F33000033333913333391113333338FF833
+ 38F338F300003333333333333919333333388333338FFF830000333333333333
+ 3333333333333333333888330000333333333333333333333333333333333333
+ 0000}
+ NumGlyphs = 2
+ end
end
object Panel2: TPanel
Left = 0
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
- IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls, ExtCtrls;
+ IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls, ExtCtrls, Buttons;
type
TUpdateCheckForm = class(TForm)
IdHTTP: TIdHTTP;
IdAntiFreeze: TIdAntiFreeze;
NightBuildCheckButton: TButton;
+ CancelBitBtn: TBitBtn;
procedure UpdateButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure NightBuildCheckButtonClick(Sender: TObject);
+ procedure CancelBitBtnClick(Sender: TObject);
private
{ Private \90é\8c¾ }
FExecPath : string;
FExecArgs : string;
FAllowshutdown : Boolean;
+ FCanceled : Boolean;
function GetDesktopDir:string;
function GetDownloadFilePath(FileName: String): String;
function CreateShortCut(FileName, Argment, SavePath :string):boolean;
ResultMemo.Lines.Clear;
Screen.Cursor := crHourGlass;
UpdateButton.Enabled := False;
+ NightBuildCheckButton.Enabled := False;
try
ResStream := TMemoryStream.Create;
IdHTTP.Request.CacheControl := 'no-cache';
IdHTTP.Request.CustomHeaders.Add('Pragma: no-cache');
+ IdHTTP.ReadTimeout := 0;
IdHTTP.HandleRedirects := true;
downResult := TStringList.Create;
newest := TStringList.Create;
try
try
ResStream.Clear;
+ FCanceled := False;
+ CancelBitBtn.Enabled := True;
IdHTTP.Get(CHECK_URL, ResStream);
+ CancelBitBtn.Enabled := False;
+ if (FCanceled) then begin
+ raise Exception.Create('\83_\83E\83\93\83\8d\81[\83h\82ª\83L\83\83\83\93\83Z\83\8b\82³\82ê\82Ü\82µ\82½\81B');
+ end;
value := GikoSys.GzipDecompress(ResStream,
IdHTTP.Response.ContentEncoding);
downResult.Text := value;
ResStream.Free;
end;
finally
+ NightBuildCheckButton.Enabled := True;
UpdateButton.Enabled := True;
Screen.Cursor := crDefault;
end;
filename := GetDownloadFilePath(Copy(url, LastDelimiter('/', url) + 1, Length(url)));
fileStrem := TFileStream.Create(filename, fmCreate);
try
+ CancelBitBtn.Enabled := True;
IdHTTP.Get(url, fileStrem);
+ CancelBitBtn.Enabled := False;
+ if (FCanceled) then begin
+ raise Exception.Create('\83_\83E\83\93\83\8d\81[\83h\82ª\83L\83\83\83\93\83Z\83\8b\82³\82ê\82Ü\82µ\82½\81B');
+ end;
ResultMemo.Lines.Add(
IdHttp.ResponseText + '(' + IntToStr(IdHttp.ResponseCode) + ')');
FExecPath := filename;
FExecArgs := '';
FAllowshutdown := False;
end;
+//! \83L\83\83\83\93\83Z\83\8b\83{\83^\83\93\89\9f\89º
+procedure TUpdateCheckForm.CancelBitBtnClick(Sender: TObject);
+begin
+ CancelBitBtn.Enabled := False;
+ FCanceled := True;
+ if IdHTTP.Connected then begin
+ IdHTTP.Disconnect;
+ end;
+end;
end.