ocx 最头痛的问题就是你说的!
不过也有瞒天大法:即做一个xshell.ocx 只负责升级的狗狗!一经发布,用不升级,然后让它来升级!我是完美解决了!
有空来
www.51merit.com
做客
procedure TFrmDDXShell.btnExecuteClick(Sender: TObject);
var
tStream: TFileStream;
saveFile: string;
begin
timer1.Enabled := true;
if MisHttpUrl = '' then MisHttpUrl := 'http://127.0.0.1/web/';
memo1.Lines.Add(MisHttpUrl);
saveFile := GetWinDir() + 'config.ini';
if DownFile(MisHttpUrl + 'config.ini', saveFile) then
GetVer(saveFile)
else
showmessage( 'config.ini' + 'ÍøÂçÅäÖôíÎó...');
// showmessage(MisHttpUrl + 'config.ini' + 'ÍøÂçÅäÖôíÎó...');
if GetOCXVer(ywGUID) < ywver then
begin
saveFile := GetWinDir() + mytime_guid() + ywfile;
MEMO1.Lines.Add(MisHttpUrl + ywfile + '&Oacute;&ETH;&ETH;&Acirc;°&aelig;±&frac34;,&Otilde;&yacute;&Ocirc;&Uacute;&Iuml;&Acirc;&Ocirc;&Oslash;,&Ccedil;&euml;&Eacute;&Ocirc;&micro;&Egrave;...');
if DownFile(MisHttpUrl + ywfile, saveFile) then
begin
MEMO1.Lines.Add(YWFILE + '&Iuml;&Acirc;&Ocirc;&Oslash;&sup3;&Eacute;&sup1;&brvbar;...');
// winexec(pchar('regsvr32.exe /s ' + saveFile), sw_hide);
OLERegister(saveFile);
MEMO1.Lines.Add(YWFILE + '×&cent;&sup2;á&sup3;&Eacute;&sup1;&brvbar;...');
end
else
MEMO1.Lines.Add(YWFILE + '&cedil;ü&ETH;&Acirc;&Ecirc;§°&Uuml;,&Ccedil;&euml;&Eacute;&Ocirc;&ordm;ó&Ocirc;&Ugrave;&Ecirc;&Ocirc;...');
end
else
MEMO1.Lines.Add(YWFILE + '&Ograve;&Ntilde;&frac34;&shy;&Ecirc;&Ccedil;&ETH;&Acirc;°&aelig;±&frac34;...');
tmpvgver := GETOCXVER('{465BBD45-50E1-11D7-8803-00E09876BB62}');
if tmpvgver < vgver then
begin
saveFile := GetWinDir() + mytime_guid() + vgfile;
MEMO1.Lines.Add(vgFILE + '&Oacute;&ETH;&ETH;&Acirc;°&aelig;±&frac34;,&Otilde;&yacute;&Ocirc;&Uacute;&Iuml;&Acirc;&Ocirc;&Oslash;,&Ccedil;&euml;&Eacute;&Ocirc;&micro;&Egrave;...');
if DownFile(MisHttpUrl + vgfile, saveFile) then
begin
MEMO1.Lines.Add(vgFILE + '&Iuml;&Acirc;&Ocirc;&Oslash;&sup3;&Eacute;&sup1;&brvbar;...');
// winexec(pchar('regsvr32.exe /s ' + saveFile), sw_hide);
OLERegister(saveFile);
MEMO1.Lines.Add(vgFILE + '×&cent;&sup2;á&sup3;&Eacute;&sup1;&brvbar;...');
end
else
MEMO1.Lines.Add(vgFILE + '&cedil;ü&ETH;&Acirc;&Ecirc;§°&Uuml;,&Ccedil;&euml;&Eacute;&Ocirc;&ordm;ó&Ocirc;&Ugrave;&Ecirc;&Ocirc;...');
end
else
MEMO1.Lines.Add(vgFILE + '&Ograve;&Ntilde;&frac34;&shy;&Ecirc;&Ccedil;&ETH;&Acirc;°&aelig;±&frac34;...');
Set_isover(1);
BTNEXECUTE.Caption:='AAAAA';
self.OnClick(SENDER);
end;