UEStudio Update Checker

UEStudio is a great editor, but it lacks an auto-check for updates. Here is a simple little piece of software that you can put into your Startup group that will check for a new version of UEStudio on every Windows reboot.

UEStudio Update Checker

You can download the compiled version here : http://alex.mwyann.com/divers/uesuc.exe. If you’re paranoid, or if you didn’t installed UEStudio in the default folder (i.e C:\Program Files\IDM Computer Solutions\UEStudio) then here is the source code for you to build it again (I’m using Delphi 7).

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ScktComp;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Timer1: TTimer;
ClientSocket1: TClientSocket;
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ClientSocket1Connect(Sender: TObject;
Socket: TCustomWinSocket);
procedure ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;

var
Form1: TForm1;

implementation

var answer:string;
currentver,latestver:string;

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (latestver <> '') and (latestver = currentver) then Application.Terminate;
end;

procedure TForm1.FormShow(Sender: TObject);
var c,pval:pointer;
pvalsize:cardinal;
size:word;
begin
ClientSocket1.Active:=true;
size:=GetFileVersionInfoSize('C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe',pvalsize);
getmem(c,size);
GetFileVersionInfo('C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe',pvalsize,size,c);
VerQueryValue(c,'\StringFileInfo\040904E4\FileVersion',pval,pvalsize);
currentver:=StrPas(pval);
freemem(c);
Label2.Caption:='Current: '+currentver;
end;

procedure TForm1.ClientSocket1Connect(Sender: TObject;
Socket: TCustomWinSocket);

var s:string;
begin
answer:='';
s:= 'GET /updates/uestudio/uesupdates2 HTTP/1.1'#13#10+
'User-Agent: Microsoft Internet Explorer'#13#10+
'Host: www.ultraedit.com'#13#10+
'Connection: Keep-Alive'#13#10+
#13#10;
Socket.SendText(s);
end;

procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var i:word;
s:string;
begin
answer:= answer+Socket.ReceiveText;
if (pos('download',answer) > 0) then begin
i:=pos('hotfix',answer);
if (i = 0) then i:=pos('version',answer);
s:=copy(answer,i+7,40);
i:=pos('=',s);
s:=copy(s,i+1,40);
i:=pos('|',s);
latestver:=copy(s,1,i-1);
Label3.Caption:='Latest: '+latestver;
if (latestver = currentver) then Label1.Caption := 'No update found.'
else Label1.Caption := 'New update found!';
end;
end;

end.