liuxiaolong
2020-06-11 aaef63e086f12d06cf5dae27007c81abf40ca3a2
service/SdkInstall.go
@@ -33,12 +33,16 @@
   zipFilePath := configPatchPath + "/"+identifier+ext
   unPackTargetPath := configPatchPath+"/"+identifier+"_basic/"
   md5DirPath := configPatchPath+"/"+identifier
   if util.Exists(zipFilePath) {
      strMd5, e := util.FileMd5(zipFilePath)
      if e !=nil || strMd5 == "" {
         go os.Remove(zipFilePath)
         if util.DirExists(unPackTargetPath) {
            go os.RemoveAll(unPackTargetPath)
         }
         if util.DirExists(md5DirPath) {
            go os.RemoveAll(md5DirPath)
         }
         return false,errors.New("获取安装包md5失败")
      }
@@ -52,6 +56,9 @@
         go os.Remove(zipFilePath)
         if util.DirExists(unPackTargetPath) {
            go os.RemoveAll(unPackTargetPath)
         }
         if util.DirExists(md5DirPath) {
            go os.RemoveAll(md5DirPath)
         }
         logger.Debug("strMd5 is", strMd5,"identifier is",identifier,"not equal")
         return false,errors.New("校验安装文件失败")
@@ -72,12 +79,16 @@
   //1.解压缩更新包
   unPackTargetPath := configPatchPath+"/"+identifier+"_basic/"
   unPackFilePath := configPatchPath+"/"+identifier+ext
   md5DirPath := configPatchPath+"/"+identifier
   defer func() {
      if util.Exists(unPackTargetPath) {
         os.RemoveAll(unPackTargetPath)
      }
      if util.Exists(unPackFilePath) {
         os.RemoveAll(unPackFilePath)
      }
      if util.DirExists(md5DirPath) {
         go os.RemoveAll(md5DirPath)
      }
   }()
@@ -221,7 +232,7 @@
                                 }
                              }
                              if util.DirExists(unPackPath+sdkType+"/models") {
                                 if _,cE := util.CopyDirByCmd(unPackPath+sdkType+"/models", "./zconf"); cE != nil {
                                 if _,cE := util.CopyDirByCmd(unPackPath+sdkType+"/models", "./"); cE != nil {
                                    return false, cE
                                 }
                              }