auto

0
#!/usr/bin/env bash
set -euo pipefail

# Ventoy用ディレクトリを作成
mkdir -p ventoy

# --- ventoy/ventoy.json ---
cat > ventoy/ventoy.json << 'EOF'
{
    "control": [
        { "VTOY_WIN11_BYPASS_CHECK": "1" }
    ],
    "auto_install": [
        {
            "image": "/Win11_25H2_Japanese_x64_v2.iso",
            "template": "/ventoy/autounattend.xml"
        }
    ]
}
EOF

# --- ventoy/autounattend.xml ---
cat > ventoy/autounattend.xml << 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>ja-JP</UILanguage>
</SetupUILanguage>
<InputLocale>0411:00000411</InputLocale>
<SystemLocale>ja-JP</SystemLocale>
<UILanguage>ja-JP</UILanguage>
<UserLocale>ja-JP</UserLocale>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- BitLocker(デバイス暗号化)の自動有効化を禁止 -->
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>reg add HKLM\SYSTEM\CurrentControlSet\Control\BitLocker /v PreventDeviceEncryption /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- ローカルアカウント「user」(パスワードなし)を作成 -->
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<Description>Local Administrator</Description>
<DisplayName>user</DisplayName>
<Group>Administrators</Group>
<Name>user</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<!-- 作成したuserアカウントで自動ログイン -->
<AutoLogon>
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>user</Username>
</AutoLogon>
<!-- 初期設定画面(OOBE)のプライバシー質問等をすべてスキップ -->
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
</OOBE>
<!-- 高速スタートアップを無効化するコマンドを実行 -->
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable Fast Startup</Description>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
</unattend>
EOF

echo "作成完了: ./ventoy/ventoy.json"
echo "作成完了: ./ventoy/autounattend.xml"
echo ""
echo "※ Ventoyドライブのルートに ventoy フォルダごとコピーし、"
echo "   Win11_25H2_Japanese_x64_v2.iso もドライブのルートに置いてください。"
タイトルとURLをコピーしました