|
1 | 1 | @(set "0=%~f0"^)#) & powershell -nop -c iex([io.file]::ReadAllText($env:0)) & exit/b |
2 | 2 | #:: double-click to run or just copy-paste into powershell - it's a standalone hybrid script |
3 | | -#:: |
4 | | -#:: v6f dynamically skips the anti-consumer windows 11 setup checks via /Product Server trick |
| 3 | + |
| 4 | +#:: v7 dynamically skips the anti-consumer windows 11 setup checks via /Product Server trick |
5 | 5 | #:: it is most reliable, and only has a 'Windows Server' label cosmetic-ish difference |
6 | 6 | #:: works with: |
7 | 7 | #:: 11 setup via Windows Update (after using OfflineInsiderEnroll by whatever127 and abbodi1406) |
8 | 8 | #:: 11 setup via mounted iso / usb (use the Quick.. script for skipping 11 setup checks at boot) |
9 | | -#:: |
| 9 | + |
10 | 10 | $_Paste_in_Powershell = { $Code = @' |
11 | | -$Nfo = 'Skip TPM Check on Dynamic Update v6f, AveYo 2021' |
12 | | -$Arg = (([environment]::get_CommandLine()-split'-[-]% ')[1]-split'.exe[\p{P}]? ')[1] |
13 | | -foreach ($x in 'Product','DynamicUpdate','Telemetry') {$Arg = $Arg-replace$('\p{P}?/' + $x + '\p{P}? \p{P}?[A-Z]+\p{P}? '),' '} |
14 | | -$Cli = ' /DynamicUpdate Disable /Telemetry Disable ' + $Arg; $Srv = ' /Product Server' + $Cli |
15 | | -$Dir = join-path $([Environment]::SystemDirectory[0..2]-join'') '$WINDOWS.~BT\Sources\' |
16 | | -$Cfg = join-path $Dir 'EI.cfg'; $EI = '[Channel]' +[char]13+[char]10+ '_Default' +[char]13+[char]10 |
17 | | -$Exe = join-path $Dir 'SetupHost.exe'; $Inf = get-item -force -lit $Exe; [int]$Ver = $Inf.VersionInfo.FileBuildPart |
18 | | -if ($Ver -ge 22000) {$Run = $Exe + $Srv} else {$Run = $Exe + $Cli} |
19 | | -if ($Ver -ge 22000 -and !(test-path $Cfg)) {[io.file]::WriteAllText($Cfg, $EI)} |
20 | | -$D=@(); $T=@(); $A=@(); $M=[AppDomain]::CurrentDomain.DefineDynamicAssembly(1,1).DefineDynamicModule(1) |
21 | | -foreach ($x in 0..2) {$D+=$M.DefineType('AveYo_'+$x,1179913,[ValueType])}; foreach ($x in 1..2) {$D+=$D[$x].MakeByRefType()} |
22 | | -$S=[string]; $I=[int32]; $U=[uintptr]; $y=0; $z=0; foreach ($x in $U,$U,$I,$I) {$9=$D[2].DefineField('f'+$y++,$x,6)} |
23 | | -foreach ($x in $I,$S,$S,$S,$I,$I,$I,$I,$I,$I,$I,$I,[int16],[int16],$U,$U,$U,$U) {$9=$D[1].DefineField('f'+$z++,$x,6)} |
24 | | -$9=$D[0].DefinePInvokeMethod('CreateProcess','kernel32',8214,1,[void],($S,$S,$I,$I,[bool],$I,$I,$S,$D[3],$D[4]),1,4) |
25 | | -$9=$D[0].DefinePInvokeMethod('DebugActiveProcessStop','kernel32',8214,1,[void],($I),1,4) |
26 | | -foreach ($x in 0..2) {$T+=$D[$x].CreateType()}; foreach ($x in 1..2) {$A+=[Activator]::CreateInstance($T[$x])} |
27 | | -$R=$null, $Run, $null, $null, $false, 0x02000011, $null, $null, $A[0], $A[1] |
28 | | -$T[0].GetMethod('CreateProcess').invoke(0, $R); $T[0].GetMethod('DebugActiveProcessStop').invoke(0, $R[9].f2) |
29 | | -$W=get-process -pid $R[9].f2 -ea 0; for (;;) {sleep 1; if (0-eq $R[9].f2 -or $null-eq $W -or $W.HasExited) {return} } |
30 | | -'@ -replace '\r?\n|\r', '; ' <# lines 19-28 are needed for escaping ifeo, remain calm ;) #> |
31 | | -$IFEO = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SetupHost.exe' |
32 | | -$Prog = join-path $([Environment]::SystemDirectory[0..2] -join '') '$WINDOWS.~BT\Sources\SetupHost.exe' |
33 | | -$Skip = "powershell -win 1 -nop -c iex (get-itemproperty '$IFEO\0' 'Code' -ea 0).Code; write-host --%" |
34 | | -remove-item $($IFEO -replace 'SetupHost', 'vdsldr') -rec -force -ea 0 >''; rmdir (split-path $Prog) -rec -force -ea 0 >'' |
35 | | -if (test-path "$IFEO\0") { |
36 | | - remove-item $IFEO -rec -force -ea 0 >'' |
37 | | - write-host -fore 0xf -back 0xd "`n Skip TPM Check on Dynamic Update v6f [REMOVED] run again to install " |
38 | | -} else { |
39 | | - new-item "$IFEO\0" -force -ea 0 >'' |
40 | | - set-itemproperty "$IFEO\0" 'Debugger' $Skip -force -ea 0; set-itemproperty "$IFEO\0" 'Code' $Code -force -ea 0 |
41 | | - set-itemproperty "$IFEO\0" 'FilterFullPath' $Prog -force -ea 0; set-itemproperty $IFEO 'UseFilter' 1 -type dword -force -ea 0 |
42 | | - write-host -fore 0xf -back 0x2 "`n Skip TPM Check on Dynamic Update v6f [INSTALLED] run again to remove " } ; timeout /t 5 |
| 11 | + $Nfo = 'Skip TPM Check on Dynamic Update v7, AveYo 2021' |
| 12 | + $Arg = (([environment]::get_CommandLine()-split'-[-]% ')[1]-split'.exe[\p{P}]? ')[1] |
| 13 | + foreach ($x in 'Product','DynamicUpdate','Telemetry') {$Arg = $Arg -replace $('\p{P}?/'+ $x +'\p{P}? \p{P}?[A-Z]+\p{P}? '),' '} |
| 14 | + $Cli = ' /DynamicUpdate Disable /Telemetry Disable ' + $Arg; $Srv = ' /Product Server' + $Cli |
| 15 | + $Dir = join-path $([Environment]::SystemDirectory[0..2]-join'') '$WINDOWS.~BT\Sources\' |
| 16 | + $Cfg = join-path $Dir 'EI.cfg'; $EI = '[Channel]' +[char]13+[char]10+ '_Default' +[char]13+[char]10 |
| 17 | + $Exe = join-path $Dir 'SetupHost.exe'; $Inf = get-item -force -lit $Exe; [int]$Ver = $Inf.VersionInfo.FileBuildPart |
| 18 | + if ($Ver -ge 22000) {$Run = $Exe + $Srv} else {$Run = $Exe + $Cli} |
| 19 | + if ($Ver -ge 22000 -and !(test-path $Cfg)) {[io.file]::WriteAllText($Cfg, $EI)} |
| 20 | + |
| 21 | + $D=@(); $T=@(); $A=@(); $M=[AppDomain]::CurrentDomain.DefineDynamicAssembly(1,1).DefineDynamicModule(1) |
| 22 | + foreach ($x in 0..2) {$D+=$M.DefineType('AveYo_'+$x,1179913,[ValueType])}; foreach ($x in 1..2) {$D+=$D[$x].MakeByRefType()} |
| 23 | + $S=[string]; $I=[int32]; $U=[uintptr]; $y=0; $z=0; foreach ($x in $U,$U,$I,$I) {$9=$D[2].DefineField('f'+$y++,$x,6)} |
| 24 | + foreach ($x in $I,$S,$S,$S,$I,$I,$I,$I,$I,$I,$I,$I,[int16],[int16],$U,$U,$U,$U) {$9=$D[1].DefineField('f'+$z++,$x,6)} |
| 25 | + $9=$D[0].DefinePInvokeMethod('CreateProcess','kernel32',8214,1,[void],($S,$S,$I,$I,[bool],$I,$I,$S,$D[3],$D[4]),1,4) |
| 26 | + $9=$D[0].DefinePInvokeMethod('DebugActiveProcessStop','kernel32',8214,1,[void],($I),1,4) |
| 27 | + foreach ($x in 0..2) {$T+=$D[$x].CreateType()}; foreach ($x in 1..2) {$A+=[Activator]::CreateInstance($T[$x])} |
| 28 | + $R=$null, $Run, $null, $null, $false, 0x02000011, $null, $null, $A[0], $A[1] |
| 29 | + $T[0].GetMethod('CreateProcess').invoke(0, $R); $T[0].GetMethod('DebugActiveProcessStop').invoke(0, $R[9].f2) |
| 30 | + $W=get-process -pid $R[9].f2 -ea 0; for (;;) {sleep 1; if (0-eq $R[9].f2 -or $null-eq $W -or $W.HasExited) {return} } |
| 31 | +'@ -replace '\r?\n|\r', '; ' <# lines 20-29 are needed for escaping ifeo, remain calm ;) #> |
| 32 | + |
| 33 | + $IFEO = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SetupHost.exe' |
| 34 | + $Prog = join-path $([Environment]::SystemDirectory[0..2] -join '') '$WINDOWS.~BT\Sources\SetupHost.exe' |
| 35 | + $Skip = "powershell -win 1 -nop -c iex (get-itemproperty '$IFEO\0' 'Code' -ea 0).Code; write-host --%" |
| 36 | + if (test-path "$IFEO\0") { |
| 37 | + remove-item $IFEO -rec -force -ea 0 >'' |
| 38 | + write-host -fore 0xf -back 0xd "`n Skip TPM Check on Dynamic Update v7 [REMOVED] run again to install " |
| 39 | + } else { |
| 40 | + new-item "$IFEO\0" -force -ea 0 >'' |
| 41 | + set-itemproperty "$IFEO\0" 'Debugger' $Skip -force -ea 0; set-itemproperty "$IFEO\0" 'Code' $Code -force -ea 0 |
| 42 | + set-itemproperty "$IFEO\0" 'FilterFullPath' $Prog -force -ea 0; set-itemproperty $IFEO 'UseFilter' 1 -type dword -force -ea 0 |
| 43 | + write-host -fore 0xf -back 0x2 "`n Skip TPM Check on Dynamic Update v7 [INSTALLED] run again to remove " |
| 44 | + } |
| 45 | + remove-item $($IFEO -replace 'SetupHost', 'vdsldr') -rec -force -ea 0 >''; rmdir (split-path $Prog) -rec -force -ea 0 >'' |
| 46 | + $N = 'Skip TPM Check on Dynamic Update' <# also remove wmi-based v1 if somehow still installed, not just vdsldr-based v2 - v5 #> |
| 47 | + $U = 'root\subscription'; $C = gwmi -Class CommandLineEventConsumer -Namespace $U -Filter "Name='$N'" -ea 0 |
| 48 | + $B = gwmi -Class __FilterToConsumerBinding -Namespace $U -Filter "Filter = ""__eventfilter.name='$N'""" -ea 0 |
| 49 | + $F = gwmi -Class __EventFilter -NameSpace $U -Filter "Name='$N'" -ea 0; $B,$C,$F |% {$_|rwmi -ea 0}; timeout /t 5 |
43 | 50 | } ; start -verb runas powershell -args "-nop -c & {`n`n$($_Paste_in_Powershell-replace'"','\"')}" |
44 | 51 | $_Press_Enter |
45 | 52 | #:: |
0 commit comments