软件自动更新的问题?
我有应用程序,现在想做一个自动更新程序:
功能如下:
是否有新的版本的应用程序
如果没有,则正常启动;
如果有,则下载新的程序运行!
请问如何实现呢?
各位大侠帮帮小弟吧,最好能给出思路代码
谢谢!!
问题点数:100、回复次数:13Top
1 楼hhzqf1980(hh)回复于 2005-04-04 10:13:10 得分 0
怎么没有人回答啊
快帮帮小弟吧
谢谢大家!Top
2 楼Heyongfeng(小何)回复于 2005-04-04 10:18:52 得分 0
做一个下载的小程序,用HTTP或FTP都行,在主程序启动时检查网上或数据中的版本信息,如果有新版本则启动下载程序下载.
盒子上有源码Top
3 楼aiirii(ari-http://spaces.msn.com/members/aiirii/)回复于 2005-04-04 10:31:22 得分 0
http://www.fulgan.com/delphi/autoupdate_unit_for_delphi.htmTop
4 楼hhzqf1980(hh)回复于 2005-04-04 10:51:18 得分 0
aiirii(ari-广州*淘金坑) :
你好,我下载了程序,提示ProxyParams出现错误
请问怎么处理啊?
谢谢
Top
5 楼hhzqf1980(hh)回复于 2005-04-04 10:53:59 得分 0
是不是我的机器上没有装什么控件呢?
Top
6 楼pengxuan(网虫先生)回复于 2005-04-04 11:48:11 得分 0
做一个下载的小程序,用HTTP或FTP都行,在主程序启动时检查网上或数据中的版本信息,如果有新版本则启动下载程序下载.Top
7 楼shove(shove)回复于 2005-04-04 14:20:20 得分 0
关键问题是:
软件自己更新自己的问题!(exe)
更新的功能单独作成一个 exe 文件。
主程序启动是调用这个exe,得到的返回参数是要更新,则 exit,交由更新程序去更新覆盖。
更新的 exe 程序更新完成后,再调用主 exeTop
8 楼hhzqf1980(hh)回复于 2005-04-05 15:57:07 得分 0
顶Top
9 楼mxj2000(小马)回复于 2005-04-05 16:09:34 得分 0
有这样的程序,不过合在系统里,拉出来太麻烦了Top
10 楼hhzqf1980(hh)回复于 2005-04-08 09:08:56 得分 0
高手帮忙啊Top
11 楼soddyzjx118(1)回复于 2005-04-08 09:29:35 得分 0
本地文件先改名,
建立文件流,文件流的内容来自新版本的文件。
然后保存为本地文件名 ,ok? 我这样实现的。Top
12 楼FigoZhu(谢慕安)回复于 2005-04-08 11:20:53 得分 0
http://www.nuclear2000.comTop
13 楼cdkogh(xp++)回复于 2005-04-08 12:39:33 得分 100
登陆时:
if FCurVer<>CCurVer then
begin // 版本不一致……
FN := GetTempDirectory + '***.exe';
IdFTP1.Connect();
IdFTP1.Get('***.exe', FN, True);
IdFTP1.Disconnect;
ReplaceFile(FN);
Application.Terminate;
end;
procedure ReplaceFile(AFName: string);
var
BatchFile: TextFile;
BatchFileName: string;
ProcessInfo: TProcessInformation;
StartUpInfo: TStartupInfo;
begin
BatchFileName := changefileext(paramstr(0),'.bat');
AssignFile(BatchFile, BatchFileName);
Rewrite(BatchFile);
Writeln(BatchFile, ':try');
Writeln(BatchFile, 'del "' + ParamStr(0) + '"');
Writeln(BatchFile, 'if exist "' + ParamStr(0) + '"' + ' goto try');
Writeln(BatchFile, 'copy "'+AFName+'" "'+ExtractFilePath(Application.ExeName)+'"');
Writeln(BatchFile, 'del %0');
CloseFile(BatchFile);
FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow := SW_HIDE;
if CreateProcess(nil, PChar(BatchFileName), nil, nil,False, IDLE_PRIORITY_CLASS,
nil, nil, StartUpInfo,ProcessInfo) then
begin
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
end;
Top




