Skip to content

Commit

Permalink
Prepare v2.2.0 release, Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed May 15, 2021
2 parents 3dc1967 + b691019 commit de68925
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 22 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## v2.x

### v2.2.0

Released on 2021-05-15

- Update included wimlib to 1.13.4.
- Fix `UpdateProgress` and `VerifyStreamsProgress` marshalling issue (#2).

### v2.1.0

Released on 2021-04-10
Expand Down
1 change: 1 addition & 0 deletions ManagedWimLib.Tests/UpdateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static CallbackStatus UpdateProgressCallback(ProgressMsg msg, object info
tested.Set();

UpdateCommand cmd = m.Command;
Console.WriteLine($"Commands = {m.CompletedCommands}/{m.TotalCommands}");
switch (cmd.Op)
{
case UpdateOp.Add:
Expand Down
9 changes: 6 additions & 3 deletions ManagedWimLib.Tests/VerifyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You should have received a copy of the GNU Lesser General Public License
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;
using System.Linq;

Expand Down Expand Up @@ -49,28 +50,30 @@ public void VerifyTemplate(string wimFileName, bool result)
_checked[i] = false;
CallbackStatus ProgressCallback(ProgressMsg msg, object info, object progctx)
{
Console.WriteLine($"Callback msg={msg}");
switch (msg)
{
case ProgressMsg.BeginVerifyImage:
{
VerifyImageProgress m = (VerifyImageProgress)info;
Assert.IsNotNull(info);
Assert.IsNotNull(m);

_checked[0] = true;
}
break;
case ProgressMsg.EndVerifyImage:
{
VerifyImageProgress m = (VerifyImageProgress)info;
Assert.IsNotNull(info);
Assert.IsNotNull(m);

_checked[1] = true;
}
break;
case ProgressMsg.VerifyStreams:
{
VerifyStreamsProgress m = (VerifyStreamsProgress)info;
Assert.IsNotNull(info);
Assert.IsNotNull(m);
Console.WriteLine($"Bytes={m.CurrentBytes}/{m.TotalBytes}, {m.CurrentStreams}/{m.TotalStreams}");

_checked[2] = true;
}
Expand Down
6 changes: 3 additions & 3 deletions ManagedWimLib/ManagedWimLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Title>ManagedWimLib</Title>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.1.0</Version>
<Version>2.2.0</Version>
<Authors>Eric Biggers, Hajin Jang</Authors>
<Company>Joveler</Company>
<Description>Native wimlib wrapper library for .NET.
Expand All @@ -17,8 +17,8 @@ Supports Windows, Linux and macOS.</Description>
<PackageProjectUrl>https://github.com/ied206/ManagedWimLib</PackageProjectUrl>
<PackageIcon>images\Logo.png</PackageIcon>
<RepositoryUrl>https://github.com/ied206/ManagedWimLib</RepositoryUrl>
<PackageReleaseNotes>- Update inlcuded wimlib to 1.13.3.
- Official support for Windows ARM64.</PackageReleaseNotes>
<PackageReleaseNotes>- Update included wimlib to 1.13.4.
- Fix UpdateProgress and VerifyStreamsProgress marshalling issue.</PackageReleaseNotes>
<PackageTags>wim wimlib dism imagex archive native pinvoke interop</PackageTags>
</PropertyGroup>
<!-- PackageReference -->
Expand Down
8 changes: 8 additions & 0 deletions ManagedWimLib/NativeStructs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public enum ProgressMsg
/// info param will point to <see cref="WriteStreamsProgress"/>.
/// This message may be received many times while the WIM file is being written or appended
/// to with <see cref="Wim.Write()"/>, <see cref="Wim.Overwrite()"/>.
/// Since wimlib v1.13.4 it will also be received when a split WIM part is being written by <see cref="Wim.Split(string, ulong, WriteFlags)"/>.
/// </summary>
WriteStreams = 12,
/// <summary>
Expand Down Expand Up @@ -783,6 +784,11 @@ public enum ExtractFlags : uint
/// </summary>
Ntfs = 0x00000001,
/// <summary>
/// Since wimlib v1.13.4: Don't consider corrupted files to be an error.
/// Just extract them in whatever form we can.
/// </summary>
RecoverData = 0x00000002,
/// <summary>
/// UNIX-like systems only:
/// Extract UNIX-specific metadata captured with <see cref="AddFlags.UnixData"/>.
/// </summary>
Expand Down Expand Up @@ -1765,6 +1771,7 @@ public RenameCommand(string wimSourcePath, string wimTargetPath)
#region struct UpdateCommand32
/// <summary>
/// 32bit version of real UpdateCommand struct which is passed to the native wimlib.
/// Must be struct (using class crashes the process)
/// </summary>
/// <remarks>
/// Original C struct (wimlib_update_command) contains a union with three structs: Add, Delete and Rename.
Expand Down Expand Up @@ -1913,6 +1920,7 @@ public UpdateCommand ToManagedClass()
#region struct UpdateCommand64
/// <summary>
/// 64bit version of real UpdateCommand struct which is passed to the native wimlib.
/// Must be struct (using class crashes the process)
/// </summary>
/// <remarks>
/// Original C struct (wimlib_update_command) contains a union with three structs: Add, Delete and Rename.
Expand Down
28 changes: 17 additions & 11 deletions ManagedWimLib/ProgressCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public class WriteStreamsProgress
/// The number of bytes of file data that have been written so far.
/// This starts at 0 and ends at TotalBytes.
/// This number is the uncompressed size; the actual size may be lower due to compression.
/// See <see cref="CompletedCompressedBytes"/> for the compressed size.
/// </summary>
public ulong CompletedBytes;
/// <summary>
Expand All @@ -181,6 +182,10 @@ public class WriteStreamsProgress
/// This is currently broken and will always be 0.
/// </summary>
public uint CompletedParts;
/// <summary>
/// Since wimlib v1.13.4: Like <see cref="CompletedBytes"/>, but counts the compressed size.
/// </summary>
public ulong CompletedCompressedBytes;
}
#endregion

Expand Down Expand Up @@ -406,11 +411,13 @@ public class UpdateProgress
/// <summary>
/// Number of update commands that have been completed so far.
/// </summary>
public uint CompletedCommands;
public ulong CompletedCommands => CompletedCommandsVal.ToUInt64();
internal UIntPtr CompletedCommandsVal;
/// <summary>
/// Number of update commands that are being executed as part of this call to Wim.UpdateImage().
/// </summary>
public uint TotalCommands;
public ulong TotalCommands => TotalCommandsVal.ToUInt64();
internal UIntPtr TotalCommandsVal;
}

/// <summary>
Expand Down Expand Up @@ -441,20 +448,19 @@ public UpdateCommand Command
/// <summary>
/// Number of update commands that have been completed so far.
/// </summary>
public uint CompletedCommands;
public UIntPtr CompletedCommandsVal;
/// <summary>
/// Number of update commands that are being executed as part of this call to Wim.UpdateImage().
/// </summary>
public uint TotalCommands;
public UIntPtr TotalCommandsVal;

[SuppressMessage("ReSharper", "ArrangeThisQualifier")]
public UpdateProgress ToManaged()
{
return new UpdateProgress
{
Command = this.Command,
CompletedCommands = this.CompletedCommands,
TotalCommands = this.TotalCommands,
CompletedCommandsVal = this.CompletedCommandsVal,
TotalCommandsVal = this.TotalCommandsVal,
};
}
}
Expand Down Expand Up @@ -647,10 +653,10 @@ public class VerifyStreamsProgress
{
public string WimFile => Wim.Lib.PtrToStringAuto(_wimFilePtr);
private IntPtr _wimFilePtr;
public uint TotalStreams;
public uint TotalBytes;
public uint CurrentStreams;
public uint CurrentBytes;
public ulong TotalStreams;
public ulong TotalBytes;
public ulong CurrentStreams;
public ulong CurrentBytes;
}
#endregion

Expand Down
Binary file modified ManagedWimLib/runtimes/linux-arm/native/libwim.so
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/linux-arm64/native/libwim.so
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/osx-x64/libwim.dylib
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll
Binary file not shown.
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-arm64/native/libxml2-2.dll
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-x64/native/libwim-15.dll
Binary file not shown.
Binary file modified ManagedWimLib/runtimes/win-x86/native/libwim-15.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ macOS arm64 should be supported on theory, but I do not have access to an Apple

### Supported wimlib version

- 1.13.3 (Included)
- 1.13.4 (Included)

## Usage

Expand Down
10 changes: 6 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void InitNativeLibrary()
if (!File.Exists(libPath))
throw new PlatformNotSupportedException($"Unable to find native library [{libPath}].");

Magic.GlobalInit(libPath);
Wim.GlobalInit(libPath, InitFlags.None);
}
```

Expand Down Expand Up @@ -79,15 +79,17 @@ public static void InitNativeLibrary()
if (!File.Exists(libPath))
throw new PlatformNotSupportedException($"Unable to find native library [{libPath}].");

Magic.GlobalInit(libPath);
Wim.GlobalInit(libPath, InitFlags.None);
}
```

To configure behaviors of wimlib, pass `InitFlags` to `Wim.GlobalInit()`.

**WARNING**: Caller process and callee library must have the same architecture!

### Embedded binary

ManagedWimLib comes with sets of binaries of `wimlib 1.13.3`. They will be copied into the build directory at build time.
ManagedWimLib comes with sets of binaries of `wimlib 1.13.4`. They will be copied into the build directory at build time.

#### For .NET Framework 4.5.1+

Expand All @@ -112,7 +114,7 @@ ManagedWimLib comes with sets of binaries of `wimlib 1.13.3`. They will be copie

- Linux binaries are not portable. Included binaires may not work on your distribution.
- On Linux, wimlib depends on system-installed `libfuse`.
- If you call `Wim.GlobalInit()` without `libPath` parameter on Linux or macOS, `ManagedWimLib` will search for system-installed wimlib.
- If you call `Wim.GlobalInit()` without `libPath` parameter on Linux or macOS, `ManagedWimLib` will search for system-installed wimlib.
- POSIX binaries were compiled without NTFS-3G support to make them as LGPLv3-licensed.
- If you want NTFS-3G functionality, load the system-installed library and make sure your program is compatible with **GPLv3**.

Expand Down

0 comments on commit de68925

Please sign in to comment.