sysprepの応答ファイルが機能していないような気がする

Win7_32用に作成したunattend.xmlWin7_64に適用させようとして失敗している。失敗はsysprep後に再起動したらマシン名とユーザー名の入力が始まる。うん、だめだ。

Windows AIKを調べる

作り直しが必要だということでWindowsAIKを調べ直す。
Windows® 7 SP1 用の Windows® 自動インストール キット (AIK) 補足プログラムをDLしてISOをマウントしてみると

2010/11/27  09:24    <DIR>          AMD64
2010/11/05  11:18             2,084 COPYPE.CMD
2010/11/27  09:24    <DIR>          IA64
2010/11/05  11:18               806 PESETENV.CMD
2010/11/05  11:18             3,485 SETSANPOLICY.CMD
2010/11/20  21:21           110,080 SSSHIM.DLL
2010/11/27  09:23    <DIR>          X86

やさしくない。

[http://infra20th.wordpress.com/2011/02/27/windows-7-sp1-%E7%94%A8%E3%81%AE-waik-%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6/:title=悩み多き文教市場のインフラ屋さん
Windows 7 SP1 用の WAIK について]を参考にする。

上記ファイルを全て C:\Program Files\Windows AIK\Tools\PETools にコピペ
応答ファイルが作りたいだけなのでWindows PE3.1の導入は見送り。

応答ファイルづくり

Windows 7 デフォルトプロファイルのカスタマイズ その1 (Untitled.xml の作成方法 その1)
Windows 7 デフォルトプロファイルのカスタマイズ その2 (Untitled.xml の作成方法 その2)
4年前の同じ日に書かれている記事に共感

ログオンユーザーのカスタマイズプロファイルを既定のユーザーに適用させる(すばらしい)

ログオンしているユーザーのカスタマイズされたプロファイルを既定のプロファイルに適用させるパラメーターを『Untitled.xml』 に設定します。

使用するパラメーターは『CopyProfile』パラメーターです。

この『CopyProfile』パラメーターを使用することで、ログオンしているユーザーのプロファイルが既定のプロファイルにコピーされます。

この『CopyProfile』パラメーターは『specialize』パスで設定します。

設定の値は『true』 に設定します

左ペインの『Windows イメージ』に表示されている『Windows 7 ENTERPRISE』の『Components』を展開します。

展開した項目から『x86_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral』を選択します。

項目を右クリックしメニューより『パス 4 specialize に設定を追加(4)』を選択します。

中央ペインの『応答ファイル』に表示されている『Untitled』の展開された項目の『4 specialize』に『x86_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral』が追加されます。

右ペインの『プロパティ』に『x86_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral』のプロパティが表示されます。

『設定』を展開して『CopyProfile』を選択します。

プルダウンメニューより『true』を選択します。

デバイスドライバの保持

パラメーター『PersistAllDeviceInstalls』の適用方法。

左ペインの『Windows イメージ』に表示されている『Windows 7 ENTERPRISE』の『Components』を展開します。

展開した項目から『x86_Microsoft-Windows-PnpSysprep_6.1.7600.16385_neutral』を選択します。

項目を右クリックしメニューより『パス 3 generalize に設定を追加(3)』を選択します。

右ペインの『プロパティ』に『x86_Microsoft-Windows-PnpSysprep_6.1.7600.16385_neutral』のプロパティが表示されます。

『設定』を展開して『PersistAllDeviceInstalls』を選択します。

プルダウンメニューより『true』を選択します。

うんうん。
 
[http://sophiakunii.wordpress.com/2010/07/27/%E3%80%90%E5%86%8D%E6%8E%B2%E3%80%91windows-7-%E3%81%AE%E7%84%A1%E4%BA%BA%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/:title=Always on the clock
【再掲】Windows 7無人インストール]

sysprepを実行したときにも出てくる、「Windowsへようこそ」以降の指定を行う部分
(「oobeセットアップ」と仮に名付けます)
・・・
oobeセットアップ部分に関しては、
ComponentsのoobeSystem部分に、x86_Microsoft-Windows-International-Core_neutralイメージと
x86_Microsoft-Windows-Shell-Setup_neutralイメージをマッピングさせると、必要な設定を行う事ができます。

そうだよ、これだ!

そして、間違って押したWindows AIK内のヘルプを見て始めて役に立つヘルプを見た気がする。

Specifies the input language and keyboard layout for a Windows installation.

Input_locale can be one of two values:

To use the default input locale for a language, you can specify the language identifier. For example, to use the default keyboard for English (United States) that corresponds with the QWERTY keyboard, you can specify the value en-US.

Specify the locale ID and keyboard layout hexadecimal values. For example, for en-US, use 0409:00000409. The first value (0409) is the locale ID that represents the input language and the second value (00000409) is the keyboard layout value.

If you want to specify more than one input locale to add support for more than one keyboard type, you can specify multiple values separated by semicolons. For example, you can specify en-US; fr-FR; es-ES to add support for English (US), French (France), and Spanish (Spain) keyboards. The first value listed is used as the default keyboard.

The valid keyboard layouts that can be configured on your system are listed in the following registry key. HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layouts

For a list of the default input locale values, see Supported Language Packs and Default Settings.

http://technet.microsoft.com/en-us/library/hh825682.aspx

Language/Region
Primary Language and Keyboard pair
Secondary Language and Keyboard pairs

Spanish - Spain (International Sort)
es-ES: Spanish (0c0a:0000040a)
en-US: United States - English (0409:00000409)

German - Germany
de-DE: German (0407:00000407)
de-DE: German ()

French - France
fr-FR: French (040c:0000040c)

English - United States
en-US: United States - English (0409:00000409)

Korean(Extended Wansung) - Korea
ko-KR: Microsoft IME (0412:{A028AE76-01B1-46C2-99C4-ACD9858AE02F}{B5FE1F02-D5F2-4445-9C03-C568F23C99A1})

Chinese - Hong Kong
zh-TW: Chinese (Traditional) - Quick (0404:{531FDEBF-9B4C-4A43-A2AA-960E8FCDC732}{6024B45F-5C54-11D4-B921-0080C882687E})

Chinese - Macao
zh-TW: Chinese (Traditional) - Quick (0404:{531FDEBF-9B4C-4A43-A2AA-960E8FCDC732}{6024B45F-5C54-11D4-B921-0080C882687E})

Chinese - PRC
zh-CN: Microsoft Pinyin - Simple Fast (0804:{81D4E9C9-1D3B-41BC-9E6C-4B40BF79E35E}{FA550B04-5AD7-411f-A5AC-CA038EC515D7})

Chinese - Singapore
zh-CN: Microsoft Pinyin - Simple Fast (0804:{81D4E9C9-1D3B-41BC-9E6C-4B40BF79E35E}{FA550B04-5AD7-411f-A5AC-CA038EC515D7})

Chinese - Taiwan
For Windows 8:
zh-TW: Chinese (Traditional) - New Phonetic (0404:{531FDEBF-9B4C-4A43-A2AA-960E8FCDC732}{B2F9C502-1742-11D4-9790-0080C882687E})
for Windows 8.1:
zh-TW: Chinese (Traditional) - New Phonetic (0404:{B115690A-EA02-48D5-A231-E3578D2FDF80}{B2F9C502-1742-11D4-9790-0080C882687E})


そして出来上がった俺のポケモン・・・じゃなくて応答ファイルを見てくれ!

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <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">
            <AutoLogon>
                <Username>kenmituo</Username>
                <Enabled>true</Enabled>
            </AutoLogon>
            <CopyProfile>true</CopyProfile>
            <ComputerName>lenovo</ComputerName>
        </component>
    </settings>
    <settings pass="generalize">
        <component name="Microsoft-Windows-PnpSysprep" 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">
            <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-International-Core" 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">
            <InputLocale>0411:00000411;es-ES;de-DE;fr-FR;en-US;ko-KR;0804:00000804;0804:e00e0804;0804:e0010804;0804:e0030804;0804:e0040804;0409:00000409;0c04:e0080404;0404:00000404;0404:e0080404;0404:E0010404</InputLocale>
            <SystemLocale>ja-JP</SystemLocale>
            <UILanguage>ja-JP</UILanguage>
            <UserLocale>ja-JP</UserLocale>
        </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">
            <AutoLogon>
                <Username>kenmituo</Username>
            </AutoLogon>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <NetworkLocation>Other</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <ShowWindowsLive>false</ShowWindowsLive>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:f:/sources/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

これでも出来ていない。
そうこうしているうちにSysprepがエラーを出すようになった。

Sysprep /generalize" を実行すると、エラー メッセージ "コンピューターの sysprep を実行中に致命的なエラーが発生しました

やりすぎたらしい。この状態になる前の回避策はあるけど、なってしまったらどうしようもないみたいだ。MSのクソ!
参考:Dのプチプチ SE視点

ghostで戻してからまず確認

slmgr /dli
ライセンスの状態:最初の猶予期間

あとunattend.xmlってCR+LFでUTF-8(BOMなし)なのね。

またエラーだ

Windowsnoインストール
パス「oobeSystem」の無人応答ファイル
「c:\:\Windows\Panther\unattend.xml」を解析または処理できませんでした。
応答ファイルで指定されている設定を適用できません。
コンポーネント「Microsoft-Windows-Shell-Setup」の設定を処理中に、エラーが検出されました。

かるくググると瞬快から残念なお知らせがあった。
http://jp.fujitsu.com/group/fwest/services/shunkai/support/faq/0300024.html
 
それでも続けると

エラー:0xC004D307 許可された猶予期間リセット可能最大回数を超えました。猶予期間リセットを再試行するには、OSを再インストールする必要があります。

こうなると何やってもダメみたい、、、さっさと諦めて再インストールします。

応答ファイルの作成の参考
SE の雑記 Windows 7 の再初期化数について

再インストールしてもエラーがでる。

エラー: 0xC004F074 ソフトウェア ライセンス サービスで、コンピューターのライセンス認証の手続きを完了できなかったことが報告されました。キー管理サービス (KMS) を使用できませ

「もしかして?」ピコーン!!
別のKMSサーバを指定したらアッサリと認証された。サーバ側にバグでもあるのかな?おしまい。