Skip to content

Commit b987023

Browse files
committed
import
0 parents  commit b987023

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2023 Mattie Behrens.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# windows-esd-to-iso
2+
3+
A tool to convert a Windows 11 electronic software distribution (ESD) to a bootable ISO image.
4+
5+
Since Microsoft does not distribute Windows ARM ISO images, [a way to download ESDs](#downloading-esds) plus this tool allows you to obtain a Windows ARM ISO image—e.g. for use in a virtual machine, such as the free VMware Fusion Player.
6+
7+
## Requirements
8+
9+
- The command-line tools from [wimlib](https://wimlib.net) (available in [Homebrew](https://brew.sh))
10+
11+
All remaining requirements are already included in macOS. Patches are welcome for portability.
12+
13+
## Usage
14+
15+
```
16+
windows-esd-to-iso ESD_FILE
17+
```
18+
19+
Converts the ESD in ESD_FILE to ISO format.
20+
21+
## How it works
22+
23+
[windows-esd-to-iso](./windows-esd-to-iso) will use the wimlib tools to inspect, deconstruct, and assemble into an installation tree the images inside an ESD.
24+
25+
Specifically, it assumes:
26+
27+
- Image 1 is the base Windows setup media, which serves as the base of the installation tree
28+
- Image 2 is Windows PE, exported to sources/boot.wim
29+
- Image 3 is Windows Setup, appended to sources/boot.wim, and set bootable
30+
- All remaining images are Windows editions, which will be exported into sources/install.esd
31+
32+
These steps are performed into a temporary directory. When finished, [hdiutil](https://ss64.com/osx/hdiutil.html) is used to create the ISO image from this temporary tree.
33+
34+
IF the script exits for any reason—successful or otherwise—the temporary directory is cleaned.
35+
36+
## Downloading ESDs
37+
38+
There are a few ways you can get an ESD to convert with this tool.
39+
40+
- [My own download-windows-esd tool](https://github.com/mattieb/download-windows-esd) will get the Windows 11 ESD catalog from Microsoft, then download any ESD you wish that is referenced in that catalog and verify its SHA1 checksum.
41+
- Paul Rockwell's [w11arm_esd2iso](https://communities.vmware.com/t5/VMware-Fusion-Documents/w11arm-esd2iso-a-utility-to-create-Windows-11-ARM-ISOs-from/ta-p/2957381) does both downloading and conversion of ARM images in a single shot.
42+
- Bogdan's [ESD to ISO on macOS](https://gist.github.com/b0gdanw/e36ea84828dbd19e03eff6158f1fc77c) explains how to get and search through the catalog and download manually.
43+
44+
## Licensing
45+
46+
While this tool itself is [already licensed to you](./LICENSE.md), Windows itself may require licensing and activation.
47+
48+
You must address this; this tool does not.

windows-esd-to-iso

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
esd="${1}"
6+
tmpdir=$(mktemp -d)
7+
8+
__cleanup() {
9+
set -e
10+
rm -rf "${tmpdir}"
11+
}
12+
trap __cleanup EXIT
13+
14+
image_count=$(wiminfo "${esd}" --header | grep '^Image Count' | cut -d= -f 2 )
15+
16+
wimapply "${esd}" 1 "${tmpdir}"
17+
wimexport "${esd}" 2 "${tmpdir}/sources/boot.wim" --compress=LZX --chunk-size 32K
18+
wimexport "${esd}" 3 "${tmpdir}/sources/boot.wim" --compress=LZX --chunk-size 32K --boot
19+
20+
for index in $(seq 4 ${image_count})
21+
do
22+
wimexport "${esd}" "${index}" "${tmpdir}/sources/install.esd" --compress=LZMS --chunk-size 128K
23+
done
24+
25+
basename="$(basename "${esd}" .esd)"
26+
iso="${basename}.iso"
27+
28+
rm -f "${iso}"
29+
hdiutil makehybrid -o "${iso}" -iso -udf -hard-disk-boot -eltorito-boot "${tmpdir}/efi/microsoft/boot/efisys.bin" -iso-volume-name ESD_ISO -udf-volume-name ESD-ISO "${tmpdir}"
30+

0 commit comments

Comments
 (0)