| | |
| | | "io/ioutil" |
| | | "os" |
| | | "path" |
| | | "path/filepath" |
| | | "webserver/extend/config" |
| | | "webserver/extend/util" |
| | | ) |
| | |
| | | logger.Debug("UnPack err:",err,"unPackFile:",unPackFilePath) |
| | | return false, err |
| | | } |
| | | targetFileName := "" |
| | | err = filepath.Walk(unPackPath, func(path string, f os.FileInfo, err error) error { |
| | | if f == nil { |
| | | return err |
| | | } |
| | | if f.IsDir() { |
| | | targetFileName = f.Name() |
| | | } |
| | | return nil |
| | | }) |
| | | if err != nil { |
| | | return false, err |
| | | } |
| | | unPackPath = unPackPath + targetFileName +"/" |
| | | //解压完成,获取安装包中的文件,开始安装 |
| | | //1.解析安装说明ins.inc |
| | | incPath := unPackPath+"ins.inc" |
| | |
| | | var ins InsInc |
| | | if err = json.Unmarshal(incB, &ins); err == nil { |
| | | //处理授权信息 |
| | | curMc := "" |
| | | if ins.MachineCode != curMc { |
| | | |
| | | } |
| | | //2.解析sdk.def,将so和zconf复制到/opt/vasystem/libs/文件夹下 |
| | | defPath := unPackPath + "sdk.def" |
| | | if util.Exists(defPath) { |