Checklist
- [ Yes] I performed a search in the issue tracker to see if my suggestion has already been asked/answered by somebody else.
Describe the solution you'd like
A clear and concise description of what you would like to see implemented.
Add Slim_SAFE from WimBuilder2-Full ,slim drivers, fonts, keyboard, migration,useless
Original is BATCH file
Describe why you believe your suggestion would benefit the project and members of the community at large
if not "x%opt[slim.safe]%"=="xtrue" goto :EOF
echo Safely Sliming...
call :_Slim_font
call :_Slim_keyboard
call :_Slim_migration
call :_Slim_useless
call :KEEP_DONE
goto :EOF
:_Slim_font
rem ==============================================
call :KEEP_FILES \Windows\Fonts\ "app%WB_PE_CODEPAGE%.fon,consola.ttf,marlett.ttf,micross.ttf,tahoma.ttf,segmdl2.ttf,tahoma.ttf,tahomabd.ttf"
call :KEEP_FILES \Windows\Fonts\ "svgafix.fon,svgasys.fon,vga%WB_PE_CODEPAGE%.fon,vgafix.fon,vgafixr.fon,vgaoem.fon,vgasys.fon,vgasysr.fon"
if "x%WB_PE_LANG%"=="xen-US" (
call :KEEP_FILES \Windows\Fonts\ "segoeui.ttf,segoeuib.ttf,segoeuii.ttf"
)
if "x%WB_PE_LANG%"=="xzh-CN" (
call :KEEP_FILES \Windows\Fonts\ "msyh.ttc,s8514fix.fon,s8514oem.fon,s8514sys.fon"
call :KEEP_FILES \Windows\Fonts\ "segoeuib.ttf,seguisbi.ttf,seguisym.ttf,simsun.ttc,wingding.ttf"
del "%X%[KEEP]\Windows\Fonts\tahomabd.ttf"
rem volume mixer
call :KEEP_FILE \Windows\Fonts\Malgun.ttf
)
if "x%WB_PE_LANG%"=="xzh-TW" (
REM ADD MAX
call :KEEP_FILES \Windows\System32\ "locale.nls,l_intl.nls,C_437.NLS,C_936.NLS,C_950.NLS,C_10002.NLS,C_10008.NLS,C_20127.NLS"
call :KEEP_FILES \Windows\Fonts\ "c8514fix.fon,c8514oem.fon,c8514sys.fon,cvgafix.fon,cvgasys.fon"
call :KEEP_FILES \Windows\Fonts\ "segoeuib.ttf,seguisbi.ttf,tahoma.ttf,wingding.ttf,mingliu.ttc"
)
if "x%WB_PE_LANG%"=="xru-RU" (
call :KEEP_FILES \Windows\Fonts\ "cour.ttf,courbd.ttf,courbi.ttf,courer.fon,lucon.ttf,serifer.fon"
)
if "x%WB_PE_LANG%"=="xko-KR" (
call :KEEP_FILES \Windows\Fonts\ "gulim.ttc,malgun.ttf"
)
if "x%WB_PE_LANG%"=="xja-JP" (
call :KEEP_FILES \Windows\Fonts\ "msgothic.ttc,YuGothM.ttc"
)
del /a /f /q "%X_WIN%\System32*.NLS"
del /a /f /q "%X_WIN%\Fonts*.*"
goto :EOF
:_Slim_keyboard
rem ==============================================
set _LocaleId=
for /f "tokens=3" %%l in ('reg query "HKLM\Tmp_SYSTEM\ControlSet001\Control\Nls\Locale" /ve') do (
set _LocaleId=%%l
)
if "x%_LocaleId%"=="x" (
echo [WARNING] Failed to get the locale id.
goto :EOF
)
set _LayoutFile=
for /f "tokens=4" %%l in ('reg query "HKLM\Tmp_SYSTEM\ControlSet001\Control\Keyboard Layouts%_LocaleId%" /v "Layout File"') do (
set _LayoutFile=%%l
)
echo [INFO] Got LocaleId:%_LocaleId%
echo [INFO] Got LayoutFile:%_LayoutFile%
call :KEEP_FILE \Windows\System32\KBDUS.DLL
if /i "x%_LayoutFile%"=="xKBDUS.DLL" set _LayoutFile=
if not "x%_LayoutFile%"=="x" (
call :KEEP_FILE "\Windows\System32%_LayoutFile%"
)
set _LocaleId=
set _LayoutFile=
del /a /f /q "%X_SYS%\KB*.DLL"
goto :EOF
:_Slim_migration
rem ==============================================
del /a /f /q "%X_SYS%\migapp.xml"
del /a /f /q "%X_SYS%\migcore.dll"
del /a /f /q "%X_SYS%\migisol.dll"
del /a /f /q "%X_SYS%\migres.dll"
del /a /f /q "%X_SYS%\migstore.dll"
del /a /f /q "%X_SYS%\migsys.dll"
del /a /f /q "%X_SYS%\SFCN.dat"
del /a /f /q "%X_SYS%\SFL*.dat"
del /a /f /q "%X_SYS%\SFPAT*.inf"
rd /q /s "%X_SYS%\migration"
goto :EOF
:_Slim_useless
rem ==============================================
rd /q /s "%X_SYS%\AdvancedInstallers"
rem del /a /f /q "%X_SYS%\config\BBI"
rem del /a /f /q "%X_SYS%\config\BCD-Template"
rem del /a /f /q "%X_SYS%\config\ELAM"
rd /q /s "%X_SYS%\config\Journal"
rd /q /s "%X_SYS%\config\RegBack"
rd /q /s "%X_SYS%\config\TxR"
rd /q /s "%X_SYS%\config\systemprofile"
rd /q /s "%X_SYS%\DiagSvcs"
rd /q /s "%X_SYS%\SMI"
rd /q /s "%X_SYS%\WindowsPowerShell"
REM ADD MAXMAX max webm=wmic
rd /q /s "%X_SYS%\wbem\Repository"
md "%X_SYS%\wbem\Repository"
REM ADD MAX
REM MAX
del /q "%X_SYS%\Boot%WB_PE_LANG%\winresume."
del /q "%X_SYS%\Boot\winresume."
del /q "%X_SYS%\Boot%WB_PE_LANG%\winresume.*"
REM del /q "%X_SYS%\Boot\winload.efi"
REM del /q "%X_SYS%\Boot\zh-TW\winload.efi.mui"
rem Key Distrubution Service Provider
del /a /f /q "%X_SYS%\KdsCli.dll"
rem Network Kernel Debug Extensibility Modules
rem del /a /f /q "%X_SYS%\kd_*.dll"
goto :EOF
rem ==============================================
rem ==============================================
:KEEP_FILES
echo move "%~1%~2" "%X%[KEEP]%~1"
if not exist "%X%[KEEP]%~1" mkdir "%X%[KEEP]%~1"
for %%i in (%~2) do (
move "%X%%~1%%i" "%X%[KEEP]%~1"
)
goto :EOF
:KEEP_FILE
echo move "%~1" "%X%[KEEP]%~p1"
if not exist "%X%[KEEP]%~p1" mkdir "%X%[KEEP]%~p1"
move "%X%%~1" "%X%[KEEP]%~1"
goto :EOF
:KEEP_DONE
rem restore [KEEP]
if not exist "%X%[KEEP]" goto :EOF
xcopy /S /E /Q /H /K /Y "%X%[KEEP]" "%X%"
rd /s /q "%X%[KEEP]"
goto :EOF
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.