I felt a need to make a custom installer image of Windows 7 for my desktop. This means including the Intel USB 3 and Pro 1000 ethernet controllers. I had a lot of uh… fun… doing so.
Seems simple enough, right? Mount the iso image, add some files, burn to a DVD? Wrong. While you do need to mount or extract the ISO, you also need to:
That isn’t really that much, when you think about it… Provided all the tools work correctly. So I looked up a guide on how to do it, because I’m a linux guy normally, and I found this guide on superuser. It looked sane enough, so I installed the Windows Automated Installation Kit and went to go through the tools:
C:\Windows\System32> cd C:\Users\izaya\Documents\Windows-7-Universal-x64\sources
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> imagex /mountrw install.wim 3 c:\wim
'imagex' is not recognized as an internal or external command, operable program or batch file.
Yeah. The tool wasn’t installed with the WAIK. So, as a guess, I tried to run it from system32 (because every Windows utility is installed in system32 because what’s $PATH?)
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> C:\Windows\system32\imagex.exe
'C:\Windows\System32\imagex.exe' is not recognized as an internal or external command, operable program or batch file.
Yup. Not installed.
So I looked it up to find that ImageX had been discontinued in favor of dism.exe.
So I look up the docs for dism and found the syntax:
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> dism /mount-wim /wimfile:install.wim /index:3 /mountdir:C:\wim
Deployment Image Servicing and Management tool
Version 6.1.7600.16385
Error: 87
The mount-wim option is unknown.
For more information, refer to the help.
… Okay, maybe the dism documentation only applies for Windows 10? I’ll check the docs in the WAIK installer…
Dism /Mount-Wim /WimFile:C:\test\images\MyImage.wim /index:1 /MountDir:C:\test\offline
That’s fine. The dism tool is just wrong. I’ll reinstall the WAIK.
Nope. So I rebooted. dism /mount-wim
worked. Great. Just needed a reboot. Return to the right dir rather than system32…
C:\Users\izaya\Documents\Windows-7-Universal-x64\sources> dism /mount-wim /wimfile:install.wim /index:3 /mountdir:C:\wim
Deployment Image Servicing and Management tool
Version 6.1.7600.16385
Error: 87
The mount-wim option is unknown.
For more information, refer to the help.
Suffice to say that I screwed around for a while until I realised the difference is that one was run from . in system32, so specifying C:\Windows\System32\dism.exe
made it work normally.
Now I understand why people complain about the Windows PATH variable being stupid.