mirror of
https://github.com/AveYo/MediaCreationTool.bat.git
synced 2025-12-23 22:27:43 -05:00
stable
all issues ironed out upgrade keeping files from Eval editions earlier detect of setup ui exit enhanced 11 AutoUnattend.xml move bypass stuff from main readme last squash I promise ;)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
dev/
|
||||
$ISO$/
|
||||
*.iso
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
87
README.md
87
README.md
@@ -1,6 +1,7 @@
|
||||
Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
|
||||
<img src="preview.png">
|
||||
A powerful yet simple windows 10 / 11 deployment automation tool as well!
|
||||
*If you had no success launching the script so far, this latest version will work*
|
||||
|
||||
Presets
|
||||
-------
|
||||
@@ -8,9 +9,11 @@ Presets
|
||||
> _- can keep files and apps on more scenarios where os and target edition does not match_
|
||||
> _- can switch detected edition by adding EditionID to script name_
|
||||
> _- can troubleshoot upgrade failing by adding `no_update` to script name_
|
||||
> _- auto defaults to 11, so pass version as well for 10: `auto 21H2 MediaCreationTool.bat`_
|
||||
|
||||
2 ***Auto ISO*** with detected media in current folder directly _(or C:\ESD if run from zip)_
|
||||
> _- can override detected media by adding edition name / language / arch to script name_
|
||||
> _- example: `21H1 Education en-US x86 iso MediaCreationTool.bat`_
|
||||
|
||||
3 ***Auto USB*** with detected media in specified usb target
|
||||
> _- for data safety, this is not fully automated - must select the usb drive manually in GUI_
|
||||
@@ -19,32 +22,37 @@ Presets
|
||||
> _- implicit choice, includes setup override files (disable by adding `def` to script name)_
|
||||
|
||||
5 ***MCT Defaults*** runs unassisted, creating media without script modification
|
||||
> _- no added files, script passes `products.xml` and quits without touching media_
|
||||
> _- no added files, script passes `products.xml` to MCT and quits without touching media_
|
||||
|
||||
1-4 presets will modify created media in the following ways:
|
||||
> _- write `auto.cmd` to run on demand from media for auto upgrade with edition switch support and skip tpm_
|
||||
> _- write `$OEM$` folder (if it exists) with post setup tweaks like `$OEM$\$$\Setup\Scripts\setupcomplete.cmd`_
|
||||
> _- write `sources\PID.txt` to preselect edition at media boot or setup within windows (if configured)_
|
||||
> _- write `auto.cmd` to run on demand for auto upgrade with edition switch and skip tpm_
|
||||
> _- write `$ISO$` folder content (if it exists) at the root of the media_
|
||||
> _if you previously used $OEM$ content, must now place it in `$ISO$\sources\$OEM$\`_
|
||||
> _- write `sources\PID.txt` to preselect edition at media boot or within windows (if configured)_
|
||||
> _- write `sources\EI.cfg` to prevent product key prompt on Windows 11 consumer media (11 only)_
|
||||
> _- write `AutoUnattend.xml` in boot.wim to enable local account on Windows 11 Home (11 only)_
|
||||
> _- patch `winsetup.dll` in boot.wim to remove windows 11 setup checks when booting from media (11 only)_
|
||||
> _- can disable by adding `def` to script name_
|
||||
> _- can disable by adding `def` to script name for a default, untouched MCT media_
|
||||
|
||||
Simple deployment
|
||||
-----------------
|
||||
**auto.cmd** is behind ***Auto Upgrade*** preset via GUI,
|
||||
or fully unnatended by renaming script with `auto MediaCreationTool.bat`
|
||||
Should make it easy to upgrade keeping files and apps when the OS edition does not match the created media
|
||||
**auto.cmd** is behind ***Auto Upgrade*** preset via GUI
|
||||
Can run it fully unnatended by renaming script with `auto MediaCreationTool.bat`
|
||||
Makes it easy to upgrade keeping files and apps when the OS edition does not match the media
|
||||
Should allow upgrade from Ultimate, PosReady, Embedded, LTSC or Enterprise Eval as well
|
||||
|
||||
Generated script is added to the created media so you can run it again at any time
|
||||
It is fairly generic - it will detect available editions in install.esd, pick a suitable index, then
|
||||
update EditionID in the registry to match target; can even force upgrade to another edition, keeping files and apps!
|
||||
Also sets recommended setup options with least amount of issues on upgrades
|
||||
It is fairly generic - it will detect available editions in install.esd, pick a suitable index,
|
||||
then set EditionID in the registry to match; can even force another edition, keeping files and apps!
|
||||
On 11, it will try to skip setup checks (can disable this behavior with script var)
|
||||
Finally, it sets recommended setup options with least amount of issues on upgrades
|
||||
|
||||
> Let's say the current OS is Enterprise LTSC 2019, and you use the business media to upgrade:
|
||||
> **auto.cmd** selects Enterprise index and adjust EditionID to Enterprise in the registry (backed up as EditionID_undo)
|
||||
> Maybe you also want to switch edition,
|
||||
> ex. by renaming the script to `ProfessionalWorkstation MediaCreationTool.bat`:
|
||||
> **auto.cmd** selects Professional index and sets EditionID to ProfessionalWorkstation in the registry.
|
||||
>
|
||||
> Let's say the OS is Windows 7 Ultimate or PosReady, and you use the consumer media to upgrade:
|
||||
> **auto.cmd** selects Professional index, and sets EditionID to Professional or Enterprise, respectively.
|
||||
> In all cases, the script tries to pick an existing index, else a compatible one to keep files and apps on upgrade.
|
||||
@@ -52,57 +60,9 @@ Also sets recommended setup options with least amount of issues on upgrades
|
||||
> Let's say you have a dozen PCs spread with versions: 7, 8.1, 10 and editions: Ultimate, Home, Enterprise LTSB..
|
||||
> If you need to upgrade all to the latest 10 version and only use Pro, you could rename the script as:
|
||||
> `auto 21H2 Pro MediaCreationTool.bat`
|
||||
>
|
||||
> Can even add a VL / MAK / retail product key in the same way to take care of licensing differences.
|
||||
> The script also picks up any `$OEM$` folder in the current location - for unified branding, configuration, tweaks etc.
|
||||
|
||||
|
||||
Windows 11 and the TPM / SecureBoot / CPU / Storage setup checks
|
||||
----------------------------------------------------------------
|
||||
[MediaCreationTool.bat](MediaCreationTool.bat) creates 11 media that will **automatically skip clean install checks**
|
||||
***Auto Upgrade*** preset, or launching `auto.cmd` from the created media will **automatically skip upgrade checks**
|
||||
Running `setup.exe` from the created media does not bypass setup checks - use `auto.cmd` instead!
|
||||
To NOT add bypass to the media, use ***MCT Defaults*** preset or rename the script as `def MediaCreationTool.bat`
|
||||
|
||||
> Regarding the bypass method, for a more reliable and future-proof experience,
|
||||
> clean installation is still handled via _winsetup.dll_ patching in _boot.wim_
|
||||
> upgrade is now handled only via `auto.cmd` with the */Product Server* trick
|
||||
> *Just ignore the 'Windows Server' label, please!*
|
||||
Note that [Skip_TPM_Check_on_Dynamic_Update.cmd](bypass11/Skip_TPM_Check_on_Dynamic_Update.cmd) acts globally and **will skip upgrade checks via setup.exe**
|
||||
|
||||
Get 11 via Windows Update on "unsupported" hardware
|
||||
---------------------------------------------------
|
||||
Step 1: use [Skip_TPM_Check_on_Dynamic_Update.cmd](bypass11/Skip_TPM_Check_on_Dynamic_Update.cmd) to automatically bypass setup requirements
|
||||
_It's a set it and forget it script, with built-in undo - v7 using more reliable /Product Server trick_
|
||||
|
||||
Step 2: use [OfflineInsiderEnroll](https://github.com/abbodi1406/offlineinsiderenroll) to subscribe to the channel you want
|
||||
_while on 10, use BETA for Windows 11 22000.x builds (release), DEV for Windows 11 225xx.x builds (experimental)_
|
||||
|
||||
Step 3: check for updates via Settings - Windows Update and select Upgrade to Windows 11
|
||||
|
||||
Already have a 11 ISO, USB or extracted Files and want to add a bypass
|
||||
----------------------------------------------------------------------
|
||||
Use [Quick_11_iso_esd_wim_TPM_toggle.bat](bypass11/Quick_11_iso_esd_wim_TPM_toggle.bat) from the confort of right-click - SendTo menu
|
||||
|
||||
Switches installation type to Server skipping install checks, or back to Client if run again on the same file, restoring hash!
|
||||
**directly** on any downloaded windows 11 iso or extracted esd and wim, so there's no iso / dism mounting
|
||||
_defiantly quick_
|
||||
|
||||
Works great with business / enterprise media since it comes with ei.cfg so setup won't ask for product key at start
|
||||
for consumer / core media you can add a generic `EI.cfg` to the media\sources yourself with this content:
|
||||
`[Channel]`
|
||||
`_Default`
|
||||
|
||||
> if setup still asks for product key, input retail or gvlk keys found in media\sources\product.ini
|
||||
> _gvlkprofessional=W269N-WFGWX-YVC9B-4J6C9-T83GX gvlkcore=TX9XD-98N7V-6WMQ6-BX7FG-H8Q99_
|
||||
> _gvlkenterprise=NPPR9-FWDCX-D2C8J-H872K-2YT43 gvlkeducation=NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 etc._
|
||||
|
||||
Note that [Skip_TPM_Check_on_Dynamic_Update.cmd](bypass11/Skip_TPM_Check_on_Dynamic_Update.cmd) **will work for manual upgrade as well**
|
||||
_regardless of mounted iso / usb media already having a bypass added or not_
|
||||
|
||||
If having update issues - on any windows version
|
||||
------------------------------------------------
|
||||
Use [windows_update_refresh.bat](bypass11/windows_update_refresh.bat)
|
||||
_AveYo: as a bonus, it hides unsupported PC nags_
|
||||
> The script also picks up any `$ISO$` folder in the current location - for $OEM$ branding, configuration, tweaks etc.
|
||||
|
||||
Changelog
|
||||
---------
|
||||
@@ -160,4 +120,9 @@ _We did it! We broke [the previous gist](https://git.io/MediaCreationTool.bat)_
|
||||
2021.12.07: skip windows 11 upgrade checks only via auto.cmd - just ignore server label, please
|
||||
2021.12.15: fix regression with 1507-1709 not getting the correct fallback esd; fix dev '-noe' not autoclosing script
|
||||
2021.12.22: improved auto.cmd handling of mismatched OS and target edition, obey 'def', 'auto' upgrades 7 to 10, not 11
|
||||
2022.03.16: prevent launch errors when run from non-canonical paths; USBLayout progress; pickup $ISO$ dir to add on media
|
||||
DU in 11: auto installs 22000.556 atm; older skip_11_checks, without Server label; Home offline local account
|
||||
2022.03.18: fix regression with Auto Upgrade; removed powershell -nop arg (issue #41); enhanced 11 AutoUnattend.xml
|
||||
2022.03.20: stable - all issues ironed out; improved script ui; upgrade keeping files from Eval editions too
|
||||
last squash I promise ;)
|
||||
```
|
||||
|
||||
55
bypass11/AutoUnattend.xml
Normal file
55
bypass11/AutoUnattend.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="windowsPE"><component name="Microsoft-Windows-Setup" processorArchitecture="amd64" language="neutral"
|
||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
|
||||
<UserData><ProductKey><Key>AAAAA-VVVVV-EEEEE-YYYYY-OOOOO</Key><WillShowUI>OnError</WillShowUI></ProductKey></UserData>
|
||||
<ComplianceCheck><DisplayReport>Never</DisplayReport></ComplianceCheck><Diagnostics><OptIn>false</OptIn></Diagnostics>
|
||||
<DynamicUpdate><Enable>true</Enable><WillShowUI>Never</WillShowUI></DynamicUpdate><EnableNetwork>true</EnableNetwork>
|
||||
<RunSynchronous>
|
||||
<!-- Skip 11 Checks on Boot via reg - unreliable vs winsetup.dll patch used in MediaCreationTool.bat -->
|
||||
<RunSynchronousCommand wcm:action="add"><Order>1</Order>
|
||||
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /d 1 /t reg_dword /f</Path></RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add"><Order>2</Order>
|
||||
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /d 1 /t reg_dword /f</Path></RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add"><Order>3</Order>
|
||||
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /d 1 /t reg_dword /f</Path></RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add"><Order>4</Order>
|
||||
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassStorageCheck /d 1 /t reg_dword /f</Path></RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add"><Order>5</Order>
|
||||
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassCPUCheck /d 1 /t reg_dword /f</Path></RunSynchronousCommand>
|
||||
</RunSynchronous>
|
||||
</component></settings>
|
||||
<settings pass="specialize"><component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" language="neutral"
|
||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
|
||||
<RunSynchronous>
|
||||
<!-- offline local account via OOBE\BYPASSNRO on every site but literally no one credits AveYo for sharing it -->
|
||||
<RunSynchronousCommand wcm:action="add"><Order>1</Order>
|
||||
<Path>reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t reg_dword /d 1 /f</Path>
|
||||
</RunSynchronousCommand>
|
||||
<!-- hide unsupported nag on update settings - 25H1 is not a typo ;) -->
|
||||
<RunSynchronousCommand wcm:action="add"><Order>2</Order>
|
||||
<Path>reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersion /d 1 /t reg_dword /f</Path>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add"><Order>3</Order>
|
||||
<Path>reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersionInfo /d 25H1 /f</Path>
|
||||
</RunSynchronousCommand>
|
||||
</RunSynchronous>
|
||||
</component></settings>
|
||||
<settings pass="oobeSystem"><component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" language="neutral"
|
||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
|
||||
<OOBE>
|
||||
<HideLocalAccountScreen>false</HideLocalAccountScreen><HideOnlineAccountScreens>false</HideOnlineAccountScreens>
|
||||
<HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE><ProtectYourPC>3</ProtectYourPC>
|
||||
</OOBE>
|
||||
<FirstLogonCommands>
|
||||
<!-- hide unsupported nag on desktop - originally shared by awuctl @ MDL -->
|
||||
<SynchronousCommand wcm:action="add"><Order>1</Order>
|
||||
<CommandLine>reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV1 /d 0 /t reg_dword /f</CommandLine>
|
||||
</SynchronousCommand><SynchronousCommand wcm:action="add"><Order>2</Order>
|
||||
<CommandLine>reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV2 /d 0 /t reg_dword /f</CommandLine>
|
||||
</SynchronousCommand>
|
||||
</FirstLogonCommands>
|
||||
</component></settings>
|
||||
</unattend>
|
||||
@@ -1,13 +1,20 @@
|
||||
@(echo off% <#%) &color 07 &title Quick 11 iso esd wim TPM toggle by AveYo - with SendTo menu entry
|
||||
set "0=%~f0" &set "1=%~f1"&set "2=%~2"& powershell -nop -c iex ([io.file]::ReadAllText($env:0)) &pause &exit/b ||#>)[1]
|
||||
|
||||
#:: what's new in v1.1: fixed relative seek, should now work on all iso's
|
||||
#:: what's new in v1.2: add uninstall when run again without parameters (issue #96)
|
||||
$timer = $(get-date)
|
||||
|
||||
#:: Install to SendTo menu when run from another location
|
||||
if (!$env:1) { write-host "`n No input iso / esd / wim file to patch! use 'Send to' context menu ...`n" -fore Yellow }
|
||||
$SendTo = [Environment]::GetFolderPath('ApplicationData') + '\Microsoft\Windows\SendTo'
|
||||
if (!$env:1 -and $env:0 -and $(Split-Path $env:0) -ne $SendTo) {copy $env:0 "$SendTo\Quick_11_iso_esd_wim_TPM_toggle.bat" -force}
|
||||
$Script = "$SendTo\Quick_11_iso_esd_wim_TPM_toggle.bat"
|
||||
if (!$env:1 -and $env:0 -and !(test-path $Script)) {
|
||||
write-host "`n No input iso / esd / wim file to patch! use 'Send to' context menu ...`n" -fore Yellow
|
||||
copy $env:0 $Script -force
|
||||
}
|
||||
elseif (!$env:1 -and $env:0 -and (test-path $Script)) {
|
||||
write-host "`n Removed 'Send to' entry - run again to install ...`n" -fore Magenta
|
||||
del $Script -force
|
||||
}
|
||||
if (!$env:1) { return }
|
||||
|
||||
#:: Can force either patch or undo via second commandline parameter: 1 to patch 0 to undo
|
||||
|
||||
150
bypass11/auto.cmd
Normal file
150
bypass11/auto.cmd
Normal file
@@ -0,0 +1,150 @@
|
||||
@echo off& title Auto Upgrade - MCT || supports Ultimate / PosReady / Embedded / LTSC / Enterprise Eval
|
||||
set "EDITION_SWITCH="
|
||||
set "SKIP_11_SETUP_CHECKS=1"
|
||||
set OPTIONS=/SelfHost /Auto Upgrade /MigChoice Upgrade /Compat IgnoreWarning /MigrateDrivers All /ResizeRecoveryPartition Disable
|
||||
set OPTIONS=%OPTIONS% /ShowOOBE None /Telemetry Disable /CompactOS Disable /DynamicUpdate Enable /SkipSummary /Eula Accept
|
||||
|
||||
pushd "%~dp0" & for %%w in (%1) do pushd %%w
|
||||
for %%i in ("x86\" "x64\" "") do if exist "%%~isources\setupprep.exe" set "dir=%%~i"
|
||||
pushd "%dir%sources" || (echo "%dir%sources" not found! script should be run from windows setup media & timeout /t 5 & exit /b)
|
||||
|
||||
::# start sources\setup if under winpe (when booted from media) [Shift] + [F10]: c:\auto or d:\auto or e:\auto etc.
|
||||
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinPE">nul 2>nul && (
|
||||
for %%s in (sCPU sRAM sSecureBoot sStorage sTPM) do reg add HKLM\SYSTEM\Setup\LabConfig /f /v Bypas%%sCheck /d 1 /t reg_dword
|
||||
start "WinPE" sources\setup.exe & exit /b
|
||||
)
|
||||
|
||||
::# init variables
|
||||
setlocal EnableDelayedExpansion
|
||||
set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\windowspowershell\v1.0\;%PATH%"
|
||||
set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\windowspowershell\v1.0\;%PATH%"
|
||||
|
||||
::# elevate so that workarounds can be set under windows
|
||||
fltmc >nul || (set _="%~f0" %*& powershell -nop -c start -verb runas cmd \"/d /x /c call $env:_\"& exit /b)
|
||||
|
||||
::# undo any previous regedit edition rename (if upgrade was interrupted)
|
||||
set "NT=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
|
||||
for %%v in (CompositionEditionID EditionID ProductName) do (
|
||||
call :reg_query "%NT%" %%v_undo %%v
|
||||
if defined %%v reg delete "%NT%" /v %%v_undo /f & for %%A in (32 64) do reg add "%NT%" /v %%v /d "!%%v!" /f /reg:%%A
|
||||
) >nul 2>nul
|
||||
|
||||
::# get current version
|
||||
for %%v in (CompositionEditionID EditionID ProductName CurrentBuildNumber) do call :reg_query "%NT%" %%v %%v
|
||||
for /f "tokens=2-3 delims=[." %%i in ('ver') do for %%s in (%%i) do set /a Version=%%s*10+%%j
|
||||
|
||||
::# WIM_INFO w_5=wim_5th b_5=build_5th p_5=patch_5th a_5=arch_5th l_5=lang_5th e_5=edi_5th d_5=desc_5th i_5=edi_5th i_Core=index
|
||||
set "0=%~f0"& set wim=& set ext=.esd& if exist install.wim (set ext=.wim) else if exist install.swm set ext=.swm
|
||||
set snippet=powershell -nop -c iex ([io.file]::ReadAllText($env:0)-split'#[:]wim_info[:]')[1]; WIM_INFO install%ext% 0 0
|
||||
set w_count=0& for /f "tokens=1-7 delims=," %%i in ('"%snippet%"') do (set w_%%i=%%i,%%j,%%k,%%l,%%m,%%n,%%o& set /a w_count+=1
|
||||
set b_%%i=%%j& set p_%%i=%%k& set a_%%i=%%l& set l_%%i=%%m& set e_%%i=%%n& set d_%%i=%%o& set i_%%n=%%i& set i_%%i=%%n)
|
||||
|
||||
::# print available editions in install.esd via wim_info snippet
|
||||
echo;------------------------------------------------------------------------------------
|
||||
for /l %%i in (1,1,%w_count%) do call echo;%%w_%%i%%
|
||||
echo;------------------------------------------------------------------------------------
|
||||
|
||||
::# get requested edition in EI.cfg or PID.txt or OPTIONS
|
||||
if exist product.ini for /f "tokens=1,2 delims==" %%O in (product.ini) do if not "%%P" equ "" (set pid_%%O=%%P& set pn_%%P=%%O)
|
||||
set EI=& set Name=& set eID=& set reg=& set "cfg_filter=EditionID Channel OEM Retail Volume _Default VL 0 1 ^$"
|
||||
if exist EI.cfg for /f "tokens=*" %%i in ('findstr /v /i /r "%cfg_filter%" EI.cfg') do (set EI=%%i& set eID=%%i)
|
||||
if exist PID.txt for /f "delims=;" %%i in (PID.txt) do set %%i 2>nul
|
||||
if not defined Value for %%s in (%OPTIONS%) do if defined pn_%%s (set Name=!pn_%%s!& set Name=!Name:gvlk=!)
|
||||
if defined Value if not defined Name for %%s in (%Value%) do (set Name=!pn_%%s!& set Name=!Name:gvlk=!)
|
||||
if defined EDITION_SWITCH (set eID=%EDITION_SWITCH%) else if defined Name for %%s in (%Name%) do (set eID=%Name%)
|
||||
if not defined eID set eID=%EditionID%& if not defined EditionID set eID=Professional& set EditionID=Professional
|
||||
if /i "%EditionID%" equ "%eID%" (set changed=) else set changed=1
|
||||
|
||||
::# upgrade matrix - now also for Enterprise Eval - automatically pick edition that would keep files and apps
|
||||
if /i CoreCountrySpecific equ %eID% set "comp=!eID!" & set "reg=!eID!" & if not defined i_!eID! set "eID=Core"
|
||||
if /i CoreSingleLanguage equ %eID% set "comp=Core" & set "reg=!eID!" & if not defined i_!eID! set "eID=Core"
|
||||
for %%e in (Starter HomeBasic HomePremium CoreConnectedCountrySpecific CoreConnectedSingleLanguage CoreConnected Core) do (
|
||||
if /i %%e equ %eID% set "comp=Core" & set "eID=Core"
|
||||
if /i %%eN equ %eID% set "comp=CoreN" & set "eID=CoreN"
|
||||
if /i %%e equ %eID% if not defined i_Core set "eID=Professional" & if not defined reg set "reg=Core"
|
||||
if /i %%eN equ %eID% if not defined i_CoreN set "eID=ProfessionalN" & if not defined reg set "reg=CoreN"
|
||||
)
|
||||
for %%e in (Ultimate ProfessionalStudent ProfessionalCountrySpecific ProfessionalSingleLanguage) do (
|
||||
if /i %%e equ %eID% (set "eID=Professional") else if /i %%eN equ %eID% set "eID=ProfessionalN"
|
||||
)
|
||||
for %%e in (EnterpriseG EnterpriseS IoTEnterpriseS IoTEnterprise Embedded) do (
|
||||
if /i %%e equ %eID% (set "eID=Enterprise") else if /i %%eN equ %eID% set "eID=EnterpriseN"
|
||||
)
|
||||
for %%e in (Enterprise EnterpriseS) do (
|
||||
if /i %%eEval equ %eID% (set "eID=Enterprise") else if /i %%eNEval equ %eID% set "eID=EnterpriseN"
|
||||
)
|
||||
if /i Enterprise equ %eID% set "comp=!eID!" & if not defined i_!eID! set "eID=Professional" & set "reg=!comp!"
|
||||
if /i EnterpriseN equ %eID% set "comp=!eID!" & if not defined i_!eID! set "eID=ProfessionalN" & set "reg=!comp!"
|
||||
for %%e in (Education ProfessionalEducation ProfessionalWorkstation Professional Cloud) do (
|
||||
if /i %%eN equ %eID% set "comp=EnterpriseN" & if not defined reg set "reg=%%eN"
|
||||
if /i %%e equ %eID% set "comp=Enterprise" & if not defined reg set "reg=%%e"
|
||||
if /i %%eN equ %eID% set "eID=ProfessionalN" & if defined i_%%eN set "eID=%%eN"
|
||||
if /i %%e equ %eID% set "eID=Professional" & if defined i_%%e set "eID=%%e"
|
||||
)
|
||||
set index=& set lst=Professional& for /l %%i in (1,1,%w_count%) do if /i !i_%%i! equ !eID! set "index=%%i" & set "eID=!i_%%i!"
|
||||
if not defined index set index=1& set eID=!i_1!& if defined i_%lst% set "index=!i_%lst%!" & set "eID=%lst%"& set "comp=Enterprise"
|
||||
set Build=!b_%index%!& set OPTIONS=%OPTIONS% /ImageIndex %index%& if defined changed if not defined reg set "reg=!eID!"
|
||||
echo;Current edition: %EditionID% & echo;Regedit edition: %reg% & echo;Index: %index% Image: %eID%
|
||||
timeout /t 10
|
||||
|
||||
::# disable upgrade blocks
|
||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f /v DisableWUfBSafeguards /d 1 /t reg_dword >nul 2>nul
|
||||
|
||||
::# prevent usage of MCT for intermediary upgrade in Dynamic Update (causing 7 to 19H1 instead of 7 to 21H2 for example)
|
||||
if "%Build%" gtr "15063" (set OPTIONS=%OPTIONS% /UpdateMedia Decline)
|
||||
|
||||
::# skip windows 11 upgrade checks: add launch option trick if old-style 0-byte file trick is not on the media
|
||||
if "%Build%" lss "22000" set /a SKIP_11_SETUP_CHECKS=0
|
||||
reg add HKLM\SYSTEM\Setup\MoSetup /f /v AllowUpgradesWithUnsupportedTPMorCPU /d 1 /t reg_dword >nul 2>nul &rem ::# TPM 1.2+ only
|
||||
if "%SKIP_11_SETUP_CHECKS%" equ "1" cd.>appraiserres.dll 2>nul & rem ::# writable media only
|
||||
for %%A in (appraiserres.dll) do if %%~zA gtr 0 (set TRICK=/Product Server ) else (set TRICK=)
|
||||
if "%SKIP_11_SETUP_CHECKS%" equ "1" (set OPTIONS=%TRICK%%OPTIONS%)
|
||||
|
||||
::# auto upgrade with edition lie workaround to keep files and apps - all 1904x builds allow up/downgrade between them
|
||||
if defined reg call :rename %reg%
|
||||
start "auto" setupprep.exe %OPTIONS%
|
||||
echo;DONE
|
||||
|
||||
EXIT /b
|
||||
|
||||
:rename EditionID
|
||||
set "NT=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
|
||||
for %%v in (CompositionEditionID EditionID ProductName) do reg add "%NT%" /v %%v_undo /d "!%%v!" /f >nul 2>nul
|
||||
for %%A in (32 64) do (
|
||||
reg add "%NT%" /v CompositionEditionID /d "%comp%" /f /reg:%%A
|
||||
reg add "%NT%" /v EditionID /d "%~1" /f /reg:%%A
|
||||
reg add "%NT%" /v ProductName /d "%~1" /f /reg:%%A
|
||||
) >nul 2>nul
|
||||
exit /b
|
||||
|
||||
:reg_query [USAGE] call :reg_query "HKCU\Volatile Environment" Value variable
|
||||
(for /f "tokens=2*" %%R in ('reg query "%~1" /v "%~2" /se "|" %4 2^>nul') do set "%~3=%%S") & exit /b
|
||||
|
||||
#:WIM_INFO:# [PARAMS]: "file" [optional]Index or 0 = all Output 0 = txt 1 = xml 2 = file.txt 3 = file.xml 4 = xml object
|
||||
set ^ #=;$f0=[io.file]::ReadAllText($env:0); $0=($f0-split '#[:]WIM_INFO[:]' ,3)[1]; $1=$env:1-replace'([`@$])','`$1'; iex($0+$1)
|
||||
set ^ #=& set "0=%~f0"& set 1=;WIM_INFO %*& powershell -nop -c "%#%"& exit /b %errorcode%
|
||||
function WIM_INFO ($file = 'install.esd', $index = 0, $out = 0) { :info while ($true) {
|
||||
$block = 2097152; $bytes = new-object 'Byte[]' ($block); $begin = [uint64]0; $final = [uint64]0; $limit = [uint64]0
|
||||
$steps = [int]([uint64]([IO.FileInfo]$file).Length / $block - 1); $enc = [Text.Encoding]::GetEncoding(28591); $delim = @()
|
||||
foreach ($d in '/INSTALLATIONTYPE','/WIM') {$delim += $enc.GetString([Text.Encoding]::Unicode.GetBytes([char]60+ $d +[char]62))}
|
||||
$f = new-object IO.FileStream ($file, 3, 1, 1); $p = 0; $p = $f.Seek(0, 2)
|
||||
for ($o = 1; $o -le $steps; $o++) {
|
||||
$p = $f.Seek(-$block, 1); $r = $f.Read($bytes, 0, $block); if ($r -ne $block) {write-host invalid block $r; break}
|
||||
$u = [Text.Encoding]::GetEncoding(28591).GetString($bytes); $t = $u.LastIndexOf($delim[0], [StringComparison]::Ordinal)
|
||||
if ($t -lt 0) { $p = $f.Seek(-$block, 1)} else { [void]$f.Seek(($t -$block), 1)
|
||||
for ($o = 1; $o -le $block; $o++) { [void]$f.Seek(-2, 1); if ($f.ReadByte() -eq 0xfe) {$begin = $f.Position; break} }
|
||||
$limit = $f.Length - $begin; if ($limit -lt $block) {$x = $limit} else {$x = $block}
|
||||
$bytes = new-object 'Byte[]' ($x); $r = $f.Read($bytes, 0, $x)
|
||||
$u = [Text.Encoding]::GetEncoding(28591).GetString($bytes); $t = $u.IndexOf($delim[1], [StringComparison]::Ordinal)
|
||||
if ($t -ge 0) {[void]$f.Seek(($t + 12 -$x), 1); $final = $f.Position} ; break } }
|
||||
if ($begin -gt 0 -and $final -gt $begin) {
|
||||
$x = $final - $begin; [void]$f.Seek(-$x, 1); $bytes = new-object 'Byte[]' ($x); $r = $f.Read($bytes, 0, $x)
|
||||
if ($r -ne $x) {$f.Dispose(); break} else {[xml]$xml = [Text.Encoding]::Unicode.GetString($bytes); $f.Dispose()}
|
||||
} else {$f.Dispose()} ; break :info }
|
||||
if ($out -eq 1) {[console]::OutputEncoding=[Text.Encoding]::UTF8; $xml.Save([Console]::Out); ''; return}
|
||||
if ($out -eq 3) {try{$xml.Save(($file-replace'esd$','xml'))}catch{}; return}; if ($out -eq 4) {return $xml}
|
||||
$txt = ''; foreach ($i in $xml.WIM.IMAGE) {if ($index -gt 0 -and $($i.INDEX) -ne $index) {continue}; [int]$a='1'+$i.WINDOWS.ARCH
|
||||
$txt+= $i.INDEX+','+$i.WINDOWS.VERSION.BUILD+','+$i.WINDOWS.VERSION.SPBUILD+','+$(@{10='x86';15='arm';19='x64';112='arm64'}[$a])
|
||||
$txt+= ','+$i.WINDOWS.LANGUAGES.LANGUAGE+','+$i.WINDOWS.EDITIONID+','+$i.NAME+[char]13+[char]10}; $txt=$txt-replace',(?=,)',', '
|
||||
if ($out -eq 2) {try{[io.file]::WriteAllText(($file-replace'esd$','txt'),$txt)}catch{}; return}; if ($out -eq 0) {return $txt}
|
||||
} #:WIM_INFO:# Quick WIM SWM ESD ISO info v2 - lean and mean snippet by AveYo, 2021
|
||||
@@ -1,4 +1,57 @@
|
||||
Windows 11 and the TPM / SecureBoot / CPU / Storage setup checks
|
||||
----------------------------------------------------------------
|
||||
[MediaCreationTool.bat](../MediaCreationTool.bat) creates 11 media that will **automatically skip clean install checks**
|
||||
***Auto Upgrade*** preset, or launching `auto.cmd` from the created media will **automatically skip upgrade checks**
|
||||
Running `setup.exe` from the created media is not guaranteed to bypass setup checks (it should for now)
|
||||
To NOT add bypass to the media, use ***MCT Defaults*** preset or rename the script as `def MediaCreationTool.bat`
|
||||
|
||||
> Regarding the bypass method, for a more reliable and future-proof experience,
|
||||
> clean installation is still handled via _winsetup.dll_ patching in _boot.wim_
|
||||
> upgrade is now handled ~~only~~ via `auto.cmd` with the */Product Server* trick
|
||||
> *Just ignore the 'Windows Server' label, please!*
|
||||
> NEWS: temporarily added back my old-style 0-byte bypass as it still works on release
|
||||
|
||||
i: [Skip_TPM_Check_on_Dynamic_Update.cmd](Skip_TPM_Check_on_Dynamic_Update.cmd) acts globally and **skips setup.exe upgrade checks as well**
|
||||
|
||||
Get 11 via Windows Update on "unsupported" hardware
|
||||
---------------------------------------------------
|
||||
Step 1: use [Skip_TPM_Check_on_Dynamic_Update.cmd](Skip_TPM_Check_on_Dynamic_Update.cmd) to automatically bypass setup requirements
|
||||
_It's a set it and forget it script, with built-in undo - v7 using more reliable /Product Server trick_
|
||||
|
||||
Step 2: use [OfflineInsiderEnroll](https://github.com/abbodi1406/offlineinsiderenroll) to subscribe to the channel you want
|
||||
_while on 10, use BETA for Windows 11 22000.x builds (release), DEV for Windows 11 225xx.x builds (experimental)_
|
||||
|
||||
Step 3: check for updates via Settings - Windows Update and select Upgrade to Windows 11
|
||||
|
||||
Already have a 11 ISO, USB or extracted Files and want to add a bypass
|
||||
----------------------------------------------------------------------
|
||||
Use [Quick_11_iso_esd_wim_TPM_toggle.bat](Quick_11_iso_esd_wim_TPM_toggle.bat) from the confort of right-click - SendTo menu
|
||||
|
||||
Switches installation type to Server skipping install checks, or back to Client if run again on the same file, restoring hash!
|
||||
**directly** on any downloaded windows 11 iso or extracted esd and wim, so there's no iso / dism mounting
|
||||
_defiantly quick_
|
||||
|
||||
Works great with business / enterprise media since it comes with ei.cfg so setup won't ask for product key at start
|
||||
for consumer / core media you can add a generic `EI.cfg` to the media\sources yourself with this content:
|
||||
`[Channel]`
|
||||
`_Default`
|
||||
|
||||
> if setup still asks for product key, input retail or gvlk keys found in media\sources\product.ini
|
||||
> _gvlkprofessional=W269N-WFGWX-YVC9B-4J6C9-T83GX gvlkcore=TX9XD-98N7V-6WMQ6-BX7FG-H8Q99_
|
||||
> _gvlkenterprise=NPPR9-FWDCX-D2C8J-H872K-2YT43 gvlkeducation=NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 etc._
|
||||
|
||||
i: [Skip_TPM_Check_on_Dynamic_Update.cmd](Skip_TPM_Check_on_Dynamic_Update.cmd) acts globally and **skips setup.exe upgrade checks as well**
|
||||
_regardless of mounted iso / usb media already having a bypass added or not_
|
||||
|
||||
Offline local account on 11 Home / Pro
|
||||
--------------------------------------
|
||||
[MediaCreationTool.bat](../MediaCreationTool.bat) creates media that re-enables the *I dont have internet* OOBE choice (OOBE\BypassNRO)
|
||||
It does so via [AutoUnattend.xml](AutoUnattend.xml), inserted into `boot.wim` to not cause setup.exe issues under windows
|
||||
More conveniently can be placed at the root of 11 media, along with [auto.cmd](auto.cmd) to use for upgrades
|
||||
Should work with any 11 Release (22000.x) or Dev (22xxx.x) media - and it hides unsupported PC nags as a bonus ;)
|
||||
_If you have already connected at OOBE, can try email: `a` or `test@test.com` password: `a` or `test` to switch to local account_
|
||||
|
||||
If having update issues - on any windows version
|
||||
------------------------------------------------
|
||||
Use [windows_update_refresh.bat](bypass11/windows_update_refresh.bat)
|
||||
Use [windows_update_refresh.bat](windows_update_refresh.bat)
|
||||
_AveYo: as a bonus, it hides unsupported PC nags_
|
||||
|
||||
@@ -12,17 +12,18 @@ $_Paste_in_Powershell = {
|
||||
kill -name $_ -force -ea 0
|
||||
}
|
||||
cmd /c rd /s /q "%SystemDrive%\`$WINDOWS.~BT\Sources\Panther"
|
||||
cmd /c rd /s /q "%SystemRoot%\system32\catroot2"
|
||||
cmd /c rd /s /q "%SystemRoot%\system32\catroot2" # because kill $svc.PID ;)
|
||||
cmd /c rd /s /q "%SystemRoot%\SoftwareDistribution"
|
||||
cmd /c del /f /q "%SystemRoot%\Logs\WindowsUpdate\*"
|
||||
cmd /c del /f /q "%ProgramData%\USOPrivate\UpdateStore\*"
|
||||
cmd /c del /f /q "%ProgramData%\USOPrivate\UpdateStore\*" # clearing USO suggested by abbodi1406 @ MDL
|
||||
cmd /c del /s /f /q "%ProgramData%\USOShared\Logs\*"
|
||||
cmd /c rd /s /q "%ProgramFiles%\UNP"
|
||||
try { Get-WindowsUpdateLog -LogPath $env:temp\temp.log -ForceFlush -Confirm:$False -ea 0 } catch {}
|
||||
<# AveYo: comment 3 lines below to NOT hide 11 unsupported/upgrade nag - 25H1 is NOT a typo #>
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /d 0 /t reg_dword /f
|
||||
<# AveYo: comment reg lines below to NOT hide 11 unsupported/upgrade nag #>
|
||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "TargetReleaseVersionInfo" /d 25H1 /f # 25H1 NOT a typo ;)
|
||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "TargetReleaseVersion" /d 1 /t reg_dword /f
|
||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "TargetReleaseVersionInfo" /d 25H1 /f
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /d 0 /t reg_dword /f # hide desktop watermark
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /d 0 /t reg_dword /f # suggested by awuctl @ MDL
|
||||
net1 start wuauserv; net1 start bits; net1 start usosvc
|
||||
UsoClient RefreshSettings
|
||||
sleep 5
|
||||
|
||||
Reference in New Issue
Block a user