Пример #1
0
        //解压AB压缩包
        private bool ZipAB(Dictionary <string, ABVersion> remoteABVersionsDic)
        {
            if (!FrameworkConfig.Instance.useZIP)
            {
                return(true);
            }

            bool zipSuccess = true;

            try
            {
                foreach (var item in remoteABVersionsDic.Keys)
                {
                    //解压完成后,删除原压缩包
                    string   fileName = $"{FrameworkConfig.Instance.ABFolderName}/{item}.zip";
                    FileInfo fileInfo = new FileInfo(AssetPathManager.Instance.GetPersistentDataPath(fileName, false));
                    if (fileInfo.Exists)
                    {
                        ZipManager.ExtractZipContent(AssetPathManager.Instance.GetPersistentDataPath(fileName, false), AssetPathManager.Instance.GetPersistentDataPath(FrameworkConfig.Instance.ABFolderName + "/", false));
                        fileInfo.Delete();
                    }
                }
            }
            catch (Exception e) { zipSuccess = false; }

            return(zipSuccess);
        }
Пример #2
0
        private void extractSelectedFilesButton_Click(object sender, EventArgs e)
        {
            Form1 form = (Form1)Owner;

            ZipManager.ExtractZipContent(form, this, privateFileNameAndPath, isPasswordProtected);
        }