用木瓜myfll,如服务器设"it1000.txt"和安装程序"IT1000setup.exe",程序下载地址设定
http://xxx.xxx.xxx.xxx/it1000.txt
http://xxx.xxx.xxx.xxx/IT1000setup.exe
其中:
(一)it1000.txt文件,内容包含:
[config]
Version=2.0.1.1
(二)主程序为:IT1000.exe ,本例程序放在D:\
1.内设版本量,常量标志: it1000ver="1.0.9.5"
2.内设升级程序段:
updateip="http://xxx.xxx.xxx.xxx"
*下载用于识别新版本
=DownFile(updateip+"/IT1000.txt","d:\it1000.txt")
NEWVER=iniRead("Version","0.0.0.0","config","d:\it1000.txt")
IF it1000Ver=NewVer .OR. it1000Ver>NewVer
dele file "d:\it1000.txt"
retu
ENDIF
*下载安装程序进行更新
=DownFile(updateip+"/IT1000setup.exe","d:\it1000setup.exe")
XXRAND=ALLTRIM(STR(INT(1000*RAND()),3,0))
vbat="d:\it"+XXRAND+'.BAT'
SET ALTE TO &vbat
SET ALTE ON
SET CONSOLE OFF
?[CMD /C taskkill /f /im it1000.exe]
?[start "d:\IT1000setup.exe"]
?[del "d:\it1000setup.exe"]
?[start "d:\IT1000.exe"]
?[del %0]
?[ ]
SET ALTE OFF
SET ALTE TO
SET CONSOLE on
Declare Long WinExec In kernel32 String,Long
=WinExec(vbat,0)
平时上传 http://xxx.xxx.xxx.xxx/it1000.txt 和
http://xxx.xxx.xxx.xxx/IT1000setup.exe 两个文件就行了
[此贴子已经被作者于2016-7-8 16:58编辑过]