在開發Embedded Device的時候,最後的目的通常都是要達到Custom Shell的功能,但是在這之前如果我們的OS還需要做調整的話,使用Custom Shell讓我們變得伴手絆腳的,感覺缺少了靈活性,所以這邊有個做法分享給大家~
如果我們在Build WES7 image的時候也將Explorer Shell的相關Package都加入, 就能在使用Custom Shell的當下透過修改Registry的方式改變 Shell的對應程式,來達成切換Explorer Shell & Custom Shell的目的~
下面我們來看如何達成:
1. 使用ICE建立WES7 Image且於Answer File加入Explorer Shell相關Resource.
可同時加入Command Shell & Explorer Shell , 但是要先Disable其中一個Shell , 這邊我們先將Command Shell Disable (如下圖反灰) , 然後針對Explorer Shell做Validate.
2.選擇Add Required Packages , 這樣確保Explorer Shell的相關組件都有被加入Answer File.
3.然後在手動將Command Shell ->Enable , Explorer Shell ->Disable. (最快的做法是直接將Explorer Shell 刪除 , 然後收動加入Command Shell)
如上圖相關Shell組件都有被加入~
再來將做好的WES7 OS image完成布署安裝之後,第一次開機應該會進入Command Shell.
這時我們使用下面指令:
(P.S:須注意Custome Shell是透過Shell Launcher來執行,程式被關閉後會自動再啟動)
切換為Explorer Shell (刪除Shell Launcher的值)
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows Embedded\EEF\Shell Launcher" /v Shell /f
切換為 Command Shell (將Shell Launcher的值重新註冊)
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "eshell.exe" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows Embedded\EEF\Shell Launcher" /v Shell /t REG_SZ /d "CMD.exe" /f
為方便起見,大家可以將上面指令另存為.Bat檔來使用,這樣就能很方便地在兩個Shell之間做切換,也方便大家在Fine-tune OS上面增加了便利性~
留言列表