⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helper.pas

📁 autoupdate 1.02 source code
💻 PAS
字号:
unit helper;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, AutoUpdate;

type
  THelperForm = class(TForm)
    AutoUpdate1: TAutoUpdate;
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  HelperForm: THelperForm;

implementation

{$R *.DFM}

// parameters...
// http://itig.it.swin.edu.au/autoupdate.php rawwrite upgrade c:\program files\linus\rawwritewin.exe
// https://infoin-01.it.swin.edu.au/server/autoupdate.php infoinINFOIN2 upgrade c:\temp\infoinlw.exe

function FileIsEXE(FileName : String) : Boolean;
var
   Suffix : String;
begin
   Suffix := Copy(FileName, Length(FileName) - 3, 4);
   if LowerCase(Suffix) = '.exe' then
   begin
      Result := True;
   end
   else
   begin
      Result := False;
   end;
end;

procedure THelperForm.Button1Click(Sender: TObject);
begin
   Close;
end;

procedure THelperForm.FormCreate(Sender: TObject);
begin
   Show;
   Application.ProcessMessages;
   Sleep(1);
   
   AutoUpdate1.URL := ParamStr(1);
   AutoUpdate1.ApplicationName := ParamStr(2);

   if ParamStr(3) = 'upgrade' then
   begin
      AutoUpdate1.DestinationFile := ParamStr(4);
      AutoUpdate1.ResourceName := ParamStr(5);

      AutoUpdate1.ResourceImage := AutoUpdate1.DestinationFile;
      AutoUpdate1.PerformUpgrade;
   end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -