移除可选功能

This commit is contained in:
dragonflylee 2018-04-27 09:57:32 +08:00
parent 6ca79626e5
commit bd69a71b2f
3 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,8 @@
;混合现实
Analog.Holographic.Desktop
;快速助手
App.Support.QuickAssist
;Windows Media Player 播放器
Media.WindowsMediaPlayer
;SSH服务
OpenSSH

View File

@ -67,6 +67,7 @@ call :RemoveFolder "%~2"
rem 导出安装镜像
for %%i in (china consumer) do (
for %%j in ("%~1\*.rs4_release_*%%i*_%~3fre_*.esd") do (
if not exist "%~2" call :ExportDVD "%%j", "%~2"
call :ExportImage "%%j", "%WimPath%"
)
)

View File

@ -71,6 +71,7 @@ goto :eof
rem 处理原版镜像 [ %~1 : 镜像挂载路径 ]
:MakeWimClean
call :RemoveAppx "%~1"
for /f %%f in ('type "%~dp0Pack\CapabilityList.%ImageShortVersion%.txt" 2^>nul') do call :RemoveCapability "%~1", "%%f"
for /f %%f in ('type "%~dp0Pack\RemoveList.%ImageVersion%.txt" 2^>nul') do call :RemoveComponent "%~1", "%%f"
call :IntRollupFix "%~1"
call :AddAppx "%~1", "DesktopAppInstaller", "VCLibs.14"
@ -303,6 +304,14 @@ for /f "tokens=3" %%f in ('%Dism% /English /Image:"%~1" /Get-ProvisionedAppxPack
)
goto :eof
rem 移除系统功能 [ %~1 : 镜像挂载路径, %~2 : 功能名称 ]
:RemoveCapability
for /f "tokens=4" %%f in ('%Dism% /English /Image:"%~1" /Get-Capabilities ^| findstr Capability ^| findstr /i "%~2"') do (
echo.移除功能 [%%f]
%Dism% /Image:"%~1" /Remove-Capability /CapabilityName:"%%f" /Quiet
)
goto :eof
rem 移除系统组件 [ %~1 : 镜像挂载路径, %~2 : 组件名称 ]
:RemoveComponent
setlocal