2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

カスタマイズしたWindowsインストーラーを作成してみる(Create an installer for customized Windows)

Last updated at Posted at 2020-01-23

Windowsをインストールし、環境を作る

通常通りインストールを行い、オーディットモードでログインしたあとに詳細な設定を行う。
HDDに、可能であればNTFSフォーマットした空き領域を作っておく (C:Windows D:空き(NTFS) 数十GB)
Sysprepからシャットダウンする。

WindowsPEが起動するUSBメモリを作成する

Windows ADKをインストール
https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

以下2つをダウンロードし、インストールする
・Download the Windows ADK for Windows 10, version 1903
(インストールを行う機能の選択時に、Development Toolsを選択する)
・Download the Windows PE add-on for the ADK

image.png

管理者権限でコマンドプロンプトを起動
以下のコマンドを走らせる


copype amd64 C:\WinPE_amd64_PS
Dism /Mount-Image /ImageFile:"C:\WinPE_amd64_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_amd64_PS\mount"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFX.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFX_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-StorageWMI.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-DismCmdlets.cab"
Dism /Add-Package /Image:"C:\WinPE_amd64_PS\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-DismCmdlets_en-us.cab"
Dism /Unmount-Image /MountDir:C:\WinPE_amd64_PS\mount /Commit

MakeWinPEMedia /UFD C:\WinPE_amd64_PS F:
(USBメモリのドライブレターがFの場合)

作成したUSBメモリから起動し、イメージを保存する

キャプチャしたいPCに先程作成したUSBメモリを指して、WindowsPEを起動する
dikspart
list volume
でアサインされてるドライブをチェックする

以下のコマンドを実行する
Dism /Capture-Image /ImageFile:{保存先} /CaptureDir:{取得先} /Name:{イメージ名} /Description:{イメージ説明} /Compress:fast /CheckIntegrity

ex)
 Dism /Capture-Image /ImageFile:D:\capture.wim /CaptureDir:C:\ /Name:"Capture Image" /Description:"Windows Capture Image" /Compress:fast /CheckIntegrity

作成されたwimファイルを、install.esdにリネームし、Windowsインストーラーのinstall.esdファイルと置換する

...That's all. ☆ Knowledge of zealous young🌙🐰

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?