Page 1 of 1

dism mount WIM, update, wimlib append?

Posted: Fri Nov 10, 2017 6:05 am
by BiatuAutMiahn
Hello, I am working on an update system for WinPE, and I need to be able to mount currently booted wim, perform modifications, then push the changed image to a new image in the wim.\

My Process:
-Download proprietary update payload
-Create IMdisk Ramdisk/filedisk
-Modify/Create/Delete files/registry
-Capture result into new image.

-I tried to dism mount WIM, then capture that into new wim, however the size of the wim is 8MB, however wimlib captures ~2GB.
-I don't see the wimlib functionality to mirror/copy existing image into a new one (same wim)

Any ideas? Thank you

Re: dism mount WIM, update, wimlib append?

Posted: Fri Nov 10, 2017 6:20 am
by synchronicity
> -I tried to dism mount WIM, then capture that into new wim, however the size of the wim is 8MB, however wimlib captures ~2GB.

Not sure what you mean here.

> -I don't see the wimlib functionality to mirror/copy existing image into a new one (same wim)

You could try using 'wimexport' to export an image from the WIM file into itself. I'm not sure if it will work on Windows, though, due to the way Windows handles file locking. But you could always export to a temporary file.

Re: dism mount WIM, update, wimlib append?

Posted: Fri Nov 10, 2017 6:24 am
by synchronicity
It is also possible to perform modifications using 'wimupdate' rather than mounting with DISM. (Or you can mount with 'wimmount', but only on Linux.)

Re: dism mount WIM, update, wimlib append?

Posted: Fri Nov 10, 2017 6:33 am
by BiatuAutMiahn
-> Not sure what you mean here.
I mounted the wim using dism, then i tried to capture the mountdir using wimlib into a new wim. The size of the resulting wim was around 8 MB, however the capture process of wimlib showed over 2 GB of data being archived

Re: dism mount WIM, update, wimlib append?

Posted: Fri Nov 10, 2017 6:45 am
by BiatuAutMiahn
@synchronicity, it does look like I can export it to itself. I can then mount the wim using dism, make changes, then commit.

Should I use optimize to rebuild/recompress the wim afterwards to essentially perform a cleanup?

Re: dism mount WIM, update, wimlib append?

Posted: Sat Nov 11, 2017 7:16 pm
by chungy
dism creates a whole tree on an NTFS volume and sets up reparse points so that the kernel and look back into a mounted WIM for the file data. wimlib will be capturing just these reparse points instead of the expected file data (it works quite different from how mounts work in Linux, for example). I don't think it'll be possible to capture a new image like this unless wimlib learns a new option to ignore reparse points (extending --dereference for Windows, maybe?).

Your best bet would just to let dism unmount/commit a new image, then perhaps using wimoptimize to clean it up.