From 85d1e27cf2237c2c1a3c83c7bea8dc622096eb56 Mon Sep 17 00:00:00 2001 From: nondetect Date: Sat, 2 Oct 2021 22:19:27 +0200 Subject: [PATCH] 2.8.0 --- OfflineInsiderEnroll.cmd | 179 ++++++++++++++++++++++++++------------- 1 file changed, 119 insertions(+), 60 deletions(-) diff --git a/OfflineInsiderEnroll.cmd b/OfflineInsiderEnroll.cmd index 34c7544..64fa8d7 100644 --- a/OfflineInsiderEnroll.cmd +++ b/OfflineInsiderEnroll.cmd @@ -1,17 +1,14 @@ @echo off -set "scriptver=2.7.4" +set "scriptver=2.8.0" chcp 866 -for /f "tokens=3" %%b in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "BuildBranch"') do set br=%%b -set "locale=ru" -for /f "tokens=3 delims=;:- " %%l in ('systeminfo ^| findstr /b /c:"System Locale:"') do set lang=%%l -for /f "tokens=3 delims=;:- " %%l in ('systeminfo ^| findstr /b /c:"Язык системы:"') do set lang=%%l -if /I %lang%==%locale% ( goto :RU_LOCALE ) else ( goto :EN_LOCALE ) +for /f "tokens=1 delims=-" %%l in ('powershell -c "(get-uiculture).name"') do set "lang=%%l" +if /I "%lang%"=="ru" ( goto :RU_LOCALE ) else ( goto :EN_LOCALE ) :CHECK_BUILD -for /f "tokens=4 delims=[] " %%i in ('ver') do set build=%%i -if %build:~5,5% LSS 17763 ( +for /f "tokens=4-5 delims=[]." %%a in ('ver') do set "build=%%a.%%b" +if %build:~0,5% LSS 17763 ( echo ============================================================= - echo %chbuild1% %build:~5%. %chbuild2% + echo %chbuild% echo ============================================================= echo. pause @@ -36,34 +33,36 @@ cls set "WSH=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost" set "cver=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" set "wdat=HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows" -set "choice=" -echo OfflineInsiderEnroll v%scriptver% +echo ============================================================ +echo * OfflineInsiderEnroll v%scriptver% by nondetect aka aleks242007 * +echo * Special thank's abbodi1406 ^& AveYo * +echo ============================================================ echo. -echo 1 - %m1% Dev Channel -echo 2 - %m1% Beta Channel -echo 3 - %m1% Release Preview Channel +echo 1 - %m1% Dev Channel +echo 2 - %m1% Beta Channel +echo 3 - %m1% Release Preview Channel echo. -echo 4 - %m2% -echo 5 - %m3% +echo 4 - %m3% +echo 5 - %m4% echo. -choice /C:12345 /N /M "%mch% [1,2,3,4,5] : " +choice /C:12345 /N /M " %mch% [1,2,3,4,5] : " if errorlevel 5 goto:EOF if errorlevel 4 goto:STOP_INSIDER if errorlevel 3 goto:ENROLL_RP if errorlevel 2 goto:ENROLL_BETA if errorlevel 1 goto:ENROLL_DEV -:ENROLL_RP -set "Channel=ReleasePreview" -set "Fancy=Release Preview Channel" -set "BRL=8" +:ENROLL_DEV +set "Channel=Dev" +set "Fancy=Dev Channel" +set "BRL=2" set "Content=Mainline" set "Ring=External" set "RID=11" -set "actived=false" +set "actived=true" set "activeb=false" -set "activerp=true" -goto :ENROLL +set "activerp=false" +goto :CHECK_CHOICE :ENROLL_BETA set "Channel=Beta" @@ -75,19 +74,28 @@ set "RID=11" set "actived=false" set "activeb=true" set "activerp=false" -goto :ENROLL +goto :CHECK_CHOICE -:ENROLL_DEV -set "Channel=Dev" -set "Fancy=Dev Channel" -set "BRL=2" +:ENROLL_RP +set "Channel=ReleasePreview" +set "Fancy=Release Preview Channel" +set "BRL=8" set "Content=Mainline" set "Ring=External" set "RID=11" -set "actived=true" +set "actived=false" set "activeb=false" -set "activerp=false" -goto :ENROLL +set "activerp=true" +goto :CHECK_CHOICE + +:CHECK_CHOICE +echo. +echo %m2% +echo. +choice /C:12 /N /M "%mch% [1,2] : " +if errorlevel 2 goto:ENROLL +if errorlevel 1 goto:ENROLL_SKIP_CHECK + :RESET_INSIDER_CONFIG reg delete "%WSH%\Account" /f @@ -101,8 +109,8 @@ reg delete "%cver%\WindowsUpdate\SLS\Programs\RingPreview" /f reg delete "%cver%\WindowsUpdate\SLS\Programs\RingInsiderSlow" /f reg delete "%cver%\WindowsUpdate\SLS\Programs\RingInsiderFast" /f reg delete "%cver%\Policies\DataCollection" /f /v AllowTelemetry -reg delete "%cver%\DataCollection" /f /v AllowTelemetry -reg delete "%cver%\WindowsUpdate" /f /v BranchReadinessLevel +reg delete "%cdat%\DataCollection" /f /v AllowTelemetry +reg delete "%cdat%\WindowsUpdate" /f /v BranchReadinessLevel goto :EOF :ADD_INSIDER_CONFIG @@ -110,7 +118,7 @@ reg add "%cver%\WindowsUpdate\Orchestrator" /f /t REG_DWORD /v EnableUUPScan /d reg add "%cver%\WindowsUpdate\SLS\Programs\Ring%Ring%" /f /t REG_DWORD /v Enabled /d 1 reg add "%cver%\WindowsUpdate\SLS\Programs\WUMUDCat" /f /t REG_DWORD /v WUMUDCATEnabled /d 1 reg add "%cver%\Policies\DataCollection" /f /t REG_DWORD /v AllowTelemetry /d 3 -if defined BRL reg add "%cver%\WindowsUpdate" /f /t REG_DWORD /v BranchReadinessLevel /d %BRL% +if defined BRL reg add "%cdat%\WindowsUpdate" /f /t REG_DWORD /v BranchReadinessLevel /d %BRL% reg add "%WSH%\Applicability" /f /t REG_DWORD /v EnablePreviewBuilds /d 2 reg add "%WSH%\Applicability" /f /t REG_DWORD /v IsBuildFlightingEnabled /d 1 reg add "%WSH%\Applicability" /f /t REG_DWORD /v IsConfigSettingsFlightingEnabled /d 1 @@ -123,33 +131,77 @@ reg add "%WSH%\Applicability" /f /t REG_SZ /v BranchName /d "%Channel%" reg add "%WSH%\UI\Selection" /f /t REG_SZ /v UIRing /d "%Ring%" reg add "%WSH%\UI\Selection" /f /t REG_SZ /v UIContentType /d "%Content%" reg add "%WSH%\UI\Selection" /f /t REG_SZ /v UIBranch /d "%Channel%" -reg add "%WSH%\UI\Visibility" /f /t REG_DWORD /v UIHiddenElements_Rejuv /d 65508 reg add "%WSH%\UI\Visibility" /f /t REG_DWORD /v UIDisabledElements_Rejuv /d 65517 +reg add "%WSH%\UI\Visibility" /f /t REG_DWORD /v UIHiddenElements_Rejuv /d 65508 +reg add "%WSH%\UI\Visibility" /f /t REG_DWORD /v UIErrorMessageVisibility /d 192 reg add "%WSH%\Cache" /f /t REG_SZ /v "ConfigurationOptionList" /d "{\"ConfigurationOptionList\":[{\"Name\":\"Dev\",\"Alias\":\"Dev Channel\",\"Description\":\"%cdevdesc%\",\"ContentType\":\"Mainline\",\"Branch\":\"Dev\",\"Ring\":\"External\",\"IsRecommended\":false,\"RecommendedOnly\":false,\"IsValid\":%actived%,\"Title\":\"Dev\",\"Warning\":\"%cdevwar%\"},{\"Name\":\"Beta\",\"Alias\":\"Beta Channel (Recommended)\",\"Description\":\"%cbetadesc%\",\"ContentType\":\"Mainline\",\"Branch\":\"Beta\",\"Ring\":\"External\",\"IsRecommended\":true,\"RecommendedOnly\":false,\"IsValid\":%activeb%,\"Title\":\"Beta\",\"Warning\":\"\"},{\"Name\":\"ReleasePreview\",\"Alias\":\"Release Preview Channel\",\"Description\":\"%crpdesk%\",\"ContentType\":\"Mainline\",\"Branch\":\"ReleasePreview\",\"Ring\":\"External\",\"IsRecommended\":false,\"RecommendedOnly\":false,\"IsValid\":%activerp%,\"Title\":\"Release Preview\",\"Warning\":\"\"}]}" reg add "%WSH%\UI\Strings" /f /t REG_SZ /v "AccountText" /d "{\"Description\":\"%acdesc%\",\"Title\":\"%actitle%\",\"ButtonTitle\":\"%acbutton%\"}" -reg add "%WSH%\UI\Strings" /f /t REG_SZ /v "DeviceStatusBarText" /d "{\"Subtitle\":\"%dsdesk% %build:~5% %br% \",\"LinkTitle\":\"%dsltitle%\",\"LinkUrl\":\"https://aka.ms/%Channel%Latest\",\"ButtonUrl\":\"feedback-hub://\",\"Status\":1,\"Title\":\"%dstitle%\",\"ButtonTitle\":\"%dsbutton%\"}" +reg add "%WSH%\UI\Strings" /f /t REG_SZ /v "DeviceStatusBarText" /d "{\"Subtitle\":\"%dsdesk%\",\"LinkTitle\":\"%dsltitle%\",\"LinkUrl\":\"https://aka.ms/%Channel%Latest\",\"ButtonUrl\":\"ms-settings:about\",\"Status\":1,\"Title\":\"%dstitle%\",\"ButtonTitle\":\"%dsbutton%\"}" reg add "%WSH%\UI\Strings" /f /t REG_SZ /v "ConfigurationExpanderText_Rejuv" /d "{\"Title\":\"%conftitle%\",\"RelatedLinkText\":\"%confrlink%\",\"RelatedLinkUrl\":\"https://github.com/nondetect/offlineinsiderenroll/releases\"}" reg add "%WSH%\UI\Strings" /f /t REG_SZ /v "UnenrollText_Rejuv" /d "{\"Status\":\"\",\"ToggleTitle\":\"%unrtogtitle%\",\"ToggleDescription\":\"%unrtogdesk%\",\"LinkTitle\":\"%unrlinktitle%\",\"LinkDescription\":\"%unrlinkdesk%\",\"LinkUrl\":\"https://go.microsoft.com/fwlink/?linkid=2136438\",\"Title\":\"%unrtitle%\",\"RelatedLinkText\":\"%unrreltext%\",\"RelatedLinkUrl\":\"https://insider.windows.com/leave-program\"}" -if %build:~5,5% LSS 21990 reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Strings" /f /t REG_SZ /v StickyXaml /d "%mdesc% v%scriptver%. %mnottitle%%mnotdesk1% %mnotdesk2%%mnotdesk3% %mnotdesk4%." +reg add "%WSH%\UI\Strings" /f /t REG_SZ /v StickyXaml /d "%mdesc% v%scriptver%. %confrlink%. %lm% %aco%%Fancy% %mnottitle%%mnotdesk1% %mnotdesk2%%mnotdesk3% %mnotdesk4%." chcp 1251 >nul -if %build:~5,5% LSS 21990 goto :EOF ( echo Windows Registry Editor Version 5.00 echo. echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Strings] -echo "StickyMessage"="{\"Message\":\"%mtitle%\",\"LinkTitle\":\"\",\"LinkUrl\":\"\",\"DynamicXaml\":\"^^%mdesc% v%scriptver%.^^^^^ ^%mnottitle%^^^%mnotdesk1% ^%mnotdesk2%^%mnotdesk3% ^%mnotdesk4%^.^^