# IncrementUpdate **Repository Path**: jasoncai-xm/increment-update ## Basic Information - **Project Name**: IncrementUpdate - **Description**: 增量更新框架,目前只做了Unity示例,适用于各种增量文件更新! - **Primary Language**: C - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 10 - **Forks**: 0 - **Created**: 2023-09-19 - **Last Updated**: 2025-04-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # IncrementUpdate #### 介绍 增量更新框架 使用了bsdiff,将其编译成Windows,Android,IOS对应的库文件。 需要其他平台的库文件请自行编译 https://github.com/mendsley/bsdiff #### 使用说明 1. bsdiff-win/bsdiff.exe 使用命令行调用: bsdiff.exe oldfile newfile patchfile 2. bspath 以UnityC#为例 定义方法: ``` #if UNITY_EDITOR [DllImport("BSPath", EntryPoint = "bspath", CharSet = CharSet.Ansi)] #elif UNITY_IPHONE || UNITY_IOS [DllImport("__Internal", EntryPoint = "bspath", CharSet = CharSet.Ansi)] #elif UNITY_ANDROID [DllImport("libpatch_tools", EntryPoint = "bspath", CharSet = CharSet.Ansi)] #endif public static extern IntPtr bspath([MarshalAs(UnmanagedType.LPStr)]string oldfile, [MarshalAs(UnmanagedType.LPStr)]string newfile, [MarshalAs(UnmanagedType.LPStr)]string patchfile); ``` 调用: ``` IntPtr ip = bspath(oldFile, newFile, filePath); result = Marshal.PtrToStringAnsi(ip); if (result != string.Empty){//Error }else{//UpdateOK } ``` 3. trial/Unity Unity示例项目 4. bsdiff-tool 用nodejs+typeScript写的构建增量版本文件的工具,可以批量处理多个版本,并生成MD5校验文件