【作業②】 二つのイメージファイルの更新とエクスポート ①install.wimファイルをインストールディスクから作業フォルダにコピー Copy E:¥sources¥install.wim C:¥Images¥install_temp.wim ②install_temp.wimをマウント Dism /Mount-Image /ImageFile:"C:¥Images¥install_temp.wim" /Index:1 /MountDir:C:¥mount¥Windows ③install_temp.wimにWindows 8.1 Updateスタンドアロンインストーラを適用 Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919442-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919355-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2932046-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2959977-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2937592-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2938439-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2934018-x64.msu /Image:C:¥mount¥Windows /LogPath:AddPackage.log ④winre.wimのマウント Dism /Mount-Image /ImageFile:"C:¥mount¥Windows¥Windows¥System32¥Recovery¥winre.wim" /Index:1 /MountDir:C:¥mount¥WinRE ⑤winre.wimにWindows 8.1 Updateスタンドアロンインストーラを適用 Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919442-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919355-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2932046-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2959977-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2937592-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2938439-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2934018-x64.msu /Image:C:¥mount¥WinRE /LogPath:AddPackage.log ⑥winre.wimイメージのクリーンアップ Dism /Cleanup-Image /Image:C:¥mount¥WinRE /StartComponentCleanup /ResetBase ⑦winre.wimのマウントを解除 Dism /Unmount-Image /MountDir:C:¥mount¥WinRE /Commit ⑧winre.wimイメージのエクスポート Dism /Export-Image /SourceImageFile:C:¥mount¥Windows¥Windows¥System32¥Recovery¥winre.wim /SourceIndex:1 /DestinationImageFile:C:¥Images¥winre_updated.wim ⑨install.wimに含まれる標準のwinre.wimイメージ(隠しファイル)を分離 attrib -s -h C:¥mount¥Windows¥Windows¥System32¥Recovery¥winre.wim move C:¥mount¥Windows¥Windows¥System32¥Recovery¥winre.wim C:¥images¥winre_org.wim ⑩install.wimをWIMBoot用に最適化 Dism /Optimize-Image /Image:C:¥mount¥Windows /WIMBoot ⑪install.wimのマウントを解除 Dism /Unmount-Image /MountDir:C:¥mount¥Windows /Commit ⑫WIMイメージに/WIMBootオプション追加してエクスポート Dism /Export-Image /WIMBoot /SourceImageFile:C:¥Images¥install_temp.wim /SourceIndex:1 /DestinationImageFile:C:¥Images¥install_wimboot.wim ⑬NTFSでフォーマットしたUSBメモリに二つのイメージファイルをコピー copy C:¥Images¥install_wimboot.wim F: copy C:¥Images¥winre_updated.wim F: 【作業③】 Update適用済みWindows PEメディアを作成 ①Windows PEイメージを作業フォルダにコピー copype amd64 C:¥WinPE_amd64 ②イメージをマウント Dism /Mount-Image /ImageFile:"C:¥WinPE_amd64¥media¥sources¥boot.wim" /index:1 /MountDir:"C:¥WinPE_amd64¥mount" ③展開したイメージにWindows 8.1 Updateスタンドアロンインストーラを適用 Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919442-x64.msu /Image:C:¥WinPE_amd64¥mount /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2919355-x64.msu /Image:C:¥WinPE_amd64¥mount /LogPath:AddPackage.log Dism /Add-Package /PackagePath:C:¥MSU¥Windows8.1-KB2932046-x64.msu /Image:C:¥WinPE_amd64¥mount /LogPath:AddPackage.log ④イメージを最適化 Dism /image:c:¥WinPE_amd64¥mount /Cleanup-Image /StartComponentCleanup /ResetBase ⑤マウント解除 Dism /Unmount-Image /MountDir:"C:¥WinPE_amd64¥mount" /commit ⑥ブート用メディアを作成 USBメモリの場合 MakeWinPEMedia /UFD C:¥WinPE_amd64 G: ISOの場合 MakeWinPEMedia /ISO C:¥WinPE_amd64 C:¥WinPE_amd64¥WinPE_amd64.iso 【作業④】 Windows PEで起動してインストール ①Diskpartを起動(英語キーボードになるので注意) diskpart ②インストール先SSDを選択 list disk select disk 0 clean convert gpt ③システムパーティション(ESP:100MB)を作成 create partition efi size=100 format quick fs=fat32 label="System" ④予約領域(MSR:128MB)を作成 create partition msr size=128 ⑤Windowsパーティションを設定 create partition primary shrink minimum=5000 format quick fs=ntfs label="Windows" assign letter=c ⑥縮小した5,000MBをイメージパーティションに設定 create partition primary format quick fs=ntfs label="Images" assign letter=m set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 ⑦ドライブレターを確認してDiskpart終了 list volume exit ⑧install.wimファイルをimageパーティションにコピー md "M:¥Windows Images¥" copy D:¥install_wimboot.wim "M:¥Windows Images¥install.wim" ⑨wimファイルを使ってWindowsのシステムを展開 md C:¥Recycler¥Scratch Dism /Apply-Image /ImageFile:"M:¥Windows Images¥install.wim" /ApplyDir:C: /Index:1 /WIMBoot /ScratchDir:C:¥Recycler¥Scratch ⑩ブートファイルを構成 C:¥Windows¥System32¥bcdboot C:¥Windows ⑪リカバリー用のwinre.wimをコピー md M:¥Recovery¥WindowsRE xcopy D:¥winre_updated.wim M:¥Recovery¥WindowsRE¥winre.wim /h ⑫リカバリー用として登録してコマンドプロンプトを終了 C:¥Windows¥System32¥Reagentc /SetREImage /Path M:¥Recovery¥WindowsRE /Target C:¥Windows exit ⑬再起動するとWindowsの初期設定が始まる(USBメモリを抜いておく)