老师,自己做的自定义升级,出现了这样的错误:
error extracting entry from zip file
和
error inflating:invalid stored block lengths
另外,要升级第二次才会把下载下来升级包解压出来
解压后也并没有删除升级包
Dim IP2 As String = "106.XXX" '外网
Dim IPa As String = IP2 '采用值
Dim ftpAccount As String = "ft" '设置ftp登录用户名
Dim ftppassword As String = "a" '设置ftp登录密码
Dim Exit0 As String = "0" '是否正常退出标识.0-非正常退出,指点屏幕右上角的X退出
Dim pname As String = "智慧工场"
Dim dpath As String = ProjectPath
Dim upath As String = "\XXX\sjb\" '服务器上的项目文件路径和升级路径
Dim datafile As String = pname & ".zip" '包含最新升级数据的文件名
Dim ftp1 As new ftpclient
ftp1.TimeOut = 20000 '用于设置尝试操作的毫秒数
ftp1.host = ipa
ftp1.Account = ftpAccount '设置ftp登录用户名
ftp1.password = ftppassword '设置ftp登录密码
ftp1.UTF8 = False
Dim s3 As String = upath & datafile '服务器上升级文件中包含升级内容的文件
Dim s4 As String = dpath & "\" & datafile '准备保存在客户端的包含升级内容的文件
If FileSys.DirectoryExists(dpath) = False Then
FileSys.CreateDirectory(dpath)
End If
ftp1.download(s3,s4,True) '非静默下载并另存
Dim zip As New zipFile
zip.Open(s4) '打开升级文件
zip.Extractall(dpath) '全部解压到客户端运行文件夹,要升级两次
zip.Close() '关闭升级文件
If FileSys.FileExists(s4) Then '如果指定的文件存在
FileSys.deleteFile(s4,2,2) '删除升级文件
End If 解压后也并没有删除升级包
Exit0 = "1"
Syscmd.Project.Open(ProjectFile) '重新打开项目