EA and CAB support?

Comments, questions, bug reports, etc.
Post Reply
JFX
Posts: 24
Joined: Tue Aug 18, 2015 3:59 pm

EA and CAB support?

Post by JFX » Mon Nov 13, 2017 7:51 pm

Hi,

it seems Microsoft has finally added support for Extended file attributes, properly in favor of the linux subsystem.

And they also added support for cabinet files (or their extracted folders) as reference file.
These *.cab files have a $filehashes$.dat inside their root that wimgapi seem to use.

There is a downloader called uupdl that can download such *.cab using distributions.

Would be awesome if wimlib would support these new features. :D

synchronicity
Site Admin
Posts: 263
Joined: Sun Aug 02, 2015 10:31 pm

Re: EA and CAB support?

Post by synchronicity » Tue Nov 21, 2017 7:21 am

Indeed, I had considered extended attributes support on Windows before, but no one was asking for it. But now that it's supported by WIMGAPI/DISM (so there is a known on-disk format; they are stored in the "tagged metadata items") and extended attributes are used by the Linux subsystem, I might as well add it; it doesn't seem particularly difficult at this point.

Oddly enough, WIMGAPI/DISM has a bug where it only restores one extended attribute per file even if there are multiple. It's not clear why, given that it stores the full list in the WIM file...

CAB support is significantly harder and I don't know if it will be feasible to add. I'll look into it, though (for readonly support only).

JFX
Posts: 24
Joined: Tue Aug 18, 2015 3:59 pm

Re: EA and CAB support?

Post by JFX » Thu Nov 30, 2017 7:07 pm

Thanks, sounds good.
If cab support it to much work, I think it would be enough if wimlib_reference_resource_files()
could use a already extracted cab content.

synchronicity
Site Admin
Posts: 263
Joined: Sun Aug 02, 2015 10:31 pm

Re: EA and CAB support?

Post by synchronicity » Fri Dec 01, 2017 4:14 am

If cab support it to much work, I think it would be enough if wimlib_reference_resource_files()
could use a already extracted cab content.
If that's the case, what about just doing something like the following:
wimlib_open_wim(wimfile, 0, &wim);
wimlib_add_image(wim, reference_dir, NULL, NULL, 0);
wimlib_extract_image(wim, 1, target_dir, 0);
It adds the reference directory to the WIMStruct as a temporary image, without actually committing it to disk. Then it extracts a different image that references files from that directory.

A less optimized version that would work with current wimlib-imagex would be to capture the reference_dir to an on-disk WIM file first. But the API can work with uncommitted images.

Of course it won't know to do anything special with "$filehashes$.dat", but if I understand correctly that's not strictly required; it would just be another optimization.

JFX
Posts: 24
Joined: Tue Aug 18, 2015 3:59 pm

Re: EA and CAB support?

Post by JFX » Sat Dec 02, 2017 2:44 pm

Thanks,

using wimlib_add_image() is working perfectly here. :D

synchronicity
Site Admin
Posts: 263
Joined: Sun Aug 02, 2015 10:31 pm

Re: EA and CAB support?

Post by synchronicity » Sun Jan 21, 2018 10:19 pm

wimlib-v1.13.0-BETA1 includes extended attributes support on Windows:
On Windows, wimlib now supports capturing and applying extended
attributes (EAs). It is compatible with DISM with the /EA option,
available since Windows 10 version 1607. wimlib's EA support is on by
default; no option has to be provided, and it should work on older
versions of Windows too.
I still haven't been able to solve the mystery of why DISM will store multiple extended attributes per file but will only extract the first one, though. Needless to say, I opted not to include the same bug in wimlib...

Post Reply