delphi 的可执行文件(EXE)可以这样更新后重启

var
StrExePath,strEXE:string;
begin
StrExePath:=ExtractFilePath(Application.ExeName);
strEXE:='Project1.exe';
showmessage('down is over') ;
  close;
 if  RenameFile(StrExePath+StrExe,'123.exe') then
  ShellExecute(Handle,'',PChar('123.exe'),'','',SW_NORMAL);
end;

posted on 2011-11-17 08:29  舟山牙医  阅读(390)  评论(0编辑  收藏  举报

导航