diff --git a/Pack/CapabilityList.10.0.txt b/Pack/FeatureList.10.0.txt similarity index 77% rename from Pack/CapabilityList.10.0.txt rename to Pack/FeatureList.10.0.txt index bab75a4..e4d31fb 100644 --- a/Pack/CapabilityList.10.0.txt +++ b/Pack/FeatureList.10.0.txt @@ -1,5 +1,5 @@ ;混合现实 -;Holographic +Holographic ;快速助手 QuickAssist ;Windows Media Player 播放器 diff --git a/Pack/RemoveList.10.0.18362.txt b/Pack/RemoveList.10.0.18362.txt new file mode 100644 index 0000000..e3e6c03 --- /dev/null +++ b/Pack/RemoveList.10.0.18362.txt @@ -0,0 +1,13 @@ +;混合现实服务 +Microsoft-Windows-Not-Supported-On-LTSB-Package +Microsoft-Windows-Not-Supported-On-LTSB-WOW64-Package +;快速助手 +Microsoft-Windows-QuickAssist-Package +;离线文件 +Microsoft-Windows-OfflineFiles-Package +Microsoft-Windows-OfflineFiles-WOW64-Package +;连接 +Microsoft-Windows-Non-LTSB-RegulatedPackages-Package +;Edge浏览器 +;Microsoft-Windows-Internet-Browser-Package +OpenSSH-Client-Package \ No newline at end of file diff --git a/Pack/Unattend.OEM.xml b/Pack/Unattend.OEM.xml index b4f67d9..a9ce998 100644 --- a/Pack/Unattend.OEM.xml +++ b/Pack/Unattend.OEM.xml @@ -9,7 +9,7 @@ true Lenovo - Yoga730 + diff --git a/WimHelper.cmd b/WimHelper.cmd index 0a7ad89..78c936e 100644 --- a/WimHelper.cmd +++ b/WimHelper.cmd @@ -72,9 +72,9 @@ 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" +for /f %%f in ('type "%~dp0Pack\FeatureList.%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 :AddAppx "%~1", "DesktopAppInstaller", "VCLibs.14" call :AddAppx "%~1", "Store", "VCLibs.14 Runtime.1.7 Framework.1.7" call :AddAppx "%~1", "WindowsCalculator" @@ -94,12 +94,18 @@ rem call :GetImageInfo "%~1", "%~2" title 正在处理 [%~2] 镜像 %ImageName% 版本 %ImageVersion% 语言 %ImageLanguage% %Dism% /Mount-Wim /WimFile:"%~1" /Index:%~2 /MountDir:"%MNT%" +call :RemoveAppx "%MNT%" +for /f %%f in ('type "%~dp0Pack\FeatureList.%ImageShortVersion%.txt" 2^>nul') do call ::RemoveCapability "%MNT%", "%%f" +for /f %%f in ('type "%~dp0Pack\RemoveList.%ImageVersion%.txt" 2^>nul') do call :RemoveComponent "%MNT%", "%%f" +call :IntRollupFix "%MNT%" +call :AddAppx "%MNT%", "DesktopAppInstaller", "VCLibs.14" +call :AddAppx "%MNT%", "Store", "VCLibs.14 Runtime.1.7 Framework.1.7" call :AddAppx "%MNT%", "WacomTechnologyCorp", "UWPDesktop" +call :ImportOptimize "%MNT%" call :ImportUnattend "%MNT%", "OEM" if exist "%~dp0Driver" %Dism% /Image:"%MNT%" /Add-Driver /Driver:"%~dp0Driver" /recurse /ForceUnsigned call :ImageClean "%MNT%" -%Dism% /Commit-Image /MountDir:"%MNT%" /Append -%Dism% /Unmount-Wim /MountDir:"%MNT%" /Discard +%Dism% /Unmount-Wim /MountDir:"%MNT%" /Commit goto :eof rem 处理lopatkin镜像 [ %~1 : 镜像挂载路径 ] @@ -158,7 +164,6 @@ if not exist "%~1\Windows\WinSxS\pending.xml" ( %NSudo% cmd.exe /c rd /s /q "%~1\Windows\WinSxS\Temp\TransformerRollbackData" %NSudo% cmd.exe /c rd /s /q "%~1\Windows\CbsTemp" ) -call :IntFeature "%~1", "NetFx3" endlocal goto :eof @@ -306,6 +311,14 @@ for /f %%i in ('"dir /b %Apps%\*%~2*.appxbundle" 2^>nul') do ( endlocal goto :eof +rem 禁用功能 [ %~1 : 镜像挂载路径, %~2 : 功能名称 ] +:RemoveFeature +for /f "tokens=4" %%f in ('%Dism% /English /Image:"%~1" /Get-Features ^| findstr Feature ^| findstr /i "%~2"') do ( + echo.移除功能 [%%f] + %Dism% /Image:"%~1" /Disable-Feature /FeatureName:"%%f" /Remove +) +goto :eof + rem 移除自带应用 [ %~1 : 镜像挂载路径 ] :RemoveAppx for /f "tokens=3" %%f in ('%Dism% /English /Image:"%~1" /Get-ProvisionedAppxPackages ^| findstr PackageName') do (