mirror of
https://github.com/dragonflylee/WimHelper.git
synced 2025-01-07 03:06:44 +08:00
fix oem remove appx
This commit is contained in:
parent
e738419a4d
commit
7d51dfa46a
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ Pack/Appx/*.Msix
|
||||
*.wim
|
||||
*.esd
|
||||
*.iso
|
||||
*.log
|
||||
|
||||
/Mount
|
||||
/Temp
|
||||
|
@ -137,6 +137,15 @@ Windows Registry Editor Version 5.00
|
||||
;Edge 优化
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge]
|
||||
"PreventFirstRunPage"=dword:00000001
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
|
||||
"HideFirstRunExperience"=dword:00000001
|
||||
"BackgroundModeEnabled"=dword:00000000
|
||||
"BingAdsSuppression"=dword:00000000
|
||||
"NewTabPageContentEnabled"=dword:00000000
|
||||
"NewTabPageHideDefaultTopSites"=dword:00000001
|
||||
"SuppressUnsupportedOSWarning"=dword:00000001
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\Recommended]
|
||||
"HubsSidebarEnabled"=dword:00000000
|
||||
|
||||
;IE 优化
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main]
|
||||
@ -217,8 +226,4 @@ Windows Registry Editor Version 5.00
|
||||
|
||||
;禁用游戏栏
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR]
|
||||
"AppCaptureEnabled"=dword:00000000
|
||||
|
||||
;禁用 Edge 发现按钮
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
|
||||
"HubsSidebarEnabled"=dword:00000000
|
||||
"AppCaptureEnabled"=dword:00000000
|
@ -4,6 +4,10 @@ Windows Registry Editor Version 5.00
|
||||
[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32]
|
||||
@=""
|
||||
|
||||
;去除“使用记事本编辑”右键
|
||||
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked]
|
||||
"{CA6CC9F1-867A-481E-951E-A28C5E4F01EA}"=""
|
||||
|
||||
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
;훨蛟으앙璘
|
||||
"TaskbarAl"=dword:00000000
|
||||
@ -11,6 +15,8 @@ Windows Registry Editor Version 5.00
|
||||
"TaskbarDa"=dword:00000000
|
||||
;역迦꽉데鞫刻뫘뜩미땍淃
|
||||
"Start_Layout"=dword:00000001
|
||||
;任务栏不显示秒针
|
||||
"ShowSecondsInSystemClock"=-
|
||||
|
||||
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search]
|
||||
;훨蛟으鎧乞움
|
||||
|
18
Pack/Unattend.10.0.arm64.xml
Normal file
18
Pack/Unattend.10.0.arm64.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
|
||||
</OOBE>
|
||||
</component>
|
||||
</settings>
|
||||
</unattend>
|
@ -1,23 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
|
||||
</OOBE>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
18
Pack/Unattend.10.0.x86.xml
Normal file
18
Pack/Unattend.10.0.x86.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UILanguage>zh-CN</UILanguage>
|
||||
<SystemLocale>zh-CN</SystemLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
|
||||
</OOBE>
|
||||
</component>
|
||||
</settings>
|
||||
</unattend>
|
@ -36,6 +36,7 @@ Win10 2009|[10.0.19042.631](https://download.microsoft.com/download/4/3/0/430e9a
|
||||
Win10 21h2|[10.0.19044.1288](https://download.microsoft.com/download/3/9/6/396ae429-afb2-49da-81d8-c16c6782d082/products_Win10_20211115.cab)|[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/8bc210e9-c232-474a-9fe3-361a41616e80/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTCHINA_RET_x86FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/10612ea6-de4f-4304-adfd-614c4b09b252/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTCONSUMER_RET_x86FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/73a9cc2d-276b-4131-920d-0badc353f690/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTBUSINESS_VOL_x86FRE_zh-cn.esd)|[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/ab5b15da-a74a-4474-974d-0098eca751b6/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTCHINA_RET_x64FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/e7aa8b81-ee80-4b52-8f04-c364f0ce1af1/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTCONSUMER_RET_x64FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/c16e22d4-7faa-4d7e-8d15-e3730219827c/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTBUSINESS_VOL_x64FRE_zh-cn.esd)
|
||||
Win10 22h2|[10.0.19045.2006](https://download.microsoft.com/download/e/6/c/e6c6ef82-8b05-4c0f-9852-d2b86129de29/products_Win10_20220916.cab)|[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/2f69de2d-8881-448a-8510-29d66f612576/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTCHINA_RET_x86FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/324cef54-c8ed-4a59-a661-312965806cf3/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTCONSUMER_RET_x86FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/2a61a343-b0b7-46e4-8361-0e7f8c9159c1/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTBUSINESS_VOL_x86FRE_zh-cn.esd)|[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/1d9e5688-3afb-4133-b711-2c9a0c4b22b5/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTCHINA_RET_x64FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/5fdb4d51-62f0-41bb-9487-d80b18bc11f7/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTCONSUMER_RET_x64FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/a6fca105-b105-4b13-b98b-74848e48e3e8/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTBUSINESS_VOL_x64FRE_zh-cn.esd)
|
||||
Win11 22h2|[10.0.22621.525](https://download.microsoft.com/download/a/e/5/ae50fa4c-e37b-4ef1-bf6b-60a0e4382d08/products_Win11_20220926.cab)||[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/bb82f18d-5184-420c-bd2e-0ba3e8ac2528/22621.525.220925-0207.ni_release_svc_refresh_CLIENTCHINA_RET_x64FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/9282e556-e4ce-4e75-a650-3b8dea2f060a/22621.525.220925-0207.ni_release_svc_refresh_CLIENTCONSUMER_RET_x64FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/c1dd582c-68cb-4c22-8926-637352b88992/22621.525.220925-0207.ni_release_svc_refresh_CLIENTBUSINESS_VOL_x64FRE_zh-cn.esd)
|
||||
Win11 23h2|[10.0.22631.2715](https://download.microsoft.com/download/e/8/6/e86b4c6f-4ae8-40df-b983-3de63ea9502d/products_win11_202311109.cab)||[China](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/dc3bb139-de85-4862-a163-baf1797f9e87/22631.2715.231109-1527.23H2_NI_RELEASE_SVC_REFRESH_CLIENTCHINA_RET_x64FRE_zh-cn.esd) [Consumer](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/dea733c4-c820-4600-94e9-e16429351d7b/22631.2715.231109-1527.23H2_NI_RELEASE_SVC_REFRESH_CLIENTCONSUMER_RET_x64FRE_zh-cn.esd) [Business](http://dl.delivery.mp.microsoft.com/filestreamingservice/files/b17588ba-44c2-458d-b7ba-61f1d5309f54/22631.2715.231109-1527.23H2_NI_RELEASE_SVC_REFRESH_CLIENTBUSINESS_VOL_x64FRE_zh-cn.esd)
|
||||
|
||||
### 2. 更新补丁获取
|
||||
|
||||
|
@ -8,7 +8,7 @@ mode con cols=120
|
||||
cls
|
||||
setlocal EnableDelayedExpansion
|
||||
set NSudo="%~dp0Bin\%PROCESSOR_ARCHITECTURE%\NSudo.exe"
|
||||
set "Dism=Dism.exe /NoRestart /LogLevel:1"
|
||||
set "Dism=Dism.exe /NoRestart /LogLevel:3 /LogPath:%~dp0Dism_%date:~0,4%%date:~5,2%%date:~8,2%.log"
|
||||
set "SRC=%SystemDrive%"
|
||||
set "MNT=%~dp0Mount"
|
||||
set "TMP=%~dp0Temp"
|
||||
@ -71,13 +71,12 @@ for /f %%f in ('type "%~dp0Pack\FeatureList.%ImageShortVersion%.txt" 2^>nul') do
|
||||
for /f %%f in ('type "%~dp0Pack\RemoveList.%ImageVersion%.txt" 2^>nul') do call :RemoveComponent "%~1", "%%f"
|
||||
rem call :IntRollupFix "%~1"
|
||||
rem call :AddAppx "%~1", "DesktopAppInstaller", "VCLibs"
|
||||
call :AddAppx "%~1", "WindowsStore", "VCLibs UI.Xaml.2.7 Native.Runtime Native.Framework"
|
||||
call :AddAppx "%~1", "DesktopAppInstaller"
|
||||
call :AddAppx "%~1", "WindowsStore", "VCLibs UI.Xaml.2.8 Native.Runtime Native.Framework"
|
||||
call :AddAppx "%~1", "DesktopAppInstaller", "UI.Xaml.2.7"
|
||||
if "%ImageVersion%" geq "10.0.22000" (
|
||||
call :AddAppx "%~1", "WindowsTerminal"
|
||||
call :AddAppx "%~1", "Client.WebExperience"
|
||||
call :AddAppx "%~1", "WindowsNotepad", "UI.Xaml.2.8"
|
||||
call :AddAppx "%~1", "ScreenSketch", "WindowsAppRuntime"
|
||||
call :AddAppx "%~1", "WindowsNotepad"
|
||||
)
|
||||
call :ImportOptimize "%~1"
|
||||
call :ImportUnattend "%~1"
|
||||
@ -91,13 +90,12 @@ call :GetImageInfo "%~1", "%~2"
|
||||
title 正在处理 [%~2] 镜像 %ImageName% 版本 %ImageVersion% 语言 %ImageLanguage%
|
||||
%Dism% /Mount-Wim /WimFile:"%~1" /Index:%~2 /MountDir:"%MNT%"
|
||||
call :RemoveAppx "%MNT%"
|
||||
rem for /f %%f in ('type "%~dp0Pack\FeatureList.%ImageShortVersion%.txt" 2^>nul') do call ::RemoveCapability "%MNT%", "%%f"
|
||||
rem for /f %%f in ('type "%~dp0Pack\RemoveList.%ImageVersion%.txt" 2^>nul') do call :RemoveComponent "%MNT%", "%%f"
|
||||
call :AddAppx "%MNT%", "WindowsStore", "VCLibs Native.Runtime Native.Framework UI.Xaml.2.7"
|
||||
call :AddAppx "%MNT%", "DesktopAppInstaller"
|
||||
rem for /d %%x in ("%MNT%\Program Files\WindowsApps\Microsoft.*") do call :RemoveFolder "%%x"
|
||||
call :AddAppx "%MNT%", "WindowsStore", "VCLibs UI.Xaml.2.8 Native.Runtime Native.Framework"
|
||||
call :AddAppx "%MNT%", "DesktopAppInstaller", "UI.Xaml.2.7"
|
||||
if "%ImageVersion%" geq "10.0.22000" (
|
||||
call :AddAppx "%~1", "WindowsTerminal"
|
||||
call :AddAppx "%~1", "Client.WebExperience"
|
||||
call :AddAppx "%MNT%", "WindowsTerminal"
|
||||
call :AddAppx "%MNT%", "WindowsNotepad"
|
||||
)
|
||||
call :ImportOptimize "%MNT%"
|
||||
call :ImportUnattend "%MNT%"
|
||||
@ -290,7 +288,7 @@ if "%ImageShortVersion%" leq "10.0" (
|
||||
set "UnattendFile=%~dp0Pack\Unattend.OEM.xml"
|
||||
copy "%~dp0Pack\oemlogo.bmp" "%~1\Windows\System32\oemlogo.bmp"
|
||||
) else (
|
||||
set "UnattendFile=%~dp0Pack\Unattend.%ImageShortVersion%.xml"
|
||||
set "UnattendFile=%~dp0Pack\Unattend.%ImageShortVersion%.%ImageArch%.xml"
|
||||
)
|
||||
if exist "%UnattendFile%" (
|
||||
echo.导入应答 [%UnattendFile%]
|
||||
@ -333,7 +331,7 @@ goto :eof
|
||||
|
||||
rem 移除自带应用 [ %~1 : 镜像挂载路径 ]
|
||||
:RemoveAppx
|
||||
for /f "tokens=3" %%f in ('%Dism% /English /Image:"%~1" /Get-ProvisionedAppxPackages ^| findstr PackageName ^| findstr /V SecHealthUI') do (
|
||||
for /f "tokens=3" %%f in ('%Dism% /English /Image:"%~1" /Get-ProvisionedAppxPackages ^| findstr PackageName ^| findstr /V DesktopAppInstaller') do (
|
||||
echo.移除应用 [%%f]
|
||||
%Dism% /Image:"%~1" /Remove-ProvisionedAppxPackage /PackageName:"%%f" /Quiet
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user