Skip to content

Commit 02b9816

Browse files
committed
Update structure to work with new Insider Channels
1 parent e47e6b9 commit 02b9816

1 file changed

Lines changed: 129 additions & 123 deletions

File tree

OfflineInsiderEnroll.cmd

Lines changed: 129 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,129 @@
1-
@echo off
2-
3-
::Borrowed from @abbodi1406's scripts
4-
for /f "tokens=6 delims=[]. " %%i in ('ver') do set build=%%i
5-
6-
if %build% LSS 17763 (
7-
echo =============================================================
8-
echo This script is compatible only with Windows 10 RS5 and later.
9-
echo =============================================================
10-
echo.
11-
pause
12-
goto :EOF
13-
)
14-
15-
REG QUERY HKU\S-1-5-19\Environment >NUL 2>&1
16-
IF %ERRORLEVEL% EQU 0 goto :START_SCRIPT
17-
18-
echo =====================================================
19-
echo This script needs to be executed as an administrator.
20-
echo =====================================================
21-
echo.
22-
pause
23-
goto :EOF
24-
25-
:START_SCRIPT
26-
set "scriptver=1.1.0"
27-
set "FlightSigningEnabled=0"
28-
bcdedit /enum {current} | findstr /I /R /C:"^flightsigning *Yes$" >NUL 2>&1
29-
IF %ERRORLEVEL% EQU 0 set "FlightSigningEnabled=1"
30-
31-
:CHOICE_MENU
32-
cls
33-
set "choice="
34-
echo OfflineInsiderEnroll v%scriptver%
35-
echo.
36-
echo R - Enroll to Release Preview ring
37-
echo S - Enroll to Insider Slow ring
38-
echo F - Enroll to Insider Fast ring
39-
echo.
40-
echo X - Stop receiving Insider Preview builds
41-
echo Q - Quit without making any changes
42-
echo.
43-
set /p choice="Choice: "
44-
echo.
45-
if /I "[%choice%]"=="[r]" goto :ENROLL_RP
46-
if /I "[%choice%]"=="[s]" goto :ENROLL_SLOW
47-
if /I "[%choice%]"=="[f]" goto :ENROLL_FAST
48-
if /I "[%choice%]"=="[x]" goto :STOP_INSIDER
49-
if /I "[%choice%]"=="[q]" goto :EOF
50-
goto :CHOICE_MENU
51-
52-
:ENROLL_RP
53-
set "SLS=RingPreview"
54-
set "Ring=RP"
55-
set "Content=Current"
56-
set "FancyRing=Release Preview"
57-
goto :ENROLL
58-
59-
:ENROLL_SLOW
60-
set "SLS=RingInsiderSlow"
61-
set "Ring=WIS"
62-
set "Content=Active"
63-
set "FancyRing=Windows Insider Slow"
64-
goto :ENROLL
65-
66-
:ENROLL_FAST
67-
set "SLS=RingInsiderFast"
68-
set "Ring=WIF"
69-
set "Content=Active"
70-
set "FancyRing=Windows Insider Fast"
71-
goto :ENROLL
72-
73-
:RESET_INSIDER_CONFIG
74-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost" /f >NUL 2>&1
75-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\WUMUDCat" /f >NUL 2>&1
76-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingPreview" /f >NUL 2>&1
77-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingInsiderSlow" /f >NUL 2>&1
78-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingInsiderFast" /f >NUL 2>&1
79-
goto :EOF
80-
81-
:ENROLL
82-
echo Applying changes...
83-
call :RESET_INSIDER_CONFIG
84-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator" /t REG_DWORD /v EnableUUPScan /d 1 /f >NUL 2>&1
85-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\%SLS%" /t REG_DWORD /v Enabled /d 1 /f >NUL 2>&1
86-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\WUMUDCat" /t REG_DWORD /v WUMUDCATEnabled /d 1 /f >NUL 2>&1
87-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v EnablePreviewBuilds /d 1 /f >NUL 2>&1
88-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v IsBuildFlightingEnabled /d 1 /f >NUL 2>&1
89-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v TestFlags /d 32 /f >NUL 2>&1
90-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v ContentType /d "%Content%" /f >NUL 2>&1
91-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v BranchName /d "external" /f >NUL 2>&1
92-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v Ring /d "%Ring%" /f >NUL 2>&1
93-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Strings" /t REG_SZ /v StickyXaml /d "<StackPanel xmlns="^""http://schemas.microsoft.com/winfx/2006/xaml/presentation"^""><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"">This device has been enrolled to the Windows Insider program using OfflineInsiderEnroll v%scriptver%. If you want to change settings of the enrollment or stop receiving Insider Preview builds, please use the script. <Hyperlink NavigateUri="^""https://github.com/whatever127/offlineinsiderenroll/blob/master/readme.md"^"" TextDecorations="^""None"^"">Learn more</Hyperlink></TextBlock><TextBlock Text="^""Applied configuration"^"" Margin="^""0,20,0,10"^"" Style="^""{StaticResource SubtitleTextBlockStyle}"^"" /><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"" Margin="^""0,0,0,5"^""><Run FontFamily="^""Segoe MDL2 Assets"^"">&#xECA7;</Run> <Span FontWeight="^""SemiBold"^"">%FancyRing%</Span></TextBlock><TextBlock Text="^""Ring: %Ring%"^"" Style="^""{StaticResource BodyTextBlockStyle }"^"" /><TextBlock Text="^""Content: %Content%"^"" Style="^""{StaticResource BodyTextBlockStyle }"^"" /><TextBlock Text="^""Telemetry settings notice"^"" Margin="^""0,20,0,10"^"" Style="^""{StaticResource SubtitleTextBlockStyle}"^"" /><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"">Windows Insider Program requires your diagnostic data collection settings to be set to <Span FontWeight="^""SemiBold"^"">Full</Span>. You can verify or modify your current settings in <Span FontWeight="^""SemiBold"^"">Diagnostics &amp; feedback</Span>.</TextBlock><Button Command="^""{StaticResource ActivateUriCommand}"^"" CommandParameter="^""ms-settings:privacy-feedback"^"" Margin="^""0,10,0,0"^""><TextBlock Margin="^""5,0,5,0"^"">Open Diagnostics &amp; feedback</TextBlock></Button></StackPanel>" /f >NUL 2>&1
94-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIHiddenElements /d 65535 /f >NUL 2>&1
95-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIDisabledElements /d 65535 /f >NUL 2>&1
96-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIServiceDrivenElementVisibility /d 0 /f >NUL 2>&1
97-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIErrorMessageVisibility /d 192 /f >NUL 2>&1
98-
99-
bcdedit /set {current} flightsigning yes >NUL 2>&1
100-
echo Done.
101-
102-
echo.
103-
IF %FlightSigningEnabled% NEQ 1 goto :ASK_FOR_REBOOT
104-
pause
105-
goto :EOF
106-
107-
:STOP_INSIDER
108-
echo Applying changes...
109-
call :RESET_INSIDER_CONFIG
110-
bcdedit /deletevalue {current} flightsigning >NUL 2>&1
111-
echo Done.
112-
113-
echo.
114-
IF %FlightSigningEnabled% NEQ 0 goto :ASK_FOR_REBOOT
115-
pause
116-
goto :EOF
117-
118-
:ASK_FOR_REBOOT
119-
set "choice="
120-
echo A reboot is required to finish applying changes.
121-
set /p choice="Would you like to reboot your PC? (y/N) "
122-
if /I "[%choice%]"=="[y]" shutdown -r -t 0
123-
goto :EOF
1+
@echo off
2+
3+
::Borrowed from @abbodi1406's scripts
4+
for /f "tokens=6 delims=[]. " %%i in ('ver') do set build=%%i
5+
6+
if %build% LSS 17763 (
7+
echo =============================================================
8+
echo This script is compatible only with Windows 10 RS5 and later.
9+
echo =============================================================
10+
echo.
11+
pause
12+
goto :EOF
13+
)
14+
15+
REG QUERY HKU\S-1-5-19\Environment >NUL 2>&1
16+
IF %ERRORLEVEL% EQU 0 goto :START_SCRIPT
17+
18+
echo =====================================================
19+
echo This script needs to be executed as an administrator.
20+
echo =====================================================
21+
echo.
22+
pause
23+
goto :EOF
24+
25+
:START_SCRIPT
26+
set "scriptver=2.0.0"
27+
set "FlightSigningEnabled=0"
28+
bcdedit /enum {current} | findstr /I /R /C:"^flightsigning *Yes$" >NUL 2>&1
29+
IF %ERRORLEVEL% EQU 0 set "FlightSigningEnabled=1"
30+
31+
:CHOICE_MENU
32+
cls
33+
set "choice="
34+
echo OfflineInsiderEnroll v%scriptver%
35+
echo.
36+
echo 1 - Enroll to Dev Channel
37+
echo 2 - Enroll to Beta Channel
38+
echo 3 - Enroll to Release Preview Channel
39+
echo.
40+
echo 4 - Stop receiving Insider Preview builds
41+
echo 5 - Quit without making any changes
42+
echo.
43+
set /p choice="Choice: "
44+
echo.
45+
if /I "%choice%"=="1" goto :ENROLL_DEV
46+
if /I "%choice%"=="2" goto :ENROLL_BETA
47+
if /I "%choice%"=="3" goto :ENROLL_RP
48+
if /I "%choice%"=="4" goto :STOP_INSIDER
49+
if /I "%choice%"=="5" goto :EOF
50+
goto :CHOICE_MENU
51+
52+
:ENROLL_RP
53+
set "Channel=ReleasePreview"
54+
set "Fancy=Release Preview Channel"
55+
goto :ENROLL
56+
57+
:ENROLL_BETA
58+
set "Channel=Beta"
59+
set "Fancy=Beta Channel"
60+
goto :ENROLL
61+
62+
:ENROLL_DEV
63+
set "Channel=Dev"
64+
set "Fancy=Dev Channel"
65+
goto :ENROLL
66+
67+
:RESET_INSIDER_CONFIG
68+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Account" /f
69+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /f
70+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Cache" /f
71+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI" /f
72+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\WUMUDCat" /f
73+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingExternal" /f
74+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingPreview" /f
75+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingInsiderSlow" /f
76+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingInsiderFast" /f
77+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v AllowTelemetry /f
78+
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /f
79+
goto :EOF
80+
81+
:ADD_INSIDER_CONFIG
82+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator" /t REG_DWORD /v EnableUUPScan /d 1 /f
83+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\RingExternal" /t REG_DWORD /v Enabled /d 1 /f
84+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SLS\Programs\WUMUDCat" /t REG_DWORD /v WUMUDCATEnabled /d 1 /f
85+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v EnablePreviewBuilds /d 1 /f
86+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v IsBuildFlightingEnabled /d 1 /f
87+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v IsConfigSettingsFlightingEnabled /d 1 /f
88+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v TestFlags /d 32 /f
89+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_DWORD /v RingId /d 11 /f
90+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v Ring /d "External" /f
91+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v ContentType /d "Mainline" /f
92+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /t REG_SZ /v BranchName /d "%Channel%" /f
93+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Strings" /t REG_SZ /v StickyXaml /d "<StackPanel xmlns="^""http://schemas.microsoft.com/winfx/2006/xaml/presentation"^""><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"">This device has been enrolled to the Windows Insider program using OfflineInsiderEnroll v%scriptver%. If you want to change settings of the enrollment or stop receiving Insider Preview builds, please use the script. <Hyperlink NavigateUri="^""https://github.com/whatever127/offlineinsiderenroll/blob/master/readme.md"^"" TextDecorations="^""None"^"">Learn more</Hyperlink></TextBlock><TextBlock Text="^""Applied configuration"^"" Margin="^""0,20,0,10"^"" Style="^""{StaticResource SubtitleTextBlockStyle}"^"" /><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"" Margin="^""0,0,0,5"^""><Run FontFamily="^""Segoe MDL2 Assets"^"">&#xECA7;</Run> <Span FontWeight="^""SemiBold"^"">%Fancy%</Span></TextBlock><TextBlock Text="^""Channel: %Channel%"^"" Style="^""{StaticResource BodyTextBlockStyle }"^"" /><TextBlock Text="^""Content: Mainline"^"" Style="^""{StaticResource BodyTextBlockStyle }"^"" /><TextBlock Text="^""Telemetry settings notice"^"" Margin="^""0,20,0,10"^"" Style="^""{StaticResource SubtitleTextBlockStyle}"^"" /><TextBlock Style="^""{StaticResource BodyTextBlockStyle }"^"">Windows Insider Program requires your diagnostic data collection settings to be set to <Span FontWeight="^""SemiBold"^"">Full</Span>. You can verify or modify your current settings in <Span FontWeight="^""SemiBold"^"">Diagnostics &amp; feedback</Span>.</TextBlock><Button Command="^""{StaticResource ActivateUriCommand}"^"" CommandParameter="^""ms-settings:privacy-feedback"^"" Margin="^""0,10,0,0"^""><TextBlock Margin="^""5,0,5,0"^"">Open Diagnostics &amp; feedback</TextBlock></Button></StackPanel>" /f
94+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIHiddenElements /d 65535 /f
95+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIDisabledElements /d 65535 /f
96+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIServiceDrivenElementVisibility /d 0 /f
97+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /t REG_DWORD /v UIErrorMessageVisibility /d 192 /f
98+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /t REG_DWORD /v AllowTelemetry /d 3 /f
99+
goto :EOF
100+
101+
:ENROLL
102+
echo Applying changes...
103+
call :RESET_INSIDER_CONFIG 1>NUL 2>NUL
104+
call :ADD_INSIDER_CONFIG 1>NUL 2>NUL
105+
bcdedit /set {current} flightsigning yes >NUL 2>&1
106+
echo Done.
107+
108+
echo.
109+
IF %FlightSigningEnabled% NEQ 1 goto :ASK_FOR_REBOOT
110+
pause
111+
goto :EOF
112+
113+
:STOP_INSIDER
114+
echo Applying changes...
115+
call :RESET_INSIDER_CONFIG 1>NUL 2>NUL
116+
bcdedit /deletevalue {current} flightsigning >NUL 2>&1
117+
echo Done.
118+
119+
echo.
120+
IF %FlightSigningEnabled% NEQ 0 goto :ASK_FOR_REBOOT
121+
pause
122+
goto :EOF
123+
124+
:ASK_FOR_REBOOT
125+
set "choice="
126+
echo A reboot is required to finish applying changes.
127+
set /p choice="Would you like to reboot your PC? (y/N) "
128+
if /I "%choice%"=="y" shutdown -r -t 0
129+
goto :EOF

0 commit comments

Comments
 (0)