From 1fb65d4f9c6213154072a356d75a130d2acc005e Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 21 Jul 2025 14:10:52 +0530 Subject: [PATCH] Fix an issue in add/remove apps when more than one lang is installed --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 37 ++++++++++++++----- .../Change_Office_Edition.cmd | 37 ++++++++++++++----- 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 0ed6507..ffb802a 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -18772,7 +18772,9 @@ goto :oe_goback :: OfficeClickToRun.exe with productstoadd method is used here to add editions :: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet -set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +call :oe_getlangs + +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_allLangs% cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" if %change%==1 ( set "c2rcommand=!c2rcommand! productstoremove=AllProducts" @@ -18949,13 +18951,8 @@ if %verified%==0 goto :oe_removeedition cls if not defined terminal mode 105, 32 -set _lang= -echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) -for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%targetedition%.16" /f "-" /k ^| findstr /i ".*16\\.*-.*"') do ( -if defined _lang (set "_lang=!_lang!_%%a") else (set "_lang=_%%a") -) - -set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16%_lang%" +call :oe_getlangs %targetedition% +set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16_%_allLangs%" echo: echo Running the below command, please wait... @@ -19138,7 +19135,8 @@ goto :oe_goback set buildchk=0 for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a" -set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +call :oe_getlangs %_firstoId% +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_allLangs% cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" if %clverchk% LSS %buildchk% ( @@ -19320,6 +19318,27 @@ exit /b ::======================================================================================================================================== +:: Check all the installed languages + +:oe_getlangs + +if "%1"=="" ( +set langreg=culture +) else ( +set langreg=%1.16 +) + +set _allLangs= +echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) +for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%langreg%" /f "-" /k ^| findstr /i "%langreg%\\.*-.*"') do ( +if defined _allLangs (set "_allLangs=!_allLangs!_%%a") else (set "_allLangs=%%a") +) + +set _allLangs=%_allLangs:.16=% +exit /b + +::======================================================================================================================================== + :: Check Internet connection :oe_chkinternet diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 88fc54f..a442896 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -794,7 +794,9 @@ goto :oe_goback :: OfficeClickToRun.exe with productstoadd method is used here to add editions :: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet -set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +call :oe_getlangs + +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_allLangs% cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" if %change%==1 ( set "c2rcommand=!c2rcommand! productstoremove=AllProducts" @@ -971,13 +973,8 @@ if %verified%==0 goto :oe_removeedition cls if not defined terminal mode 105, 32 -set _lang= -echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) -for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%targetedition%.16" /f "-" /k ^| findstr /i ".*16\\.*-.*"') do ( -if defined _lang (set "_lang=!_lang!_%%a") else (set "_lang=_%%a") -) - -set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16%_lang%" +call :oe_getlangs %targetedition% +set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16_%_allLangs%" echo: echo Running the below command, please wait... @@ -1160,7 +1157,8 @@ goto :oe_goback set buildchk=0 for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a" -set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +call :oe_getlangs %_firstoId% +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_allLangs% cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" if %clverchk% LSS %buildchk% ( @@ -1342,6 +1340,27 @@ exit /b ::======================================================================================================================================== +:: Check all the installed languages + +:oe_getlangs + +if "%1"=="" ( +set langreg=culture +) else ( +set langreg=%1.16 +) + +set _allLangs= +echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) +for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%langreg%" /f "-" /k ^| findstr /i "%langreg%\\.*-.*"') do ( +if defined _allLangs (set "_allLangs=!_allLangs!_%%a") else (set "_allLangs=%%a") +) + +set _allLangs=%_allLangs:.16=% +exit /b + +::======================================================================================================================================== + :: Check Internet connection :oe_chkinternet