2013年6月23日 星期日

製作Winpe x86與x64二合一的開機選單 (3)

由前面 製作Winpe x86與x64二合一的開機選單 (1)製作Winpe x86與x64二合一的開機選單 (2) 兩篇文章的介紹,最後來介紹如何讓開機選單顯示我們要的中文字。
製作中文開機選單有3點要注意到:
使用指定語系的字型檔,如cht_boot.ttf為繁中、chs_boot.ttf簡中、jpn_boot.ttf日本....等。
WIM所使用的語系,可與開機選單顯示的語系一樣,也可不一樣
使用Batch檔修改BCD檔,其Batch要存成ANSI編碼,不要使用UTF-8的編碼方式

以下介紹製作繁體中文的開機選單
Step 1 : 以下Batch程式碼儲存以ANSI的BAT檔,並執行。
set USBpath=e:\boot\bcd

::Winpe開機選單中,預設的GUID
set dev={7619dcc8-fafe-11d9-b411-000476eba25f}

::加入WinPE 3.0 x86到開機選單中,並取回安裝GUID號碼
for /f "tokens=1-3 delims={}" %%i in ('bcdedit /store %USBpath% /copy {default} /d "啟動 WinPE 3.0 x86"') do set guidx86=%%j

::加入WinPE 3.0 x64到開機選單中,並取回安裝GUID號碼
for /f "tokens=1-3 delims={}" %%i in ('bcdedit /store %USBpath% /copy {default} /d "啟動 WinPE 3.0 x64"') do set guidx64=%%j

::設定winpe 3.0 x86檔案的對應路徑  guidx86 -> pe_x86.wim
bcdedit /store %USBpath% /set {%guidx86%} device ramdisk=[boot]\sources\pe_x86.wim,%dev%
bcdedit /store %USBpath% /set {%guidx86%} osdevice ramdisk=[boot]\sources\pe_x86.wim,%dev%

::設定winpe 3.0 x64檔案的對應路徑  guidx64 -> pe_x64.wim
bcdedit /store %USBpath% /set {%guidx64%} device ramdisk=[boot]\sources\pe_x64.wim,%dev%
bcdedit /store %USBpath% /set {%guidx64%} osdevice ramdisk=[boot]\sources\pe_x64.wim,%dev%

::設定開機逾時時間
bcdedit /store %USBpath% /timeout 20

::設定語言
bcdedit /store %USBpath% /set {globalsettings} locale zh-tw
bcdedit /store %USBpath% /set {bootloadersettings} locale zh-tw                
bcdedit /store %USBpath% /set {bootmgr} locale zh-tw
bcdedit /store %USBpath% /set {default} locale zh-tw
bcdedit /store %USBpath% /set {memdiag} locale zh-tw

::列舉目前BCD的內容
bcdedit /store e:\boot\bcd /enum all

Step 2 : 到自己電腦中的C:\Windows\Boot\PCAT路徑下,將指定使用語系資料夾中的bootmgr.exe.mui和memtest.exe.mui檔案,複製到Winpe 所在的Boot資料夾下,這裡是放在E:\boot\zh-tw之下。

Step 3 : 刪除E:\boot\fonts路徑下不需要使用的字型檔,因為我們要設定為繁中語系,所以只保留下cht_boot.ttf、wgl4_boot.ttf兩個檔案即可。

將上述3個步驟整理一下,在E:\boot路徑下的結構如下:

執行畫面如下:


沒有留言:

張貼留言