|
| 1 | +# Build Instructions |
| 2 | + |
| 3 | +## Content Overview |
| 4 | + |
| 5 | +- [Requirements](#requirements) |
| 6 | +- [Downloading an Image](#downloading-an-image) |
| 7 | +- [Preparing the Build Environment](#preparing-the-build-environment) |
| 8 | +- [Stripping Non-Essential Editions](#stripping-non-essential-editions) |
| 9 | +- [Mounting the Image](#mounting-the-image) |
| 10 | +- [Integrating Updates](#integrating-updates) |
| 11 | +- [Enable .NET 3.5](#enable-net-35) |
| 12 | +- [Enable Legacy Components for older games](#enable-legacy-components-for-older-games) |
| 13 | +- [Integrating & Obtaining Drivers](#integrating--obtaining-drivers) |
| 14 | +- [Integrating Required Files](#integrating-required-files) |
| 15 | +- [Remove Provisioned Appx Bloatware](#remove-provisioned-appx-bloatware) |
| 16 | +- [Replacing Wallpapers](#replacing-wallpapers) |
| 17 | +- [Unmount & Commit](#unmount--commit) |
| 18 | +- [Insert DISM Apply-Image Script](#insert-dism-apply-image-script) |
| 19 | +- [Convert to ISO](#convert-to-iso) |
| 20 | + |
| 21 | +## Requirements |
| 22 | + |
| 23 | +- [7-Zip](https://www.7-zip.org) |
| 24 | +- [win-wallpaper](https://github.com/amitxv/win-wallpaper/releases) |
| 25 | + - Place the ``win-wallpaper.exe`` in ``C:\Windows`` |
| 26 | +- Deployment Tools from the [Windows ADK](https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install) |
| 27 | + |
| 28 | +## Downloading an Image |
| 29 | + |
| 30 | +- Use the [download links spreadsheet](https://docs.google.com/spreadsheets/d/1zTF5uRJKfZ3ziLxAZHh47kF85ja34_OFB5C5bVSPumk/edit#gid=0) to download stock Windows images. |
| 31 | + |
| 32 | + - For Windows 7 i recommend ``en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso`` |
| 33 | + |
| 34 | + - Ensure to cross-check the hashes for the image with other online sources such as the [adguard hash database](https://files.rg-adguard.net/version/f0bd8307-d897-ef77-dbd6-216fefbe94c5?lang=en-us) to verify that the image is genuine & not corrupted |
| 35 | + |
| 36 | +## Preparing the Build Environment |
| 37 | + |
| 38 | +- Extract the image to a directory of your choice with 7-Zip. In the examples below, i have chosen ``C:\ISO`` |
| 39 | + |
| 40 | +- Open CMD as Administrator & configure these variables below. These variables are temporary for this session & will be discarded if you close the terminal window so ensure to keep it open throughout the build process. |
| 41 | + |
| 42 | + ```bat |
| 43 | + set "EXTRACTED_IMAGE=C:\ISO" |
| 44 | +
|
| 45 | + set "MOUNT_DIR=C:\temp" |
| 46 | +
|
| 47 | + if exist "%MOUNT_DIR%" (rd /s /q "%MOUNT_DIR%") |
| 48 | +
|
| 49 | + mkdir "%MOUNT_DIR%" |
| 50 | + ``` |
| 51 | +
|
| 52 | +- If the environment was configured correctly, these two commands below should return ``true``. |
| 53 | +
|
| 54 | + ```bat |
| 55 | + if exist "%EXTRACTED_IMAGE%" (echo true) else (echo false) |
| 56 | +
|
| 57 | + if exist "%MOUNT_DIR%" (echo true) else (echo false) |
| 58 | + ``` |
| 59 | +
|
| 60 | +## Stripping Non-Essential Editions |
| 61 | +
|
| 62 | +- Remove every edition except the pro edition, by retrieving the indexes of every other edition & removing it with the commands below. |
| 63 | +
|
| 64 | + ```bat |
| 65 | + DISM /Get-WimInfo /WimFile:"%EXTRACTED_IMAGE%\sources\install.wim" |
| 66 | + DISM /Delete-Image /ImageFile:"%EXTRACTED_IMAGE%\sources\install.wim" /Index:[INDEX] |
| 67 | + ``` |
| 68 | +
|
| 69 | +- Once completed, the only edition available should be the pro edition at index 1. |
| 70 | +
|
| 71 | +## Mounting the Image |
| 72 | +
|
| 73 | +- Mounting the image with the command below will allow us to carry out a few tasks. |
| 74 | +
|
| 75 | + ```bat |
| 76 | + DISM /Mount-Wim /WimFile:"%EXTRACTED_IMAGE%\sources\install.wim" /Index:1 /MountDir:"%MOUNT_DIR%" |
| 77 | + ``` |
| 78 | +
|
| 79 | +## Integrating Updates |
| 80 | +
|
| 81 | +- Windows 7 Recommended Updates: |
| 82 | +
|
| 83 | + ``` |
| 84 | + KB2670838 - platform update + directX 11.1 |
| 85 | + KB2864202 - required for the generic USB driver (if you use it) |
| 86 | + KB4474419 - SHA signing update |
| 87 | + KB4490628 - SHA signing update |
| 88 | + KB2990941 - NVME/M.2 |
| 89 | + KB3087873 - NVME/M.2 |
| 90 | + ``` |
| 91 | +
|
| 92 | +- Windows 10 Recommended Updates: |
| 93 | +
|
| 94 | + - Download the latest non-security update along with the servicing stack for that specific update. Use the official [Windows Update history page](https://support.microsoft.com/en-us/topic/windows-10-update-history-93345c32-4ae1-6d1c-f885-6c0b718adf3b) to get the relevant updates |
| 95 | +
|
| 96 | +- Download the updates from the [Microsoft Update Catalog](https://www.catalog.update.microsoft.com/Home.aspx) by searching for the KB identifier. Place the updates somewhere easily accessible such as ``C:\updates``. |
| 97 | +
|
| 98 | +- Integrate the updates into the install wim with the command below. |
| 99 | +
|
| 100 | + - Note: The Servicing Stack must be installed before installing the Cumulative Update, this generally only applies to Windows 10 |
| 101 | +
|
| 102 | + ```bat |
| 103 | + DISM /Image:"%MOUNT_DIR%" /Add-Package /PackagePath="C:\updates\KB2670838.msu" |
| 104 | + ``` |
| 105 | +
|
| 106 | +## Enable .NET 3.5 |
| 107 | +
|
| 108 | +- Windows 10+ Only: |
| 109 | +
|
| 110 | +```bat |
| 111 | +DISM /Image:"%MOUNT_DIR%" /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"%EXTRACTED_IMAGE%\sources\sxs" |
| 112 | +``` |
| 113 | + |
| 114 | +## Enable Legacy Components for older games |
| 115 | + |
| 116 | +- Windows 10+ Only: |
| 117 | + |
| 118 | +```bat |
| 119 | +DISM /Image:"%MOUNT_DIR%" /Enable-Feature /FeatureName:DirectPlay /All |
| 120 | + ``` |
| 121 | + |
| 122 | + ## Integrating & Obtaining Drivers |
| 123 | + |
| 124 | + - This is generally required for users installing Windows 7 to integrate USB/ NVME drivers so that setup can proceed. |
| 125 | + |
| 126 | + - Place all of the drivers to be integrated somewhere easily accessible such as ``C:\drivers`` & use the command below to integrate them into the install wim. |
| 127 | + |
| 128 | +```bat |
| 129 | +DISM /Image:"%MOUNT_DIR%" /Add-Driver /Driver:"C:\drivers" /Recurse |
| 130 | +``` |
| 131 | + |
| 132 | +## Integrating Required Files |
| 133 | + |
| 134 | +- Open the mounted directory with the command below. |
| 135 | + |
| 136 | + ```bat |
| 137 | + explorer "%MOUNT_DIR%" |
| 138 | + ``` |
| 139 | +
|
| 140 | +- Clone the repository & place the ``prerequisites`` folder & ``debloat.sh`` in the mounted directory. |
| 141 | +
|
| 142 | +## Remove Provisioned Appx Bloatware |
| 143 | +
|
| 144 | +- Windows 10+ Only. |
| 145 | +
|
| 146 | +- This command removes the majority of Windows Apps such as Microsoft Store, Maps, Camera etc that nobody uses & potentially jeopardizes privacy. |
| 147 | +
|
| 148 | + ```bat |
| 149 | + for /f "tokens=3" %i in ('DISM /Image:"%MOUNT_DIR%" /Get-ProvisionedAppxPackages ^| findstr "PackageName"') do (DISM /Image:"%MOUNT_DIR%" /Remove-ProvisionedAppxPackage /PackageName:%i) |
| 150 | + ``` |
| 151 | +
|
| 152 | +## Replacing Wallpapers |
| 153 | +
|
| 154 | +- Run the command below to replace all backgrounds & user profile images with solid black images. |
| 155 | +
|
| 156 | + - Note: Also use the ``--win7`` argument if building Windows 7 |
| 157 | +
|
| 158 | + ```bat |
| 159 | + win-wallpaper.exe --dir "%MOUNT_DIR%" --rgb #000000 |
| 160 | + ``` |
| 161 | +
|
| 162 | +## Unmount & Commit |
| 163 | +
|
| 164 | +- Run the command below to save the changes to the image. |
| 165 | +
|
| 166 | + ```bat |
| 167 | + DISM /Unmount-wim /MountDir:"%MOUNT_DIR%" /Commit |
| 168 | + ``` |
| 169 | +
|
| 170 | +## Replace Windows 7 Boot Wim |
| 171 | +
|
| 172 | +- Windows 7 Only: |
| 173 | +
|
| 174 | + - As you are aware, Windows 7 lacks driver support for modern hardware & you should have already integrated drivers into the install.wim however we have not yet touched the boot.wim (installer). We *could* integrate the same drivers into the boot.wim as we did before but in my experience this still leads to a problematic installation. Instead, we can use the Windows 10 boot.wim which already has modern hardware support to install our Windows 7 install.wim. |
| 175 | +
|
| 176 | + - The process is quite simple: |
| 177 | +
|
| 178 | + - Download the [latest Windows 10 image](https://www.microsoft.com/en-gb/software-download/windows10) & extract it, i would recommend renaming the extracted folder to avoid confusion |
| 179 | +
|
| 180 | + - Replace ``sources\install.wim`` in the extracted Windows 10 image with the Windows 7 ``install.wim`` |
| 181 | +
|
| 182 | +## Insert DISM Apply-Image Script |
| 183 | +
|
| 184 | +- Open the extracted directory with the command below. |
| 185 | +
|
| 186 | + ```bat |
| 187 | + explorer "%EXTRACTED_IMAGE%" |
| 188 | + ``` |
| 189 | +
|
| 190 | +- Place the ``install.bat`` script in the directory. |
| 191 | +
|
| 192 | +## Convert to ISO |
| 193 | +
|
| 194 | +- Use the following commands to convert the extracted image to a ISO which will be created on the desktop: |
| 195 | +
|
| 196 | +```bat |
| 197 | +set "OSCDIMG=C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" |
| 198 | +
|
| 199 | +"%OSCDIMG%" -lfinal_iso -m -u2 -b"%EXTRACTED_IMAGE%\boot\etfsboot.com" "%EXTRACTED_IMAGE%" "%userprofile%\desktop\final_iso.iso" |
| 200 | +
|
| 201 | +"%OSCDIMG%" -n -d -m "%EXTRACTED_IMAGE%" "%userprofile%\final_iso.iso" |
| 202 | +``` |
0 commit comments