崩溃了,求救!!!!
一个更新程序,40多台电脑里面只有几台总是更新不了的,代码大体如下:
constructor TAutoUpdate.Create(ServerUpdatePath :string);
begin
Path_Remote := ServerUpdatePath;
Path_Target := ExtractFilePath(Application.ExeName);
FList := TStringList.Create;
FList.CommaText := 'Connect.ini lic PMain.exe';
end;
//下面这个函数出了什么问题?有几台电脑每次都没有复制文件到本地,而且返回的值为FALSE,检查权限方面又没发现有什么异常
function TAutoUpdate.UpdateFiles :boolean;
var
i :integer;
SourceFile, LocalFile, ExeName :string;
begin
Result := false;
ExeName := ExtractFileName(Application.ExeName);
for i:=0 to FList.count-1 do
begin
if FList.Strings[i]<> ExeName then
continue;
SourceFile := Path_Remote +FList.Strings[i];
LocalFile := Path_Target +FList.Strings[i];
if not FileExists(SourceFile) then
exit;
if not FileExists(LocalFile) then
exit;
if GetBuildInfo(SourceFile)=GetBuildInfo(LocalFile) then //该处函数单独认证过没问题,主要用于比较版本
exit;
//将远程文件复制到本地
CopyFile(Pchar(SourceFile), Pchar(Path_Target +'~'+FList.Strings[i]), false);
Result := True;
end;
end;