@trentfromrid, I have a sub-question. You mentioned that DISM has the ability to save the changes to another image, are you sure about that?
As far as I know it can export already existing edition from the WIM to another location, NTLite can do that as well (right-click Export from the Source page).
But what would be great if one can save mounted directory changes into another WIM, not the one it was mounted from.
That would simplify the upcoming feature of reading the original source image, and not needing to copy it first, so I would like to know that it's possible.
Thanks.
@nuhi;
Before I started using NTLite I was customizing my ISOs from scratch with no external software (Excluding PowerISO for creating a bootable ISO), which included an extensive amount of DISM (It's AIDS, purchasing NTLite was the best software purchase of my life). It's been a year or two since I went the DISM route, but I am pretty sure I always decided to export saved changes to a new WIM instead of saving to the original.
After further testing and research, I'm not confident that DISM has a built in feature for exporting changes while still retaining the original state of the WIM. However, there are some workarounds that accomplish the same end goal, with some consequences.
https://docs.microsoft.com/en-us/wi...agement-command-line-options-s14#export-image
The
DISM /Export-Image command is likely what you're looking for.
"Exports a copy of the specified image to another file. The source and destination files must use the same compression type. You can also optimize an image by exporting to a new image file. When you modify an image, DISM stores additional resource files that increase the overall size of the image. Exporting the image will remove unnecessary resource files."
There's a problem with this though. This command will only export committed changes. This is gets tricky when you want to retain the original WIM and still export the new version. There's a few workarounds that I thought of to accommodate for this.
Keep original in place but save new WIM elsewhere
1. Mount (Ex: D:\install.wim)
2. Make Changes
3. Export to same directory (no compress option) (Ex: D:\install1.wim)
4. Commit changes
5. Export with compress option (Ex: D:\New\install2.wim) (cannot use compress without export) (User selects new location)
6. Unmount
7. Delete original wim (D:\install.wim)
8. Rename backup to original filename (D:\install1.wim to D:\install.wim)
Replace original with new but save original elsewhere
1. Mount (Ex: D:\install.wim)
2. Make Changes
3. Export to user selected directory and filename (no compress option) (Ex: D:\Backup\install.wim)
4. Commit changes (If no desire for compression option, then you can unmount here)
If compression option is desired:
5. Export with compress option (Ex: D:\install1.wim) (cannot use compress without export)
6. Unmount
7. Delete original wim (D:\install.wim)
8. Rename new to original filename (D:\install1.wim to D:\install.wim)
There's a few hoops that are necessary and this has the potential to add time to the process, but it's the only way that I'm aware of that could be made to be automated by NTLite.
/Extract-Image includes additional switches for SWM file references, marking the bootable image for WinPE images, appending WIMBoot boot configuration (Windows 8.1 only), file integrity checks, and compression.
"/Compress specifies the type of compression used for the initial capture operation.
The /Compress argument does not apply when you export an image to an existing .wim file, you can only use this argument when you export an image to a new .wim file. The
maximum option provides the best compression, but takes more time to capture the image. The
fast option provides faster image compression, but the resulting files are larger than those compressed by using the
maximum option. This is also the default compression type that is used if you do not specify the argument. Use the
recovery option to export push-button reset images. The resulting files are much smaller in size, which in turn, greatly reduce the amount of disk space needed for saving the push-button reset image on a recovery drive. The destination file must be specified with an .esd extension. The
none option does not compress the captured image at all."
With an image I made using NTLite (W7 Professional, no changes except for additional windows update) I tested the process. The original WIM was 2.60GB. Commiting changes and unmounting without exporting increased file size by 11KB. After exporting using the /Compress:max switch, the new WIM is 2.59GB. So, in this test, without any prior removals, the file size difference is very small with the compress option, so whether or not it's worth the extra time added is up to you.
One thing I have noticed though, is that if I need to replace a file that already exists, I have to delete the file and then re-add it, or else the new version doesn't save over. I experience the same problem with using NTLite as well.