Friday, March 13, 2015

FMod - Automated OS Build

Since the legality of redistributing Windows PE and the Windows ADK is questionable (despite it being free for anyone to download), I decided to spend a bit of time today and create a PE build script for AbiatharOS. That way, anybody can download Windows PE from Microsoft as they like, then run my script to put the ADK on autopilot, and out pops an ISO file and a WIM file.

This turned out to not be so hard. I just made a batch file alongside folder called "patch" that contains all the files to be replaced or added. The batch script does the following:

  • Sets up a PE build environment (copype)
  • Mounts the resulting WIM image (dism)
  • Adds the WMI and NetFX WinPE packages (dism)
  • Adds ImageX to the image for AbiatharOS installation (copy)
  • Sets the NTFS owner of WinPE's System32 directory to Administrators (takeown)
  • Grants the user the rights to modify the WinPE system files (icacls)
  • Adds/replaces the appropriate files from the patch directory (xcopy)
  • Unmounts the WIM image (dism)
  • Burns the WIM and other resources into an ISO (oscdimg)
  • Moves the WIM file out of the PE build environment (move)
  • Removes the PE build environment (rmdir)
I should test it on other computers before release, but it works perfectly on mine. All I have to do is release a ZIP containing compile.bat and the patch directory; all the real assembly happens on consumer machines.

No comments:

Post a Comment