mirror of
https://github.com/AveYo/MediaCreationTool.bat.git
synced 2025-04-04 18:10:45 +00:00
2023.07.14 - V12 - no Server label
- refined method, no Server label - future proofing - tested with 25905 iso, wu and the new wu repair version
This commit is contained in:
parent
7a0e36b324
commit
28d05a1b11
@ -1,27 +1,32 @@
|
||||
@(set '(=)||' <# lean and mean cmd / powershell hybrid #> @'
|
||||
|
||||
::# Get 11 on 'unsupported' PC via Windows Update or mounted ISO (no patching needed)
|
||||
::# if WU is stuck use windows_update_refresh.bat; Beta/Dev needs OfflineInsiderEnroll
|
||||
::# V9+ rebased on cmd due to defender transgression; skip already patched media (0b)
|
||||
::# if WU is stuck use windows_update_refresh.bat; Beta/Dev/Canary needs OfflineInsiderEnroll
|
||||
::# V12: refined method, no Server label; future proofing; tested with 25905 iso, wu and the new wu repair version
|
||||
|
||||
@echo off & title get 11 on 'unsupported' PC || AveYo 2023.07.04
|
||||
if /i "%~f0" neq "%Public%\get11.cmd" goto setup
|
||||
set CLI=%*& set SOURCES=%SystemDrive%\$WINDOWS.~BT\Sources& set MEDIA=.& set /a VER=11
|
||||
if not defined CLI (exit /b) else if not exist %SOURCES%\SetupHost.exe (exit /b)
|
||||
if not exist %SOURCES%\SetupCore.exe mklink /h %SOURCES%\SetupCore.exe %SOURCES%\SetupHost.exe >nul
|
||||
for %%W in (%CLI%) do if /i %%W == /InstallFile (set "MEDIA=") else if not defined MEDIA set "MEDIA=%%~dpW"
|
||||
@echo off & title get 11 on 'unsupported' PC || AveYo 2023.07.14
|
||||
if /i "%~f0" neq "%SystemDrive%\Scripts\get11.cmd" goto setup
|
||||
powershell -win 1 -nop -c ";"
|
||||
set CLI=%*& set SOURCES=%SystemDrive%\$WINDOWS.~BT\Sources& set MEDIA=.& set MOD=CLI& set PRE=WUA& set /a VER=11
|
||||
if not defined CLI (exit /b) else if not exist %SOURCES%\SetupHost.exe (exit /b)
|
||||
if not exist %SOURCES%\WindowsUpdateBox.exe mklink /h %SOURCES%\WindowsUpdateBox.exe %SOURCES%\SetupHost.exe
|
||||
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableWUfBSafeguards /d 1 /t reg_dword
|
||||
reg add HKLM\SYSTEM\Setup\MoSetup /f /v AllowUpgradesWithUnsupportedTPMorCPU /d 1 /t reg_dword
|
||||
set OPT=/Compat IgnoreWarning /MigrateDrivers All /Telemetry Disable
|
||||
set /a restart_application=0x800705BB & (call set CLI=%%CLI:%1 =%%)
|
||||
set /a incorrect_parameter=0x80070057 & (set SRV=%CLI:/Product Client =%)
|
||||
set /a launch_option_error=0xc190010a & (set SRV=%SRV:/Product Server =%)
|
||||
for %%W in (%CLI%) do if /i %%W == /PreDownload (set MOD=SRV)
|
||||
for %%W in (%CLI%) do if /i %%W == /InstallFile (set PRE=ISO& set "MEDIA=") else if not defined MEDIA set "MEDIA=%%~dpW"
|
||||
if %VER% == 11 for %%W in ("%MEDIA%appraiserres.dll") do if exist %%W if %%~zW == 0 set AlreadyPatched=1 & set /a VER=10
|
||||
if %VER% == 11 findstr /r "P.r.o.d.u.c.t.V.e.r.s.i.o.n...1.0.\..0.\..2.[235]" %SOURCES%\SetupHost.exe >nul 2>nul || set /a VER=10
|
||||
if %VER% == 11 if not exist "%MEDIA%EI.cfg" (echo;[Channel]>%SOURCES%\EI.cfg & echo;_Default>>%SOURCES%\EI.cfg) 2>nul
|
||||
if %VER% == 11 (set CLI=/Product Server /Compat IgnoreWarning /MigrateDrivers All /Telemetry Disable %SRV%)
|
||||
if %VER% == 11 reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableWUfBSafeguards /d 1 /t reg_dword >nul
|
||||
if %VER% == 11 reg add HKLM\SYSTEM\Setup\MoSetup /f /v AllowUpgradesWithUnsupportedTPMorCPU /d 1 /t reg_dword >nul
|
||||
%SOURCES%\SetupCore.exe %CLI%
|
||||
if %errorlevel% == %restart_application% %SOURCES%\SetupCore.exe %CLI%
|
||||
if %VER% == 11 findstr /r "P.r.o.d.u.c.t.V.e.r.s.i.o.n...1.0.\..0.\..2.[2-9]" %SOURCES%\SetupHost.exe >nul 2>nul || set /a VER=10
|
||||
if %VER% == 11 if not exist "%MEDIA%EI.cfg" (echo;[Channel]>%SOURCES%\EI.cfg & echo;_Default>>%SOURCES%\EI.cfg)
|
||||
if %VER%_%PRE% == 11_ISO (%SOURCES%\WindowsUpdateBox.exe /Product Server /PreDownload /Quiet %OPT%)
|
||||
if %VER%_%PRE% == 11_ISO (del /f /q %SOURCES%\appraiserres.dll 2>nul & cd.>%SOURCES%\appraiserres.dll)
|
||||
if %VER%_%MOD% == 11_SRV (set ARG=%OPT% %SRV% /Product Server)
|
||||
if %VER%_%MOD% == 11_CLI (set ARG=%OPT% %CLI%)
|
||||
%SOURCES%\WindowsUpdateBox.exe %ARG%
|
||||
if %errorlevel% == %restart_application% %SOURCES%\WindowsUpdateBox.exe %ARG%
|
||||
exit /b
|
||||
|
||||
:setup
|
||||
@ -41,20 +46,20 @@ if /i "%CLI%"=="" reg query "%IFEO%\SetupHost.exe\0" /v Debugger >nul 2>nul && g
|
||||
if /i "%~1"=="install" (goto install) else if /i "%~1"=="remove" goto remove
|
||||
|
||||
:install
|
||||
copy /y "%~f0" "%Public%\get11.cmd" >nul 2>nul
|
||||
copy /y "%~f0" "%SystemDrive%\Scripts\get11.cmd" >nul 2>nul
|
||||
reg add "%IFEO%\SetupHost.exe" /f /v UseFilter /d 1 /t reg_dword >nul
|
||||
reg add "%IFEO%\SetupHost.exe\0" /f /v FilterFullPath /d "%SystemDrive%\$WINDOWS.~BT\Sources\SetupHost.exe" >nul
|
||||
reg add "%IFEO%\SetupHost.exe\0" /f /v Debugger /d "%Public%\get11.cmd" >nul
|
||||
reg add "%IFEO%\SetupHost.exe\0" /f /v Debugger /d "%SystemDrive%\Scripts\get11.cmd" >nul
|
||||
echo;
|
||||
%<%:f0 " Skip TPM Check on Dynamic Update V11 "%>>% & %<%:2f " INSTALLED "%>>% & %<%:f0 " run again to remove "%>%
|
||||
%<%:f0 " Skip TPM Check on Dynamic Update V12 "%>>% & %<%:2f " INSTALLED "%>>% & %<%:f0 " run again to remove "%>%
|
||||
if /i "%CLI%"=="" timeout /t 7
|
||||
exit /b
|
||||
|
||||
:remove
|
||||
del /f /q "%Public%\get11.cmd" "%ProgramData%\get11.cmd" >nul 2>nul
|
||||
del /f /q "%SystemDrive%\Scripts\get11.cmd" "%Public%\get11.cmd" "%ProgramData%\get11.cmd" >nul 2>nul
|
||||
reg delete "%IFEO%\SetupHost.exe" /f >nul 2>nul
|
||||
echo;
|
||||
%<%:f0 " Skip TPM Check on Dynamic Update V11 "%>>% & %<%:df " REMOVED "%>>% & %<%:f0 " run again to install "%>%
|
||||
%<%:f0 " Skip TPM Check on Dynamic Update V12 "%>>% & %<%:df " REMOVED "%>>% & %<%:f0 " run again to install "%>%
|
||||
if /i "%CLI%"=="" timeout /t 7
|
||||
exit /b
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user