Browse Source

20191126

pull/4/head
abbodi1406 6 years ago
parent
commit
b209f8892b
  1. 14
      ActionListUUP/ActionListUUP.cmd
  2. 3
      WHD-W8.1UI/WHD-W81UI.cmd
  3. 46
      YAOCTRI/README.md
  4. 82
      YAOCTRI/Reference-C2RR_Config.ini
  5. 84
      YAOCTRI/Reference-C2R_Config.ini
  6. 187
      YAOCTRI/YAOCTRIR_Configurator.cmd
  7. 181
      YAOCTRI/YAOCTRIR_Installer.cmd
  8. 215
      YAOCTRI/YAOCTRI_Configurator.cmd
  9. 186
      YAOCTRI/YAOCTRI_Installer.cmd
  10. 214
      YAOCTRI/YAOCTRU_Generator.cmd
  11. 23
      esd-decrypter-wimlib/decrypt.cmd
  12. 2
      esd-decrypter-wimlib/multi_arch_iso.cmd
  13. 2
      uup-converter-wimlib/convert-UUP.cmd
  14. 2
      uup-converter-wimlib/create_virtual_editions.cmd
  15. 2
      uup-converter-wimlib/multi_arch_iso.cmd

14
ActionListUUP/ActionListUUP.cmd

@ -29,6 +29,7 @@ if exist "*%%#_*.esd" dir /b /a:-d "*%%#_*.esd">>uups_esd.txt 2>nul @@ -29,6 +29,7 @@ if exist "*%%#_*.esd" dir /b /a:-d "*%%#_*.esd">>uups_esd.txt 2>nul
)
for /f "tokens=3 delims=: " %%i in ('find /v /n /c "" uups_esd.txt') do set uups_esd_num=%%i
if %uups_esd_num% equ 0 (
del /f /q uups_esd.txt >nul 2>&1
echo.
echo ============================================================
echo ERROR: UUP Edition file is not detected
@ -42,6 +43,7 @@ for /L %%i in (1,1,%uups_esd_num%) do call :uups_esd %%i @@ -42,6 +43,7 @@ for /L %%i in (1,1,%uups_esd_num%) do call :uups_esd %%i
if exist "*.cab" for /f "delims=" %%i in ('dir /b /a:-d "*.cab"') do call :uups_ref "%%i"
if exist "*.esd" for /f "delims=" %%i in ('dir /b /a:-d "*.esd"') do call :uups_ref "%%i"
for /L %%i in (1,1,%uups_esd_num%) do call :uups_xml "!uups_esd_%%i!"
del /f /q uups_esd.txt >nul 2>&1
echo.
echo ============================================================
echo Finished
@ -98,16 +100,25 @@ echo ^<InstallFeature Id="ServicingStackUpdate" Group="Microsoft"/^> @@ -98,16 +100,25 @@ echo ^<InstallFeature Id="ServicingStackUpdate" Group="Microsoft"/^>
echo ^<InstallFeature Id="CumulativeUpdate" Group="Microsoft"/^>
echo ^</Plan^>
echo ^<Actions^>)>>"%ActionList%"
for /f %%a in ('dir /b /os Windows10.0-KB*.cab') do call :SSU %%a
for /f %%a in ('dir /b /os Windows10.0-KB*.cab') do call :Package %%a
(echo ^</Actions^>
echo ^</ActionList^>)>>"%ActionList%"
exit /b
:Package
:SSU
set "pack=%~1"
expand.exe -f:*_microsoft-windows-servicingstack_*.manifest %pack% .\ >nul 2>&1
if exist "*servicingstack_*.manifest" (
(echo ^<InstallPackage Keyform^="" InstalledSize^="0" StagedSize^="0" FilePath^="%pack%" Reason^="ServicingStackUpdate" FeatureId="ServicingStackUpdate" Partition^="MainOS" BinaryPartition^="false"/^>)>>"%ActionList%"
)
del /f /q *.manifest >nul 2>&1
exit /b
:Package
set "pack=%~1"
expand.exe -f:*_microsoft-windows-servicingstack_*.manifest %pack% .\ >nul 2>&1
if exist "*servicingstack_*.manifest" (
del /f /q *.manifest >nul 2>&1
exit /b
)
@ -125,7 +136,6 @@ findstr /i /m "Package_for_RollupFix" update.mum 1>nul 2>nul && ( @@ -125,7 +136,6 @@ findstr /i /m "Package_for_RollupFix" update.mum 1>nul 2>nul && (
(echo ^<InstallPackage Keyform^="" InstalledSize^="0" StagedSize^="0" FilePath^="%pack%" Reason^="CumulativeUpdate" FeatureId="CumulativeUpdate" Partition^="MainOS" BinaryPartition^="false"/^>)>>"%ActionList%"
)
del /f /q *.mum >nul 2>&1
del /f /q *.manifest >nul 2>&1
exit /b
:QUIT

3
WHD-W8.1UI/WHD-W81UI.cmd

@ -67,9 +67,6 @@ set _reg=%windir%\system32\reg.exe @@ -67,9 +67,6 @@ set _reg=%windir%\system32\reg.exe
%_reg% query "HKU\S-1-5-19" 1>nul 2>nul || goto :E_Admin
:detect
set /a rnd=%random%
set "mountdir=%mountdir%\%rnd%"
set "winremount=%winremount%\%rnd%"
if exist "%cab_dir%" (
echo.
echo ============================================================

46
YAOCTRI/README.md

@ -6,10 +6,10 @@ @@ -6,10 +6,10 @@
* Support installing multiple languages separately or together
* Support configuration options like the ones available with ODT, including:
- Source Path
- Excluding Apps
- Update Channel
* Support configuration options like the ones available with ODT, including:
- Source Path
- Excluding Apps
- Update Channel
- Miscellaneous Options (Display Level, Updates Enabled, Eula, Pin Icons, App Shutdown, Auto Activate)
* Includes a proper workaround to install Office 2019 on Windows 7 and 8.1, with working updates
@ -22,9 +22,14 @@ install volume products for Office 2019 only, in addition to the special SKUs O3 @@ -22,9 +22,14 @@ install volume products for Office 2019 only, in addition to the special SKUs O3
- YAOCTRIR - Retail
install retail products for Office 365 / 2016 / 2019 Suites, in addition to Office 2019 Single Apps
* Each flavor consist of two command scripts:
- Configurator.cmd : create C2R_Config ini files, with the ability to start the installation at the end
- Installer.cmd : read C2R_Config ini files and execute the installation
* Each flavor consist of two command scripts:
- Configurator.cmd
the main script which is used to select products and installation options
it also create configuration ini files, with the ability to start the installation at the end
- Installer.cmd
the secondary script which is only used to execute the installation, depending on the already created the configuration ini file
## How To:
@ -50,8 +55,8 @@ if Configurator.cmd is placed next to "Office" folder, the path will be auto det @@ -50,8 +55,8 @@ if Configurator.cmd is placed next to "Office" folder, the path will be auto det
- If multiple languages are detected in the specified version, you will be prompted to choose one, or all
- If you chose all languages, you will be prompted to choose primary language
(determines the setup and Office Shell UI culture, including shortcuts, right-click context menus, and tooltips)
- If you chose all languages, you will be prompted to choose the primary language
(which determines the setup and Office Shell UI culture, including shortcuts, right-click context menus, and tooltips)
- Select the installation type: complete product suites, or single apps separately
@ -88,7 +93,7 @@ therefore, the underlying Product IDs and entries in "Program and Features" will @@ -88,7 +93,7 @@ therefore, the underlying Product IDs and entries in "Program and Features" will
* For YAOCTRI - Volume flavor, if you choose "Office 365 ProPlus" along with Project 2019 and/or Visio 2019,
Mondo licenses used for volume conversion will take precedence over Project/Visio licenses (that is Office limitation not the script)
Mondo licenses used for volume conversion will take precedence over Project/Visio licenses (this is a limitation in Office itself, not the script)
a better choice would be to select Mondo directly, which include Project/Visio
@ -99,30 +104,25 @@ a better choice would be to select Mondo directly, which include Project/Visio @@ -99,30 +104,25 @@ a better choice would be to select Mondo directly, which include Project/Visio
* Auto Activate option will work in YAOCTRI - Volume flavor only in these scenarios:
- on Windows 10 or 8.1:
system is KMS activated with external online KMS server, or installed SppExtComObjPatcher (or similar KMS service solutions)
system is KMS activated with external online KMS server, or SppExtComObjHook is installed (or similar KMS service solutions)
- on Windows 7:
SppExtComObjPatcher is installed, or external online KMS server is added manually to OSPP registry
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform`
* C2R_Config ini files are system-specific (architecture and Windows version level):
- you cannot create config file on x86 system and use it on x64 system, or vice versa
- you cannot create config file on Windows 10 and use it on Windows 7/8.1, or vice versa
SppExtComObjHook is installed, or external online KMS server is added manually to OSPP registry
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform'
* The script will not check or detect already installed Office products (C2R or MSI) before installation
while it is possible to install Office C2R on the top of already installed C2R, it is advisable to start clean
* If you want to update Office manually, you may disable Updates option
* If you want to update Office manually, set Updates option to False,
then, you can execute this in command prompt as administrator to update Office:
and after installation, you can execute this in command prompt as administrator to update Office:
`"%CommonProgramFiles%\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update user updatepromptuser=True displaylevel=True`
'"%CommonProgramFiles%\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update user updatepromptuser=True displaylevel=True'
## Special Thanks
@ratzlefatz / OfficeRTool
@Krakatoa / WOTOK
@presto1234 / code improvements suggestion
@Windows_Addict / features suggestion and testing
@Windows_Addict / features suggestion and testing
@Enthousiast / reporting and testing

82
YAOCTRI/Reference-C2RR_Config.ini

@ -0,0 +1,82 @@ @@ -0,0 +1,82 @@
[configuration]
; the directory path or drive letter that contain "Office" folder
; if not exist, Installer.cmd will check for "Office" or "Data" folders next to it
SourcePath="F:"
; Local - regular directory
; DVD - mounted iso/img
; UNC - network share
Type=DVD
; this cannot be customized, it must exist in Office source
Version=16.0.11911.20000
; Office architecture x64 or x86
Architecture=x86
; 1 - install Office 32-bit on Windows x64
O32W64=1
; to install multiple langs, separate them with _
; example: ar-SA_en-US_fr-FR
Language=en-US
; to install multiple langs, separate them with ,
; example: 1025,1033,1036
LCID=1033
; uncomment this line only for multiple langs scenario to define primary lang
;Primary=ar-SA,1025
; update channel:
; Insiders
; MonthlyTargeted
; Monthly
; SemiAnnualTargeted
; SemiAnnual
; DogfoodDevMain
; MicrosoftElite
Channel=Insiders
; corresponding FFNs, same order as above:
; 5440fd1f-7ecb-4221-8110-145efaa6372f
; 64256afe-f5d9-4f86-8936-8840a6a4f5be
; 492350f6-3a01-4f97-b9c0-c7c6ddf67d60
; b8f9b850-328d-4355-9145-c59439a0c4cf
; 7ffbc6bf-bc32-4f92-8982-f9dd17fd3114
; ea4a4090-de26-49d7-93c1-91bff9e53fc3
; b61285dd-d9f7-41f2-9757-8f61cba4e9c8
CDN=5440fd1f-7ecb-4221-8110-145efaa6372f
; primary suite id for installation, set 1 id only:
; O365ProPlusRetail, O365BusinessRetail, O365SmallBusPremRetail, O365HomePremRetail, O365EduCloudRetail
; ProPlus2019Retail, Professional2019Retail, Standard2019Retail, HomeBusiness2019Retail, HomeStudent2019Retail
; ProPlusRetail, ProfessionalRetail, StandardRetail, HomeBusinessRetail, HomeStudentRetail
Suite=ProPlusRetail
; excluded apps from primary suite, allowed ids (separated with comma ,):
; Access,Excel,Lync,OneDrive,OneNote,Outlook,PowerPoint,Publisher,Teams,Word
; Groove is OneDriveForBusiness (old, must be always excluded)
; Lync is SkypeForBusiness
ExcludedApps=Groove,Lync,OneDrive,Teams
; single apps installation, allowed ids (separated with comma ,):
; Access2019Retail, Excel2019Retail, Outlook2019Retail, PowerPoint2019Retail, Publisher2019Retail, SkypeForBusiness2019Retail, Word2019Retail, OneNoteRetail
; ProjectPro2019Retail, ProjectStd2019Retail, VisioPro2019Retail, VisioStd2019Retail
SKUs=ProjectPro2019Retail
; miscellaneous options
; PinIconsToTaskbar is only for Windows 7 and 8.1
UpdatesEnabled=False
AcceptEULA=True
PinIconsToTaskbar=False
ForceAppShutdown=True
AutoActivate=False
DisableTelemetry=True
; to run installation silent, change below to False
DisplayLevel=True
; to run installation unattended without prompt, change below to True
AutoInstallation=False

84
YAOCTRI/Reference-C2R_Config.ini

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
[configuration]
; the directory path or drive letter that contain "Office" folder
; if not exist, Installer.cmd will check for "Office" or "Data" folders next to it
SourcePath="C:\Downloads\C2R_Monthly"
; Local - regular directory
; DVD - mounted iso/img
; UNC - network share
Type=Local
; this cannot be customized, it must exist in Office source
Version=16.0.11911.20000
; Office architecture x64 or x86
Architecture=x64
; 1 - install Office 32-bit on Windows x64
O32W64=0
; to install multiple langs, separate them with _
; example: ar-SA_en-US_fr-FR
Language=en-US
; to install multiple langs, separate them with ,
; example: 1025,1033,1036
LCID=1033
; uncomment this line only for multiple langs scenario to define primary lang
;Primary=ar-SA,1025
; update channel:
; Insiders
; MonthlyTargeted
; Monthly
; SemiAnnualTargeted
; SemiAnnual
; PerpetualVL2019Targeted
; PerpetualVL2019
; DogfoodDevMain
; MicrosoftElite
Channel=MonthlyTargeted
; corresponding FFNs, same order as above:
; 5440fd1f-7ecb-4221-8110-145efaa6372f
; 64256afe-f5d9-4f86-8936-8840a6a4f5be
; 492350f6-3a01-4f97-b9c0-c7c6ddf67d60
; b8f9b850-328d-4355-9145-c59439a0c4cf
; 7ffbc6bf-bc32-4f92-8982-f9dd17fd3114
; 2e148de9-61c8-4051-b103-4af54baffbb4
; f2e724c1-748f-4b47-8fb8-8e0d210e9208
; ea4a4090-de26-49d7-93c1-91bff9e53fc3
; b61285dd-d9f7-41f2-9757-8f61cba4e9c8
CDN=64256afe-f5d9-4f86-8936-8840a6a4f5be
; primary suite id for installation, set 1 id only:
; O365ProPlusRetail, MondoVolume, ProPlus2019Volume, Standard2019Volume
Suite=O365ProPlusRetail
; excluded apps from primary suite, allowed ids (separated with comma ,):
; Access,Excel,Lync,OneDrive,OneNote,Outlook,PowerPoint,Publisher,Teams,Word
; Groove is OneDriveForBusiness (old, must be always excluded)
; Lync is SkypeForBusiness
ExcludedApps=Groove,Lync,OneDrive,Teams
; single apps installation, allowed ids (separated with comma ,):
; Access2019Volume, Excel2019Volume, Outlook2019Volume, PowerPoint2019Volume, Publisher2019Volume, SkypeForBusiness2019Volume, Word2019Volume, OneNoteVolume
; ProjectPro2019Volume, ProjectStd2019Volume, VisioPro2019Volume, VisioStd2019Volume
SKUs=ProjectPro2019Volume
; miscellaneous options
; PinIconsToTaskbar is only for Windows 7 and 8.1
UpdatesEnabled=False
AcceptEULA=True
PinIconsToTaskbar=False
ForceAppShutdown=True
AutoActivate=False
DisableTelemetry=True
; to run installation silent, change below to False
DisplayLevel=True
; to run installation unattended without prompt, change below to True
AutoInstallation=False

187
YAOCTRI/YAOCTRIR_Configurator.cmd

@ -1,27 +1,31 @@ @@ -1,27 +1,31 @@
@setlocal DisableDelayedExpansion
@echo off
set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")
set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "SysPath=%SystemRoot%\System32"
if exist "%SystemRoot%\Sysnative\reg.exe" (set "SysPath=%SystemRoot%\Sysnative")
set "Path=%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "_err===== ERROR ===="
set "xOS=x64"
set "_ComSpec=%Windir%\System32\cmd.exe"
set "_ComSpec=%SystemRoot%\System32\cmd.exe"
set "_Common=%CommonProgramFiles%"
set "_Program=%ProgramFiles%"
if /i %PROCESSOR_ARCHITECTURE%==x86 (
if not defined PROCESSOR_ARCHITEW6432 set "xOS=x86"
if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%Windir%\Sysnative\cmd.exe"
if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%SystemRoot%\Sysnative\cmd.exe"
set "_Common=%CommonProgramW6432%"
set "_Program=%ProgramW6432%"
) else (
set "xOS=x86"
)
)
set "_target=%_Common%\Microsoft Shared\ClickToRun"
set "_file=%_target%\OfficeClickToRun.exe"
set "_tempdir=%temp%"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
set "_inipath=%_workdir%"
setlocal EnableDelayedExpansion
set "_temp=%temp%"
set "_work=%~dp0"
set "_work=%_work:~0,-1%"
reg query HKU\S-1-5-19 >nul 2>&1 || goto :E_Admin
set "_ini=%~dp0"
for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b"
if exist "%SystemDrive%\Users\Public\Desktop\desktop.ini" set "_dsk=%SystemDrive%\Users\Public\Desktop"
setlocal EnableDelayedExpansion
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
if %winbuild% lss 7601 goto :E_Win
title Office Click-to-Run Configurator - Retail
@ -57,15 +61,15 @@ set /a cc+=1 @@ -57,15 +61,15 @@ set /a cc+=1
set chn!cc!=%%#
)
set "line=============================================================="
if exist "!_workdir!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Office\Data\" 2^>nul') do if exist "!_workdir!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%_workdir%"
if exist "!_work!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Office\Data\" 2^>nul') do if exist "!_work!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%~dp0"
)
)
if defined CTRsource goto :check
if exist "!_workdir!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Data\" 2^>nul') do if exist "!_workdir!\Data\%%#\stream*.dat" (
call :get_path "!_workdir!\..\"
if exist "!_work!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Data\" 2^>nul') do if exist "!_work!\Data\%%#\stream*.dat" (
for /D %%G in ("!_work!\..\") do set "CTRsource=%%~dpG"
)
)
if defined CTRsource goto :check
@ -73,12 +77,6 @@ for %%# in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do ( @@ -73,12 +77,6 @@ for %%# in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\"
)
if defined CTRsource goto :check
goto :prompt
:get_path
endlocal
set "CTRsource=%~dp1"
exit /b
:prompt
cls
@ -88,20 +86,19 @@ echo Enter the directory / drive that contain "Office" folder @@ -88,20 +86,19 @@ echo Enter the directory / drive that contain "Office" folder
echo ^(do not enter the path for Office folder itself^)
echo %line%
echo.
set /p "CTRsource="
if "%CTRsource%"=="" goto :eof
if not exist "%CTRsource%\Office\Data\*.cab" (
echo ==== ERROR ====
set /p CTRsource=
if not defined CTRsource goto :eof
set "CTRsource=%CTRsource:"=%"
if not exist "!CTRsource!\Office\Data\*.cab" (
echo %_err%
echo Specified path is not a valid Office C2R source
echo.
echo Press any key to continue...
pause >nul
goto :prompt
)
goto :check
:check
setlocal EnableDelayedExpansion
if "!CTRsource:~-1!"=="\" set "CTRsource=!CTRsource:~0,-1!"
cls
echo %line%
@ -122,7 +119,7 @@ set CTRver!vvv!=%%# @@ -122,7 +119,7 @@ set CTRver!vvv!=%%#
set CTRver=%%#
)
if %vvv% equ 0 (
echo ==== ERROR ====
echo %_err%
echo Specified path is not a valid Office C2R source
echo.
echo Press any key to continue...
@ -131,13 +128,10 @@ goto :prompt @@ -131,13 +128,10 @@ goto :prompt
)
if %vvv% gtr 9 (
echo.
echo ==== ERROR ====
echo %_err%
echo More than 9 versions detected in Office C2R source
echo remove some of them and try again
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if %vvv% equ 1 goto :MenuVersion2
@ -208,20 +202,14 @@ if "%xOS%"=="x64" if "%off64%"=="1" set "win64=1" @@ -208,20 +202,14 @@ if "%xOS%"=="x64" if "%off64%"=="1" set "win64=1"
if "%xOS%"=="x64" if "%off32%"=="1" if "%icab64%"=="1" if "%icablp64%"=="1" set "wow64=1"
if "%xOS%"=="x86" if "%win32%"=="0" (
echo ==== ERROR ====
echo %_err%
echo Could not detect compatible Office 32-bit for current x86 system.
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if "%xOS%"=="x64" if "%win64%"=="0" if "%wow64%"=="0" (
echo ==== ERROR ====
echo %_err%
echo Could not detect compatible Office 64-bit/32-bit for current x64 system.
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if "%win32%"=="1" (set "CTRarc=x86"&goto :MenuArch2)
if "%win64%"=="1" if "%wow64%"=="0" (set "CTRarc=x64"&goto :MenuArch2)
@ -257,13 +245,10 @@ call :checklp !lpid%%J! !lcid%%J! @@ -257,13 +245,10 @@ call :checklp !lpid%%J! !lcid%%J!
)
if %int% gtr 9 (
echo.
echo ==== ERROR ====
echo %_err%
echo More than 9 languages detected in Office C2R source
echo remove some of them and try again
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if %int% equ 1 goto :MenuLang2
goto :MenuLang
@ -383,9 +368,9 @@ set CTRvcab=v64_%CTRver%.cab&set CTRicab=i640.cab&set CTRicabr=i64%CTRprm%.cab @@ -383,9 +368,9 @@ set CTRvcab=v64_%CTRver%.cab&set CTRicab=i640.cab&set CTRicabr=i64%CTRprm%.cab
:MenuInitial
set _O2019=1
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_tempdir!" >nul
findstr /i Word2019Volume "!_tempdir!\VersionDescriptor.xml" >nul || set _O2019=0
del /f /q "!_tempdir!\*.xml" 1>nul 2>nul
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_temp!" >nul
findstr /i Word2019Volume "!_temp!\VersionDescriptor.xml" 1>nul 2>nul || set _O2019=0
del /f /q "!_temp!\*.xml" 1>nul 2>nul
set _O365=0
set _O2016=0
set _return=0
@ -470,19 +455,21 @@ echo. 3. Office 365 Small Business : %_O365Sma% @@ -470,19 +455,21 @@ echo. 3. Office 365 Small Business : %_O365Sma%
echo. 4. Office 365 Home : %_O365Hom%
echo. 5. Office 365 Education : %_O365Edu%
echo.
if %_O2019%==1 (
echo. 6. Project Professional 2019 : %_O19PrjPro%
echo. 7. Project Standard 2019 : %_O19PrjStd%
echo. 8. Visio Professional 2019 : %_O19VisPro%
echo. 9. Visio Standard 2019 : %_O19VisStd%
)
echo %line%
choice /c 1234567890BX /n /m "Change a menu option, press 0 to proceed, B to go back, or X to exit: "
if errorlevel 12 goto :eof
if errorlevel 11 goto :MenuInitial
if errorlevel 10 goto :MenuSuite365b
if errorlevel 9 (if %_O19VisStd%==ON (set _O19VisStd=OFF) else (set _O19VisStd=ON&set _O19VisPro=OFF))&goto :MenuSuite365
if errorlevel 8 (if %_O19VisPro%==ON (set _O19VisPro=OFF) else (set _O19VisPro=ON&set _O19VisStd=OFF))&goto :MenuSuite365
if errorlevel 7 (if %_O19PrjStd%==ON (set _O19PrjStd=OFF) else (set _O19PrjStd=ON&set _O19PrjPro=OFF))&goto :MenuSuite365
if errorlevel 6 (if %_O19PrjPro%==ON (set _O19PrjPro=OFF) else (set _O19PrjPro=ON&set _O19PrjStd=OFF))&goto :MenuSuite365
if errorlevel 9 (if %_O2019%==1 (if %_O19VisStd%==ON (set _O19VisStd=OFF) else (set _O19VisStd=ON&set _O19VisPro=OFF))&goto :MenuSuite365)
if errorlevel 8 (if %_O2019%==1 (if %_O19VisPro%==ON (set _O19VisPro=OFF) else (set _O19VisPro=ON&set _O19VisStd=OFF))&goto :MenuSuite365)
if errorlevel 7 (if %_O2019%==1 (if %_O19PrjStd%==ON (set _O19PrjStd=OFF) else (set _O19PrjStd=ON&set _O19PrjPro=OFF))&goto :MenuSuite365)
if errorlevel 6 (if %_O2019%==1 (if %_O19PrjPro%==ON (set _O19PrjPro=OFF) else (set _O19PrjPro=ON&set _O19PrjStd=OFF))&goto :MenuSuite365)
if errorlevel 5 (if %_O365Edu%==ON (set _O365Edu=OFF) else (set _O365Edu=ON&set _O365Bus=OFF&set _O365Pro=OFF&set _O365Hom=OFF&set _O365Sma=OFF))&goto :MenuSuite365
if errorlevel 4 (if %_O365Hom%==ON (set _O365Hom=OFF) else (set _O365Hom=ON&set _O365Bus=OFF&set _O365Pro=OFF&set _O365Edu=OFF&set _O365Sma=OFF))&goto :MenuSuite365
if errorlevel 3 (if %_O365Sma%==ON (set _O365Sma=OFF) else (set _O365Sma=ON&set _O365Bus=OFF&set _O365Pro=OFF&set _O365Edu=OFF&set _O365Hom=OFF))&goto :MenuSuite365
@ -931,9 +918,9 @@ echo Select Update Channel: @@ -931,9 +918,9 @@ echo Select Update Channel:
echo.
echo. 0. Default
echo. 1. Insiders ^| Insiders::DevMain
echo. 2. Monthly / Targeted ^| Insiders::CC
echo. 2. Monthly [Targeted] ^| Insiders::CC
echo. 3. Monthly ^| Production::CC
echo. 4. Semi-Annual / Targeted ^| Insiders::FRDC
echo. 4. Semi-Annual [Targeted] ^| Insiders::FRDC
echo. 5. Semi-Annual ^| Production::DC
echo.
echo. 6. DevMain Channel ^| Dogfood::DevMain
@ -954,13 +941,13 @@ goto :MenuChannel @@ -954,13 +941,13 @@ goto :MenuChannel
:MenuChannel2
if %inpt%==0 (
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_tempdir!" >nul
for /f "tokens=3 delims=<= " %%# in ('findstr /i DeliveryMechanism "!_tempdir!\VersionDescriptor.xml" 2^>nul') do set "FFNRoot=%%~#"
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_temp!" >nul
for /f "tokens=3 delims=<= " %%# in ('findstr /i DeliveryMechanism "!_temp!\VersionDescriptor.xml" 2^>nul') do set "FFNRoot=%%~#"
if "!FFNRoot!" neq "" for /l %%J in (1,1,9) do (
if /i !FFNRoot! equ !ffn%%J! set inpt=%%J
)
if "!FFNRoot!" equ "" set inpt=3
del /f /q "!_tempdir!\*.xml" 1>nul 2>nul
del /f /q "!_temp!\*.xml" 1>nul 2>nul
)
set "CTRffn=!ffn%inpt%!"
set "CTRchn=!chn%inpt%!"
@ -1072,13 +1059,8 @@ goto :MenuFinal @@ -1072,13 +1059,8 @@ goto :MenuFinal
:MenuFinal2
cls
set "MyDate="
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
copy /y nul "!_workdir!\#.rw" 1>nul 2>nul && (
if exist "!_workdir!\#.rw" del /f /q "!_workdir!\#.rw"
) || (
set "_inipath=%SystemDrive%\Users\Public\Desktop"
)
for /f "tokens=2 delims==." %%# in ('wmic os get localdatetime /value') do set "_date=%%#"
copy /y nul "!_work!\#.rw" 1>nul 2>nul && (if exist "!_work!\#.rw" del /f /q "!_work!\#.rw") || (set "_ini=!_dsk!")
(
echo [configuration]
@ -1093,32 +1075,28 @@ if defined CTRprm echo Primary=%CTRstp%,%CTRprm% @@ -1093,32 +1075,28 @@ if defined CTRprm echo Primary=%CTRstp%,%CTRprm%
echo Channel=%CTRchn%
echo CDN=%CTRffn%
if defined _suite (
echo Suite=%_suite%
if defined _suit2 echo Suite2=%_suit2%
if defined _suit2 (echo Suite=%_suit2%) else (echo Suite=%_suite%)
echo ExcludedApps=%_excluded%
)
if defined _skus (
echo SKUs=%_skus%
echo SKUs=%_show%
if not defined _suite if %_OneDrive%==OFF echo ExcludedApps=OneDrive
)
echo UpdatesEnabled=%_updt%
echo AcceptEULA=%_eula%
echo PinIconsToTaskbar=%_icon%
echo ForceAppShutdown=%_shut%
echo DisplayLevel=%_disp%
echo AutoActivate=%_actv%
echo DisableTelemetry=%_tele%
echo DisplayLevel=%_disp%
echo AutoInstallation=%_unattend%
)>"!_inipath!\C2RR_Config_%MyDate:~0,8%-%MyDate:~8,4%.ini" 2>nul
)>"!_ini!\C2RR_Config_%_date:~0,8%-%_date:~8,4%.ini" 2>nul
if %_install%==False (
echo %line%
echo Done
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
:MenuInstall
@ -1156,11 +1134,11 @@ echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt @@ -1156,11 +1134,11 @@ echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt
echo reg.exe add %_Config% /f /v UpdateChannel /t REG_SZ /d "%_url%/%CTRffn%" 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannelChanged /t REG_SZ /d True 1^>nul 2^>nul
echo exit /b
)>"!_tempdir!\C2R_Setup.bat"
)>"!_temp!\C2R_Setup.bat"
set "CTRexe=1"
if exist "!_file!" for /f "tokens=2-5 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i%%j%%k%%l geq %CTRver:.=% (set CTRexe=0)
if exist "!_file!" for /f "tokens=4 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i geq %verchk% (set CTRexe=0)
)
call :StopService 1>nul 2>nul
if %CTRexe%==1 (
@ -1174,19 +1152,16 @@ echo %line% @@ -1174,19 +1152,16 @@ echo %line%
echo Running installation...
echo %line%
echo.
del /f /q "%windir%\temp\*.log" 1>nul 2>nul
del /f /q "!_tempdir!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_tempdir!\C2R_Setup.bat" "
del /f /q "!_tempdir!\C2R_Setup.bat" 1>nul 2>nul
del /f /q "%SystemRoot%\temp\*.log" 1>nul 2>nul
del /f /q "!_temp!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_temp!\C2R_Setup.bat" "
del /f /q "!_temp!\C2R_Setup.bat" 1>nul 2>nul
if not exist "!_Program!\Microsoft Office\root\Office16\*.dll" if not exist "%ProgramFiles(x86)%\Microsoft Office\root\Office16\*.dll" (
echo.
echo %line%
echo Installation failed.
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
if defined _licenses (
echo.
@ -1212,12 +1187,11 @@ goto :eof @@ -1212,12 +1187,11 @@ goto :eof
:StopService
sc query WSearch | find /i "STOPPED" || net stop WSearch /y
sc query WSearch | find /i "STOPPED" || sc stop WSearch
if exist "!_file!" (
if not exist "!_file!" exit /b
sc query ClickToRunSvc | find /i "STOPPED" || net stop ClickToRunSvc /y
sc query ClickToRunSvc | find /i "STOPPED" || sc stop ClickToRunSvc
taskkill /t /f /IM OfficeC2RClient.exe
taskkill /t /f /IM OfficeClickToRun.exe
)
exit /b
:Licenses
@ -1235,12 +1209,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1 @@ -1235,12 +1209,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1
exit /b
:Telemetry
if %wow64%==1 (set "_inter=Software\Wow6432Node") else (set "_inter=Software")
set "_inter=Software"
if %wow64%==1 (set "_inter=Software\Wow6432Node")
set "_rkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings"
set "_skey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\16.0"
set "_tkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\Common\ClientTelemetry"
for %%# in (Count,Order) do reg add "%_rkey%" /f /v %%# /t REG_DWORD /d 1
for %%# in (DisableTelemetry,SendTelemetry) do reg add "%_tkey%" /f /v %%# /t REG_DWORD /d 1
reg add "%_tkey%" /f /v SendTelemetry /t REG_DWORD /d 3
reg add "%_tkey%" /f /v DisableTelemetry /t REG_DWORD /d 1
for %%# in (disconnectedstate,usercontentdisabled,downloadcontentdisabled,controllerconnectedservicesenabled) do reg add "%_skey%\Common\Privacy" /f /v %%# /t REG_DWORD /d 2
for %%# in (qmenable,sendcustomerdata,updatereliabilitydata) do reg add "%_skey%\Common" /f /v %%# /t REG_DWORD /d 0
for %%# in (disableboottoofficestart,optindisable,shownfirstrunoptin,ShownFileFmtPrompt) do reg add "%_skey%\Common\General" /f /v %%# /t REG_DWORD /d 1
for %%# in (BootedRTM,disablemovie) do reg add "%_skey%\Firstrun" /f /v %%# /t REG_DWORD /d 1
@ -1263,25 +1240,21 @@ set "_schedule=Microsoft\Office" @@ -1263,25 +1240,21 @@ set "_schedule=Microsoft\Office"
exit /b
:E_VER
echo ==== ERROR ====
echo %_err%
echo Minimum Supported Version is 16.0.9029.2167
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Admin
echo ==== ERROR ====
echo %_err%
echo Right click on this script and select 'Run as administrator'
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Win
echo ==== ERROR ====
echo %_err%
echo Windows 7 SP1 is the minimum supported OS.
:TheEnd
echo.
echo Press any key to exit...
echo Press any key to exit.
pause >nul
goto :eof

181
YAOCTRI/YAOCTRIR_Installer.cmd

@ -1,26 +1,28 @@ @@ -1,26 +1,28 @@
@setlocal DisableDelayedExpansion
@echo off
set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")
set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "SysPath=%SystemRoot%\System32"
if exist "%SystemRoot%\Sysnative\reg.exe" (set "SysPath=%SystemRoot%\Sysnative")
set "Path=%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "_err===== ERROR ===="
set "xOS=x64"
set "_ComSpec=%Windir%\System32\cmd.exe"
set "_ComSpec=%SystemRoot%\System32\cmd.exe"
set "_Common=%CommonProgramFiles%"
set "_Program=%ProgramFiles%"
if /i %PROCESSOR_ARCHITECTURE%==x86 (
if not defined PROCESSOR_ARCHITEW6432 set "xOS=x86"
if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%Windir%\Sysnative\cmd.exe"
if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%SystemRoot%\Sysnative\cmd.exe"
set "_Common=%CommonProgramW6432%"
set "_Program=%ProgramW6432%"
) else (
set "xOS=x86"
)
)
set "_target=%_Common%\Microsoft Shared\ClickToRun"
set "_file=%_target%\OfficeClickToRun.exe"
set "_tempdir=%temp%"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
setlocal EnableDelayedExpansion
set "_temp=%temp%"
set "_work=%~dp0"
set "_work=%_work:~0,-1%"
reg query HKU\S-1-5-19 >nul 2>&1 || goto :E_Admin
setlocal EnableDelayedExpansion
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
if %winbuild% lss 7601 goto :E_Win
title Office Click-to-Run Installer - Retail
@ -33,18 +35,20 @@ set _actv=False @@ -33,18 +35,20 @@ set _actv=False
set _tele=True
set _unattend=False
set "line=============================================================="
if exist "!_workdir!\C2RR*.ini" for /f %%# in ('dir /b /s "!_workdir!\C2RR*.ini"') do (set "C2Rconfig=%%#"&goto :check)
if exist "!_work!\C2RR_*.ini" for /f "tokens=* delims=" %%# in ('dir /b "!_work!\C2RR_*.ini"') do set "C2Rconfig=!_work!\%%#"
if defined C2Rconfig goto :check
:prompt
cls
set "C2Rconfig="
set C2Rconfig=
echo %line%
echo Enter C2RR_Config ini file path
echo %line%
echo.
set /p "C2Rconfig="
if "%C2Rconfig%"=="" goto :eof
goto :check
set /p C2Rconfig=
if not defined C2Rconfig goto :eof
set "C2Rconfig=%C2Rconfig:"=%"
if not exist "!C2Rconfig!" goto :eof
:check
findstr /i \[configuration\] "!C2Rconfig!" 1>nul 2>nul || goto :prompt
@ -94,36 +98,30 @@ CTRcul @@ -94,36 +98,30 @@ CTRcul
CTRffn
) do if not defined %%# (
echo.
echo ==== ERROR ====
echo %_err%
echo Could not detect %%# in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if not defined _suite if not defined _skus (
echo.
echo ==== ERROR ====
echo %_err%
echo Could not detect products in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if defined CTRsource if exist "!CTRsource!\Office\Data\*.cab" (
goto :check3
) else (
set "CTRsource="
)
if exist "!_workdir!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Office\Data\" 2^>nul') do if exist "!_workdir!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%_workdir%"
if exist "!_work!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Office\Data\" 2^>nul') do if exist "!_work!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%~dp0"
)
)
if defined CTRsource goto :check3
if exist "!_workdir!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Data\" 2^>nul') do if exist "!_workdir!\Data\%%#\stream*.dat" (
call :get_path "!_workdir!\..\"
if exist "!_work!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Data\" 2^>nul') do if exist "!_work!\Data\%%#\stream*.dat" (
for /D %%G in ("!_work!\..\") do set "CTRsource=%%~dpG"
)
)
if defined CTRsource goto :check3
@ -132,20 +130,11 @@ if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\" @@ -132,20 +130,11 @@ if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\"
)
if defined CTRsource goto :check3
echo ==== ERROR ====
echo %_err%
echo Could not detect C2R source in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
:get_path
endlocal
set "CTRsource=%~dp1"
exit /b
goto :TheEnd
:check3
setlocal EnableDelayedExpansion
if "!CTRsource:~-1!"=="\" set "CTRsource=!CTRsource:~0,-1!"
copy /y nul "!CTRsource!\Office\#.rw" 1>nul 2>nul && (
set CTRtype=Local
@ -155,13 +144,14 @@ set CTRtype=DVD @@ -155,13 +144,14 @@ set CTRtype=DVD
)
if "!CTRsource:~0,2!"=="\\" set CTRtype=UNC
if /i %xOS%==x86 (set CTRarc=x86) else (if /i %CTRarc%==x86 set wow64=1)
if /i %CTRarc%==x86 (set CTRbit=32) else (set CTRbit=64)
set CTRvcab=v%CTRbit%_%CTRver%.cab
set CTRicab=i%CTRbit%0.cab
set CTRscab=s%CTRbit%0.cab
set CTRicabr=i%CTRbit%%CTRcul%.cab
set CTRscabr=s%CTRbit%%CTRcul%.cab
if /i %CTRarc%==x64 if %wow64%==1 (
if /i %xOS%==x64 (
set CTRicab=i640.cab
set CTRicabr=i64%CTRcul%.cab
)
@ -178,22 +168,40 @@ if not exist "!CTRsource!\Office\Data\%CTRver%\%%#" set "ERRFILE=%%#"&goto :E_FI @@ -178,22 +168,40 @@ if not exist "!CTRsource!\Office\Data\%CTRver%\%%#" set "ERRFILE=%%#"&goto :E_FI
)
set _O365=0
if defined _suite (
set _OneDrive=ON
if defined _excluded (
echo %_excluded%| findstr /i "OneDrive" 1>nul && set _OneDrive=OFF
)
if not defined _suite goto :sku
if %winbuild% lss 10240 (
set "_suit2="
if /i "%_suite%"=="ProPlus2019Retail" (set _suite=ProPlusRetail&set _suit2=ProPlus2019Retail)
if /i "%_suite%"=="Professional2019Retail" (set _suite=ProfessionalRetail&set _suit2=Professional2019Retail)
if /i "%_suite%"=="Standard2019Retail" (set _suite=StandardRetail&set _suit2=Standard2019Retail)
if /i "%_suite%"=="HomeBusiness2019Retail" (set _suite=HomeBusinessRetail&set _suit2=HomeBusiness2019Retail)
if /i "%_suite%"=="HomeStudent2019Retail" (set _suite=HomeStudentRetail&set _suit2=HomeStudent2019Retail)
)
if %winbuild% geq 10240 if defined _suit2 (
set "_suite=%_suit2%"
set "_suit2="
)
set "_products=%_suite%.16_%CTRlng%_x-none"
echo %_suite%| findstr /i "O365" 1>nul && set _O365=1
)
if defined _suit2 (
set "_licenses=%_suit2%"
)
set _OneDrive=ON
if defined _excluded (
echo %_excluded%| findstr /i "OneDrive" 1>nul && set _OneDrive=OFF
)
if not defined _skus goto :MenuFinal
:sku
set _O2016=1
echo %_skus%| findstr /i "2019" 1>nul && set _O2016=0
set _base=0
set /a kk=0
for %%J in (%_skus%) do (
set _tmp=%%J
@ -206,22 +214,25 @@ if /i "!_tmp:~-10!"=="2019Retail" if %winbuild% geq 10240 ( @@ -206,22 +214,25 @@ if /i "!_tmp:~-10!"=="2019Retail" if %winbuild% geq 10240 (
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
for %%A in (Access,Excel,Outlook,PowerPoint,Publisher,SkypeForBusiness,Word,OneNote) do (
if /i "!_tmp!"=="%%ARetail" (
for %%A in (Access,Excel,Outlook,PowerPoint,Publisher,SkypeForBusiness,Word,OneNote) do if /i "!_tmp!"=="%%ARetail" (
if /i "%%A"=="OneNote" (if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J"))
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
set _base=1
)
)
for %%A in (ProjectPro,ProjectStd,VisioPro,VisioStd) do (
if /i "!_tmp!"=="%%ARetail" (
if %_O2016%==1 if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
for %%A in (ProjectPro,ProjectStd,VisioPro,VisioStd) do if /i "!_tmp!"=="%%ARetail" (
if %_O2016%==1 (if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J"))
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
if %_O2016%==0 set _base=1
)
)
if /i "!_tmp!"=="OneNoteRetail" (
if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
)
if %winbuild% lss 10240 if %_base% equ 0 if %_O2016%==0 for %%J in (%_skus%) do (
set _tmp=%%J
if /i "!_tmp:~-10!"=="2019Retail" call set _tmp=!_tmp:~0,-10!Retail
if defined _products (set "_products=!_products!^|!_tmp!.16_%CTRlng%_x-none") else (set "_products=!_tmp!.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! !_tmp!.excludedapps.16=onedrive") else (set "_exclude1d=!_tmp!.excludedapps.16=onedrive"))
)
:MenuFinal
@ -286,11 +297,12 @@ echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt @@ -286,11 +297,12 @@ echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt
echo reg.exe add %_Config% /f /v UpdateChannel /t REG_SZ /d "%_url%/%CTRffn%" 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannelChanged /t REG_SZ /d True 1^>nul 2^>nul
echo exit /b
)>"!_tempdir!\C2R_Setup.bat"
)>"!_temp!\C2R_Setup.bat"
for /f "tokens=3 delims=." %%# in ('echo %CTRver%') do set verchk=%%#
set "CTRexe=1"
if exist "!_file!" for /f "tokens=2-5 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i%%j%%k%%l geq %CTRver:.=% (set CTRexe=0)
if exist "!_file!" for /f "tokens=4 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i geq %verchk% (set CTRexe=0)
)
call :StopService 1>nul 2>nul
if %CTRexe%==1 (
@ -304,19 +316,16 @@ echo %line% @@ -304,19 +316,16 @@ echo %line%
echo Running installation...
echo %line%
echo.
del /f /q "%windir%\temp\*.log" 1>nul 2>nul
del /f /q "!_tempdir!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_tempdir!\C2R_Setup.bat" "
del /f /q "!_tempdir!\C2R_Setup.bat" 1>nul 2>nul
del /f /q "%SystemRoot%\temp\*.log" 1>nul 2>nul
del /f /q "!_temp!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_temp!\C2R_Setup.bat" "
del /f /q "!_temp!\C2R_Setup.bat" 1>nul 2>nul
if not exist "!_Program!\Microsoft Office\root\Office16\*.dll" if not exist "%ProgramFiles(x86)%\Microsoft Office\root\Office16\*.dll" (
echo.
echo %line%
echo Installation failed.
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
if defined _licenses (
echo.
@ -343,12 +352,11 @@ goto :eof @@ -343,12 +352,11 @@ goto :eof
:StopService
sc query WSearch | find /i "STOPPED" || net stop WSearch /y
sc query WSearch | find /i "STOPPED" || sc stop WSearch
if exist "!_file!" (
if not exist "!_file!" exit /b
sc query ClickToRunSvc | find /i "STOPPED" || net stop ClickToRunSvc /y
sc query ClickToRunSvc | find /i "STOPPED" || sc stop ClickToRunSvc
taskkill /t /f /IM OfficeC2RClient.exe
taskkill /t /f /IM OfficeClickToRun.exe
)
exit /b
:Licenses
@ -366,12 +374,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1 @@ -366,12 +374,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1
exit /b
:Telemetry
if /i %CTRarc%==x64 if %wow64%==1 (set "_inter=Software\Wow6432Node") else (set "_inter=Software")
set "_inter=Software"
if /i %xOS%==x64 if %wow64%==1 (set "_inter=Software\Wow6432Node")
set "_rkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings"
set "_skey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\16.0"
set "_tkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\Common\ClientTelemetry"
for %%# in (Count,Order) do reg add "%_rkey%" /f /v %%# /t REG_DWORD /d 1
for %%# in (DisableTelemetry,SendTelemetry) do reg add "%_tkey%" /f /v %%# /t REG_DWORD /d 1
reg add "%_tkey%" /f /v SendTelemetry /t REG_DWORD /d 3
reg add "%_tkey%" /f /v DisableTelemetry /t REG_DWORD /d 1
for %%# in (disconnectedstate,usercontentdisabled,downloadcontentdisabled,controllerconnectedservicesenabled) do reg add "%_skey%\Common\Privacy" /f /v %%# /t REG_DWORD /d 2
for %%# in (qmenable,sendcustomerdata,updatereliabilitydata) do reg add "%_skey%\Common" /f /v %%# /t REG_DWORD /d 0
for %%# in (disableboottoofficestart,optindisable,shownfirstrunoptin,ShownFileFmtPrompt) do reg add "%_skey%\Common\General" /f /v %%# /t REG_DWORD /d 1
for %%# in (BootedRTM,disablemovie) do reg add "%_skey%\Firstrun" /f /v %%# /t REG_DWORD /d 1
@ -394,25 +405,21 @@ set "_schedule=Microsoft\Office" @@ -394,25 +405,21 @@ set "_schedule=Microsoft\Office"
exit /b
:E_FILE
echo ==== ERROR ====
echo %_err%
echo %ERRFILE% is missing in the specified source
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Admin
echo ==== ERROR ====
echo %_err%
echo Right click on this script and select 'Run as administrator'
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Win
echo ==== ERROR ====
echo %_err%
echo Windows 7 SP1 is the minimum supported OS.
:TheEnd
echo.
echo Press any key to exit...
echo Press any key to exit.
pause >nul
goto :eof

215
YAOCTRI/YAOCTRI_Configurator.cmd

@ -1,27 +1,31 @@ @@ -1,27 +1,31 @@
@setlocal DisableDelayedExpansion
@echo off
set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")
set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "SysPath=%SystemRoot%\System32"
if exist "%SystemRoot%\Sysnative\reg.exe" (set "SysPath=%SystemRoot%\Sysnative")
set "Path=%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "_err===== ERROR ===="
set "xOS=x64"
set "_ComSpec=%Windir%\System32\cmd.exe"
set "_ComSpec=%SystemRoot%\System32\cmd.exe"
set "_Common=%CommonProgramFiles%"
set "_Program=%ProgramFiles%"
if /i %PROCESSOR_ARCHITECTURE%==x86 (
if not defined PROCESSOR_ARCHITEW6432 set "xOS=x86"
if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%Windir%\Sysnative\cmd.exe"
if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%SystemRoot%\Sysnative\cmd.exe"
set "_Common=%CommonProgramW6432%"
set "_Program=%ProgramW6432%"
) else (
set "xOS=x86"
)
)
set "_target=%_Common%\Microsoft Shared\ClickToRun"
set "_file=%_target%\OfficeClickToRun.exe"
set "_tempdir=%temp%"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
set "_inipath=%_workdir%"
setlocal EnableDelayedExpansion
set "_temp=%temp%"
set "_work=%~dp0"
set "_work=%_work:~0,-1%"
reg query HKU\S-1-5-19 >nul 2>&1 || goto :E_Admin
set "_ini=%~dp0"
for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b"
if exist "%SystemDrive%\Users\Public\Desktop\desktop.ini" set "_dsk=%SystemDrive%\Users\Public\Desktop"
setlocal EnableDelayedExpansion
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
if %winbuild% lss 7601 goto :E_Win
title Office Click-to-Run Configurator - Volume
@ -59,15 +63,15 @@ set /a cc+=1 @@ -59,15 +63,15 @@ set /a cc+=1
set chn!cc!=%%#
)
set "line=============================================================="
if exist "!_workdir!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Office\Data\" 2^>nul') do if exist "!_workdir!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%_workdir%"
if exist "!_work!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Office\Data\" 2^>nul') do if exist "!_work!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%~dp0"
)
)
if defined CTRsource goto :check
if exist "!_workdir!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Data\" 2^>nul') do if exist "!_workdir!\Data\%%#\stream*.dat" (
call :get_path "!_workdir!\..\"
if exist "!_work!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Data\" 2^>nul') do if exist "!_work!\Data\%%#\stream*.dat" (
for /D %%G in ("!_work!\..\") do set "CTRsource=%%~dpG"
)
)
if defined CTRsource goto :check
@ -75,12 +79,6 @@ for %%# in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do ( @@ -75,12 +79,6 @@ for %%# in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\"
)
if defined CTRsource goto :check
goto :prompt
:get_path
endlocal
set "CTRsource=%~dp1"
exit /b
:prompt
cls
@ -90,20 +88,19 @@ echo Enter the directory / drive that contain "Office" folder @@ -90,20 +88,19 @@ echo Enter the directory / drive that contain "Office" folder
echo ^(do not enter the path for Office folder itself^)
echo %line%
echo.
set /p "CTRsource="
if "%CTRsource%"=="" goto :eof
if not exist "%CTRsource%\Office\Data\*.cab" (
echo ==== ERROR ====
set /p CTRsource=
if not defined CTRsource goto :eof
set "CTRsource=%CTRsource:"=%"
if not exist "!CTRsource!\Office\Data\*.cab" (
echo %_err%
echo Specified path is not a valid Office C2R source
echo.
echo Press any key to continue...
pause >nul
goto :prompt
)
goto :check
:check
setlocal EnableDelayedExpansion
if "!CTRsource:~-1!"=="\" set "CTRsource=!CTRsource:~0,-1!"
cls
echo %line%
@ -124,7 +121,7 @@ set CTRver!vvv!=%%# @@ -124,7 +121,7 @@ set CTRver!vvv!=%%#
set CTRver=%%#
)
if %vvv% equ 0 (
echo ==== ERROR ====
echo %_err%
echo Specified path is not a valid Office C2R source
echo.
echo Press any key to continue...
@ -133,13 +130,10 @@ goto :prompt @@ -133,13 +130,10 @@ goto :prompt
)
if %vvv% gtr 9 (
echo.
echo ==== ERROR ====
echo %_err%
echo More than 9 versions detected in Office C2R source
echo remove some of them and try again
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if %vvv% equ 1 goto :MenuVersion2
@ -210,20 +204,14 @@ if "%xOS%"=="x64" if "%off64%"=="1" set "win64=1" @@ -210,20 +204,14 @@ if "%xOS%"=="x64" if "%off64%"=="1" set "win64=1"
if "%xOS%"=="x64" if "%off32%"=="1" if "%icab64%"=="1" if "%icablp64%"=="1" set "wow64=1"
if "%xOS%"=="x86" if "%win32%"=="0" (
echo ==== ERROR ====
echo %_err%
echo Could not detect compatible Office 32-bit for current x86 system.
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if "%xOS%"=="x64" if "%win64%"=="0" if "%wow64%"=="0" (
echo ==== ERROR ====
echo %_err%
echo Could not detect compatible Office 64-bit/32-bit for current x64 system.
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if "%win32%"=="1" (set "CTRarc=x86"&goto :MenuArch2)
if "%win64%"=="1" if "%wow64%"=="0" (set "CTRarc=x64"&goto :MenuArch2)
@ -259,13 +247,10 @@ call :checklp !lpid%%J! !lcid%%J! @@ -259,13 +247,10 @@ call :checklp !lpid%%J! !lcid%%J!
)
if %int% gtr 9 (
echo.
echo ==== ERROR ====
echo %_err%
echo More than 9 languages detected in Office C2R source
echo remove some of them and try again
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if %int% equ 1 goto :MenuLang2
goto :MenuLang
@ -385,9 +370,9 @@ set CTRvcab=v64_%CTRver%.cab&set CTRicab=i640.cab&set CTRicabr=i64%CTRprm%.cab @@ -385,9 +370,9 @@ set CTRvcab=v64_%CTRver%.cab&set CTRicab=i640.cab&set CTRicabr=i64%CTRprm%.cab
:MenuInitial
set _O2019=1
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_tempdir!" >nul
findstr /i Word2019Volume "!_tempdir!\VersionDescriptor.xml" 1>nul 2>nul || set _O2019=0
del /f /q "!_tempdir!\*.xml" 1>nul 2>nul
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_temp!" >nul
findstr /i Word2019Volume "!_temp!\VersionDescriptor.xml" 1>nul 2>nul || set _O2019=0
del /f /q "!_temp!\*.xml" 1>nul 2>nul
set _Access=ON
set _Excel=ON
set _Lync=ON
@ -401,7 +386,7 @@ set _Word=ON @@ -401,7 +386,7 @@ set _Word=ON
set _Project=ON
set _Visio=ON
set _Mondo=OFF
set _O365=ON
set _O365PP=ON
set _Pro=OFF
set _Std=OFF
set _PrjPro=OFF
@ -436,7 +421,7 @@ if errorlevel 1 goto :MenuSuite @@ -436,7 +421,7 @@ if errorlevel 1 goto :MenuSuite
goto :MenuInitial
:MenuSuite
if %_O365%==OFF if %_Pro%==OFF if %_Std%==OFF if %_Mondo%==OFF if %_PrjPro%==OFF if %_PrjStd%==OFF if %_VisPro%==OFF if %_VisStd%==OFF set _O365=ON
if %_O365PP%==OFF if %_Pro%==OFF if %_Std%==OFF if %_Mondo%==OFF if %_PrjPro%==OFF if %_PrjStd%==OFF if %_VisPro%==OFF if %_VisStd%==OFF set _O365PP=ON
cls
echo %line%
echo Source : "!CTRsource!"
@ -444,7 +429,7 @@ echo Version : %CTRver% / Arch: %CTRarc% / Lang: %CTRlng% @@ -444,7 +429,7 @@ echo Version : %CTRver% / Arch: %CTRarc% / Lang: %CTRlng%
echo %line%
echo Select Products to Install:
echo.
echo. 1. Office 365 ProPlus : %_O365%
echo. 1. Office 365 ProPlus : %_O365PP%
echo. 2. Office Mondo 2016 : %_Mondo%
if %_O2019%==1 (
echo. 3. Office ProPlus 2019 : %_Pro%
@ -464,10 +449,10 @@ if errorlevel 8 (if %_O2019%==1 (if %_VisStd%==ON (set _VisStd=OFF) else if %_Mo @@ -464,10 +449,10 @@ if errorlevel 8 (if %_O2019%==1 (if %_VisStd%==ON (set _VisStd=OFF) else if %_Mo
if errorlevel 7 (if %_O2019%==1 (if %_VisPro%==ON (set _VisPro=OFF) else if %_Mondo%==OFF (set _VisPro=ON&set _VisStd=OFF)))&goto :MenuSuite
if errorlevel 6 (if %_O2019%==1 (if %_PrjStd%==ON (set _PrjStd=OFF) else if %_Mondo%==OFF (set _PrjPro=OFF&set _PrjStd=ON)))&goto :MenuSuite
if errorlevel 5 (if %_O2019%==1 (if %_PrjPro%==ON (set _PrjPro=OFF) else if %_Mondo%==OFF (set _PrjPro=ON&set _PrjStd=OFF)))&goto :MenuSuite
if errorlevel 4 (if %_O2019%==1 (if %_Std%==ON (set _Std=OFF) else (set _Std=ON&set _Mondo=OFF&set _O365=OFF&set _Pro=OFF)))&goto :MenuSuite
if errorlevel 3 (if %_O2019%==1 (if %_Pro%==ON (set _Pro=OFF) else (set _Pro=ON&set _Mondo=OFF&set _O365=OFF&set _Std=OFF)))&goto :MenuSuite
if errorlevel 2 (if %_Mondo%==ON (set _Mondo=OFF) else (set _Mondo=ON&set _O365=OFF&set _Pro=OFF&set _Std=OFF&set _PrjPro=OFF&set _PrjStd=OFF&set _VisPro=OFF&set _VisStd=OFF))&goto :MenuSuite
if errorlevel 1 (if %_O365%==ON (set _O365=OFF) else (set _O365=ON&set _Mondo=OFF&set _Pro=OFF&set _Std=OFF))&goto :MenuSuite
if errorlevel 4 (if %_O2019%==1 (if %_Std%==ON (set _Std=OFF) else (set _Std=ON&set _Mondo=OFF&set _O365PP=OFF&set _Pro=OFF)))&goto :MenuSuite
if errorlevel 3 (if %_O2019%==1 (if %_Pro%==ON (set _Pro=OFF) else (set _Pro=ON&set _Mondo=OFF&set _O365PP=OFF&set _Std=OFF)))&goto :MenuSuite
if errorlevel 2 (if %_Mondo%==ON (set _Mondo=OFF) else (set _Mondo=ON&set _O365PP=OFF&set _Pro=OFF&set _Std=OFF&set _PrjPro=OFF&set _PrjStd=OFF&set _VisPro=OFF&set _VisStd=OFF))&goto :MenuSuite
if errorlevel 1 (if %_O365PP%==ON (set _O365PP=OFF) else (set _O365PP=ON&set _Mondo=OFF&set _Pro=OFF&set _Std=OFF))&goto :MenuSuite
goto :MenuSuite
:MenuApps
@ -529,7 +514,7 @@ set "_pkey%%J=" @@ -529,7 +514,7 @@ set "_pkey%%J="
)
set /a cc=0
set /a kk=0
if %_O365%==ON (
if %_O365PP%==ON (
set _suite=O365ProPlusRetail&set _suit2=MondoVolume
set _pkey0=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2
) else if %_Pro%==ON (
@ -624,7 +609,7 @@ set _pkey!kk!=PBX3G-NWMT6-Q7XBW-PYJGG-WXD33 @@ -624,7 +609,7 @@ set _pkey!kk!=PBX3G-NWMT6-Q7XBW-PYJGG-WXD33
)
if %_OneNote%==ON (
set /a cc+=1
set _sku!cc!=OneNoteVolume
if %winbuild% lss 10240 (set _sku!cc!=OneNoteRetail&set /a cc+=1&set _sku!cc!=OneNoteVolume) else (set _sku!cc!=OneNoteVolume)
set /a kk+=1
set _pkey!kk!=DR92N-9HTF2-97XKM-XW2WJ-XW3J6
)
@ -718,11 +703,11 @@ echo Select Update Channel: @@ -718,11 +703,11 @@ echo Select Update Channel:
echo.
echo. 0. Default
echo. 1. Insiders ^| Insiders::DevMain
echo. 2. Monthly / Targeted ^| Insiders::CC
echo. 2. Monthly [Targeted] ^| Insiders::CC
echo. 3. Monthly ^| Production::CC
echo. 4. Semi-Annual / Targeted ^| Insiders::FRDC
echo. 4. Semi-Annual [Targeted] ^| Insiders::FRDC
echo. 5. Semi-Annual ^| Production::DC
echo. 6. Perpetual2019 VL / Targeted ^| Insiders::LTSC
echo. 6. Perpetual2019 VL [Targeted] ^| Insiders::LTSC
echo. 7. Perpetual2019 VL ^| Production::LTSC
echo.
echo. D. DevMain Channel ^| Dogfood::DevMain
@ -745,13 +730,13 @@ goto :MenuChannel @@ -745,13 +730,13 @@ goto :MenuChannel
:MenuChannel2
if %inpt%==0 (
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_tempdir!" >nul
for /f "tokens=3 delims=<= " %%# in ('findstr /i DeliveryMechanism "!_tempdir!\VersionDescriptor.xml" 2^>nul') do set "FFNRoot=%%~#"
expand.exe -f:*.xml "!CTRsource!\Office\Data\%CTRvcab%" "!_temp!" >nul
for /f "tokens=3 delims=<= " %%# in ('findstr /i DeliveryMechanism "!_temp!\VersionDescriptor.xml" 2^>nul') do set "FFNRoot=%%~#"
if "!FFNRoot!" neq "" for /l %%J in (1,1,9) do (
if /i !FFNRoot! equ !ffn%%J! set inpt=%%J
)
if "!FFNRoot!" equ "" set inpt=3
del /f /q "!_tempdir!\*.xml" 1>nul 2>nul
del /f /q "!_temp!\*.xml" 1>nul 2>nul
)
set "CTRffn=!ffn%inpt%!"
set "CTRchn=!chn%inpt%!"
@ -765,7 +750,7 @@ set "_tmp=" @@ -765,7 +750,7 @@ set "_tmp="
if defined _suite (
set "_products=%_suite%.16_%CTRlng%_x-none"
set "_keys=%_pkey0%"
if %_O365%==ON set "_keys=!_keys!,DRNV7-VGMM2-B3G9T-4BF84-VMFTK"
if %_O365PP%==ON set "_keys=!_keys!,DRNV7-VGMM2-B3G9T-4BF84-VMFTK"
)
if defined _suit2 set "_licenses=%_suit2%"
if not defined _sku1 goto :MenuMisc
@ -777,17 +762,16 @@ if defined _keys (set "_keys=!_keys!,!_pkey%%J!") else (set "_keys=!_pkey%%J!") @@ -777,17 +762,16 @@ if defined _keys (set "_keys=!_keys!,!_pkey%%J!") else (set "_keys=!_pkey%%J!")
)
for %%J in (%_skus%) do (
set _tmp=%%J
if /i "!_tmp:~-6!"=="Volume" (
if /i "!_tmp:~-6!"=="Volume" if %winbuild% geq 10240 (
if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
if /i "!_tmp:~-6!"=="Volume" if %winbuild% lss 10240 (
if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
if defined _licenses (set "_licenses=!_licenses!,%%J") else (set "_licenses=%%J")
)
if /i "!_tmp:~-6!"=="Volume" if %winbuild% geq 10240 (
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
if /i "!_tmp:~-6!"=="Retail" (
if /i "!_tmp:~-6!"=="Retail" if %winbuild% lss 10240 (
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
@ -862,13 +846,8 @@ goto :MenuFinal @@ -862,13 +846,8 @@ goto :MenuFinal
:MenuFinal2
cls
set "MyDate="
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
copy /y nul "!_workdir!\#.rw" 1>nul 2>nul && (
if exist "!_workdir!\#.rw" del /f /q "!_workdir!\#.rw"
) || (
set "_inipath=%SystemDrive%\Users\Public\Desktop"
)
for /f "tokens=2 delims==." %%# in ('wmic os get localdatetime /value') do set "_date=%%#"
copy /y nul "!_work!\#.rw" 1>nul 2>nul && (if exist "!_work!\#.rw" del /f /q "!_work!\#.rw") || (set "_ini=!_dsk!")
(
echo [configuration]
@ -883,32 +862,32 @@ if defined CTRprm echo Primary=%CTRstp%,%CTRprm% @@ -883,32 +862,32 @@ if defined CTRprm echo Primary=%CTRstp%,%CTRprm%
echo Channel=%CTRchn%
echo CDN=%CTRffn%
if defined _suite (
echo Suite=%_suite%
if defined _suit2 echo Suite2=%_suit2%
if defined _suit2 (
if /i not "%_suit2%"=="MondoVolume" (echo Suite=%_suit2%) else (echo Suite=%_suite%)
) else (
echo Suite=%_suite%
)
echo ExcludedApps=%_excluded%
)
if defined _skus (
echo SKUs=%_skus%
echo SKUs=%_show%
if not defined _suite if %_OneDrive%==OFF echo ExcludedApps=OneDrive
)
echo UpdatesEnabled=%_updt%
echo AcceptEULA=%_eula%
echo PinIconsToTaskbar=%_icon%
echo ForceAppShutdown=%_shut%
echo DisplayLevel=%_disp%
echo AutoActivate=%_actv%
echo DisableTelemetry=%_tele%
echo DisplayLevel=%_disp%
echo AutoInstallation=%_unattend%
)>"!_inipath!\C2R_Config_%MyDate:~0,8%-%MyDate:~8,4%.ini" 2>nul
)>"!_ini!\C2R_Config_%_date:~0,8%-%_date:~8,4%.ini" 2>nul
if %_install%==False (
echo %line%
echo Done
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
:MenuInstall
@ -941,17 +920,18 @@ echo mediatype.16=%CTRtype% sourcetype.16=%CTRtype% version.16=%CTRver% ^^ @@ -941,17 +920,18 @@ echo mediatype.16=%CTRtype% sourcetype.16=%CTRtype% version.16=%CTRver% ^^
echo baseurl.16="!CTRsource!" ^^^^
echo productstoadd="%_products%" ^^
if %winbuild% geq 10240 echo pidkeys=%_keys% %_autoact% ^^
if %winbuild% lss 10240 if /i "%_suite%"=="MondoVolume" echo pidkeys=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2 %_autoact% ^^
if defined _suite echo %_suite%.excludedapps.16=%_excluded% ^^
if defined _exclude1d echo %_exclude1d% ^^
echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt.useoutlookshareaddon=disabled 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannel /t REG_SZ /d "%_url%/%CTRffn%" 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannelChanged /t REG_SZ /d True 1^>nul 2^>nul
echo exit /b
)>"!_tempdir!\C2R_Setup.bat"
)>"!_temp!\C2R_Setup.bat"
set "CTRexe=1"
if exist "!_file!" for /f "tokens=2-5 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i%%j%%k%%l geq %CTRver:.=% (set CTRexe=0)
if exist "!_file!" for /f "tokens=4 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i geq %verchk% (set CTRexe=0)
)
call :StopService 1>nul 2>nul
if %CTRexe%==1 (
@ -965,19 +945,16 @@ echo %line% @@ -965,19 +945,16 @@ echo %line%
echo Running installation...
echo %line%
echo.
del /f /q "%windir%\temp\*.log" 1>nul 2>nul
del /f /q "!_tempdir!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_tempdir!\C2R_Setup.bat" "
del /f /q "!_tempdir!\C2R_Setup.bat" 1>nul 2>nul
del /f /q "%SystemRoot%\temp\*.log" 1>nul 2>nul
del /f /q "!_temp!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_temp!\C2R_Setup.bat" "
del /f /q "!_temp!\C2R_Setup.bat" 1>nul 2>nul
if not exist "!_Program!\Microsoft Office\root\Office16\*.dll" if not exist "%ProgramFiles(x86)%\Microsoft Office\root\Office16\*.dll" (
echo.
echo %line%
echo Installation failed.
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
if %_Mondo%==ON (
set "_licenses=O365ProPlusRetail"
@ -1011,12 +988,11 @@ goto :eof @@ -1011,12 +988,11 @@ goto :eof
:StopService
sc query WSearch | find /i "STOPPED" || net stop WSearch /y
sc query WSearch | find /i "STOPPED" || sc stop WSearch
if exist "!_file!" (
if not exist "!_file!" exit /b
sc query ClickToRunSvc | find /i "STOPPED" || net stop ClickToRunSvc /y
sc query ClickToRunSvc | find /i "STOPPED" || sc stop ClickToRunSvc
taskkill /t /f /IM OfficeC2RClient.exe
taskkill /t /f /IM OfficeClickToRun.exe
)
exit /b
:Licenses
@ -1034,12 +1010,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1 @@ -1034,12 +1010,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1
exit /b
:Telemetry
if %wow64%==1 (set "_inter=Software\Wow6432Node") else (set "_inter=Software")
set "_inter=Software"
if %wow64%==1 (set "_inter=Software\Wow6432Node")
set "_rkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings"
set "_skey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\16.0"
set "_tkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\Common\ClientTelemetry"
for %%# in (Count,Order) do reg add "%_rkey%" /f /v %%# /t REG_DWORD /d 1
for %%# in (DisableTelemetry,SendTelemetry) do reg add "%_tkey%" /f /v %%# /t REG_DWORD /d 1
reg add "%_tkey%" /f /v SendTelemetry /t REG_DWORD /d 3
reg add "%_tkey%" /f /v DisableTelemetry /t REG_DWORD /d 1
for %%# in (disconnectedstate,usercontentdisabled,downloadcontentdisabled,controllerconnectedservicesenabled) do reg add "%_skey%\Common\Privacy" /f /v %%# /t REG_DWORD /d 2
for %%# in (qmenable,sendcustomerdata,updatereliabilitydata) do reg add "%_skey%\Common" /f /v %%# /t REG_DWORD /d 0
for %%# in (disableboottoofficestart,optindisable,shownfirstrunoptin,ShownFileFmtPrompt) do reg add "%_skey%\Common\General" /f /v %%# /t REG_DWORD /d 1
for %%# in (BootedRTM,disablemovie) do reg add "%_skey%\Firstrun" /f /v %%# /t REG_DWORD /d 1
@ -1062,25 +1041,21 @@ set "_schedule=Microsoft\Office" @@ -1062,25 +1041,21 @@ set "_schedule=Microsoft\Office"
exit /b
:E_VER
echo ==== ERROR ====
echo %_err%
echo Minimum Supported Version is 16.0.9029.2167
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Admin
echo ==== ERROR ====
echo %_err%
echo Right click on this script and select 'Run as administrator'
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Win
echo ==== ERROR ====
echo %_err%
echo Windows 7 SP1 is the minimum supported OS.
:TheEnd
echo.
echo Press any key to exit...
echo Press any key to exit.
pause >nul
goto :eof

186
YAOCTRI/YAOCTRI_Installer.cmd

@ -1,26 +1,28 @@ @@ -1,26 +1,28 @@
@setlocal DisableDelayedExpansion
@echo off
set "SysPath=%Windir%\System32"
if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative")
set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "SysPath=%SystemRoot%\System32"
if exist "%SystemRoot%\Sysnative\reg.exe" (set "SysPath=%SystemRoot%\Sysnative")
set "Path=%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\"
set "_err===== ERROR ===="
set "xOS=x64"
set "_ComSpec=%Windir%\System32\cmd.exe"
set "_ComSpec=%SystemRoot%\System32\cmd.exe"
set "_Common=%CommonProgramFiles%"
set "_Program=%ProgramFiles%"
if /i %PROCESSOR_ARCHITECTURE%==x86 (
if not defined PROCESSOR_ARCHITEW6432 set "xOS=x86"
if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%Windir%\Sysnative\cmd.exe"
if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 (
set "_ComSpec=%SystemRoot%\Sysnative\cmd.exe"
set "_Common=%CommonProgramW6432%"
set "_Program=%ProgramW6432%"
) else (
set "xOS=x86"
)
)
set "_target=%_Common%\Microsoft Shared\ClickToRun"
set "_file=%_target%\OfficeClickToRun.exe"
set "_tempdir=%temp%"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
setlocal EnableDelayedExpansion
set "_temp=%temp%"
set "_work=%~dp0"
set "_work=%_work:~0,-1%"
reg query HKU\S-1-5-19 >nul 2>&1 || goto :E_Admin
setlocal EnableDelayedExpansion
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
if %winbuild% lss 7601 goto :E_Win
title Office Click-to-Run Installer - Volume
@ -33,18 +35,20 @@ set _actv=False @@ -33,18 +35,20 @@ set _actv=False
set _tele=True
set _unattend=False
set "line=============================================================="
if exist "!_workdir!\C2R*.ini" for /f %%# in ('dir /b /s "!_workdir!\C2R*.ini"') do (set "C2Rconfig=%%#"&goto :check)
if exist "!_work!\C2R_*.ini" for /f "tokens=* delims=" %%# in ('dir /b "!_work!\C2R_*.ini"') do set "C2Rconfig=!_work!\%%#"
if defined C2Rconfig goto :check
:prompt
cls
set "C2Rconfig="
set C2Rconfig=
echo %line%
echo Enter C2R_Config ini file path
echo %line%
echo.
set /p "C2Rconfig="
if "%C2Rconfig%"=="" goto :eof
goto :check
set /p C2Rconfig=
if not defined C2Rconfig goto :eof
set "C2Rconfig=%C2Rconfig:"=%"
if not exist "!C2Rconfig!" goto :eof
:check
findstr /i \[configuration\] "!C2Rconfig!" 1>nul 2>nul || goto :prompt
@ -94,36 +98,30 @@ CTRcul @@ -94,36 +98,30 @@ CTRcul
CTRffn
) do if not defined %%# (
echo.
echo ==== ERROR ====
echo %_err%
echo Could not detect %%# in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if not defined _suite if not defined _skus (
echo.
echo ==== ERROR ====
echo %_err%
echo Could not detect products in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
)
if defined CTRsource if exist "!CTRsource!\Office\Data\*.cab" (
goto :check3
) else (
set "CTRsource="
)
if exist "!_workdir!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Office\Data\" 2^>nul') do if exist "!_workdir!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%_workdir%"
if exist "!_work!\Office\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Office\Data\" 2^>nul') do if exist "!_work!\Office\Data\%%#\stream*.dat" (
set "CTRsource=%~dp0"
)
)
if defined CTRsource goto :check3
if exist "!_workdir!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_workdir!\Data\" 2^>nul') do if exist "!_workdir!\Data\%%#\stream*.dat" (
call :get_path "!_workdir!\..\"
if exist "!_work!\Data\*.cab" (
for /f %%# in ('dir /b /ad "!_work!\Data\" 2^>nul') do if exist "!_work!\Data\%%#\stream*.dat" (
for /D %%G in ("!_work!\..\") do set "CTRsource=%%~dpG"
)
)
if defined CTRsource goto :check3
@ -132,20 +130,11 @@ if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\" @@ -132,20 +130,11 @@ if exist "%%#:\Office\Data\*.cab" set "CTRsource=%%#:\"
)
if defined CTRsource goto :check3
echo ==== ERROR ====
echo %_err%
echo Could not detect C2R source in the specified config file
echo.
echo Press any key to exit...
pause >nul
goto :eof
:get_path
endlocal
set "CTRsource=%~dp1"
exit /b
goto :TheEnd
:check3
setlocal EnableDelayedExpansion
if "!CTRsource:~-1!"=="\" set "CTRsource=!CTRsource:~0,-1!"
copy /y nul "!CTRsource!\Office\#.rw" 1>nul 2>nul && (
set CTRtype=Local
@ -155,13 +144,14 @@ set CTRtype=DVD @@ -155,13 +144,14 @@ set CTRtype=DVD
)
if "!CTRsource:~0,2!"=="\\" set CTRtype=UNC
if /i %xOS%==x86 (set CTRarc=x86) else (if /i %CTRarc%==x86 set wow64=1)
if /i %CTRarc%==x86 (set CTRbit=32) else (set CTRbit=64)
set CTRvcab=v%CTRbit%_%CTRver%.cab
set CTRicab=i%CTRbit%0.cab
set CTRscab=s%CTRbit%0.cab
set CTRicabr=i%CTRbit%%CTRcul%.cab
set CTRscabr=s%CTRbit%%CTRcul%.cab
if /i %CTRarc%==x64 if %wow64%==1 (
if /i %xOS%==x64 (
set CTRicab=i640.cab
set CTRicabr=i64%CTRcul%.cab
)
@ -177,42 +167,56 @@ stream.%CTRarc%.%CTRstp%.dat @@ -177,42 +167,56 @@ stream.%CTRarc%.%CTRstp%.dat
if not exist "!CTRsource!\Office\Data\%CTRver%\%%#" set "ERRFILE=%%#"&goto :E_FILE
)
if defined _suite (
set _O365=0
set _OneDrive=ON
if defined _excluded (
echo %_excluded%| findstr /i "OneDrive" 1>nul && set _OneDrive=OFF
)
if not defined _suite goto :sku
if %winbuild% lss 10240 (
if /i "%_suite%"=="O365ProPlusRetail" set _suit2=MondoVolume
if /i "%_suite%"=="ProPlus2019Volume" (set _suite=O365ProPlusRetail&set _suit2=ProPlus2019Volume)
if /i "%_suite%"=="Standard2019Volume" (set _suite=StandardRetail&set _suit2=Standard2019Volume)
)
if %winbuild% geq 10240 (
if /i "%_suite%"=="O365ProPlusRetail" set _suit2=MondoVolume
)
set "_products=%_suite%.16_%CTRlng%_x-none"
if /i "%_suite%"=="ProPlus2019Volume" set _pkey0=NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
if /i "%_suite%"=="Standard2019Volume" set _pkey0=6NWWJ-YQWMR-QKGCB-6TMB3-9D9HK
if /i "%_suite%"=="MondoVolume" set _pkey0=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2
)
if defined _suit2 (
set "_licenses=%_suit2%"
if /i "%_suit2%"=="ProPlus2019Volume" set _pkey0=NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
if /i "%_suit2%"=="Standard2019Volume" set _pkey0=6NWWJ-YQWMR-QKGCB-6TMB3-9D9HK
if /i "%_suit2%"=="MondoVolume" set _pkey0=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2,DRNV7-VGMM2-B3G9T-4BF84-VMFTK
)
set _OneDrive=ON
if defined _excluded (
echo %_excluded%| findstr /i "OneDrive" 1>nul && set _OneDrive=OFF
if /i "%_suit2%"=="MondoVolume" set "_pkey0=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2,DRNV7-VGMM2-B3G9T-4BF84-VMFTK"&set _O365=1
)
if defined _pkey0 set "_keys=%_pkey0%"
if not defined _skus goto :MenuFinal
:sku
set _base=0
set /a kk=0
for %%J in (%_skus%) do (
set _tmp=%%J
if /i "!_tmp:~-6!"=="Volume" (
if /i "!_tmp:~-6!"=="Volume" if %winbuild% geq 10240 (
if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
if /i "!_tmp:~-6!"=="Volume" if %winbuild% lss 10240 (
if defined _show (set "_show=!_show!,%%J") else (set "_show=%%J")
if defined _licenses (set "_licenses=!_licenses!,%%J") else (set "_licenses=%%J")
)
if /i "!_tmp:~-6!"=="Volume" if %winbuild% geq 10240 (
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
)
if /i "!_tmp:~-6!"=="Retail" (
if /i "!_tmp:~-6!"=="Retail" if %winbuild% lss 10240 (
if defined _products (set "_products=!_products!^|%%J.16_%CTRlng%_x-none") else (set "_products=%%J.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! %%J.excludedapps.16=onedrive") else (set "_exclude1d=%%J.excludedapps.16=onedrive"))
set _base=1
)
if /i "%%J"=="Access2019Volume" (set /a kk+=1&set _pkey!kk!=9N9PT-27V4Y-VJ2PD-YXFMF-YTFQT)
if /i "%%J"=="Excel2019Volume" (set /a kk+=1&set _pkey!kk!=TMJWT-YYNMB-3BKTF-644FC-RVXBD)
@ -228,6 +232,13 @@ if /i "%%J"=="VisioPro2019Volume" (set /a kk+=1&set _pkey!kk!=9BGNQ-K37YR-RQHF2- @@ -228,6 +232,13 @@ if /i "%%J"=="VisioPro2019Volume" (set /a kk+=1&set _pkey!kk!=9BGNQ-K37YR-RQHF2-
if /i "%%J"=="VisioStd2019Volume" (set /a kk+=1&set _pkey!kk!=7TQNQ-K3YQQ-3PFH7-CCPPM-X4VQ2)
)
if %winbuild% lss 10240 if %_base% equ 0 for %%J in (%_skus%) do (
set _tmp=%%J
if /i "!_tmp:~-10!"=="2019Volume" (call set _tmp=!_tmp:~0,-10!Retail) else (call set _tmp=!_tmp:~0,-6!Retail)
if defined _products (set "_products=!_products!^|!_tmp!.16_%CTRlng%_x-none") else (set "_products=!_tmp!.16_%CTRlng%_x-none")
if %_OneDrive%==OFF (if defined _exclude1d (set "_exclude1d=!_exclude1d! !_tmp!.excludedapps.16=onedrive") else (set "_exclude1d=!_tmp!.excludedapps.16=onedrive"))
)
for /l %%J in (1,1,%kk%) do (
if defined _keys (set "_keys=!_keys!,!_pkey%%J!") else (set "_keys=!_pkey%%J!")
)
@ -293,17 +304,19 @@ echo mediatype.16=%CTRtype% sourcetype.16=%CTRtype% version.16=%CTRver% ^^ @@ -293,17 +304,19 @@ echo mediatype.16=%CTRtype% sourcetype.16=%CTRtype% version.16=%CTRver% ^^
echo baseurl.16="!CTRsource!" ^^^^
echo productstoadd="%_products%" ^^
if %winbuild% geq 10240 echo pidkeys=%_keys% %_autoact% ^^
if %winbuild% lss 10240 if /i "%_suite%"=="MondoVolume" echo pidkeys=HFTND-W9MK4-8B7MJ-B6C4G-XQBR2 %_autoact% ^^
if defined _suite echo %_suite%.excludedapps.16=%_excluded% ^^
if defined _exclude1d echo %_exclude1d% ^^
echo flt.useexptransportinplacepl=disabled flt.useofficehelperaddon=disabled flt.useoutlookshareaddon=disabled 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannel /t REG_SZ /d "%_url%/%CTRffn%" 1^>nul 2^>nul
echo reg.exe add %_Config% /f /v UpdateChannelChanged /t REG_SZ /d True 1^>nul 2^>nul
echo exit /b
)>"!_tempdir!\C2R_Setup.bat"
)>"!_temp!\C2R_Setup.bat"
for /f "tokens=3 delims=." %%# in ('echo %CTRver%') do set verchk=%%#
set "CTRexe=1"
if exist "!_file!" for /f "tokens=2-5 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i%%j%%k%%l geq %CTRver:.=% (set CTRexe=0)
if exist "!_file!" for /f "tokens=4 delims==." %%i in ('wmic datafile where "name='!_file:\=\\!'" get Version /value') do (
if %%i geq %verchk% (set CTRexe=0)
)
call :StopService 1>nul 2>nul
if %CTRexe%==1 (
@ -317,19 +330,16 @@ echo %line% @@ -317,19 +330,16 @@ echo %line%
echo Running installation...
echo %line%
echo.
del /f /q "%windir%\temp\*.log" 1>nul 2>nul
del /f /q "!_tempdir!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_tempdir!\C2R_Setup.bat" "
del /f /q "!_tempdir!\C2R_Setup.bat" 1>nul 2>nul
del /f /q "%SystemRoot%\temp\*.log" 1>nul 2>nul
del /f /q "!_temp!\*.log" 1>nul 2>nul
!_ComSpec! /c ""!_temp!\C2R_Setup.bat" "
del /f /q "!_temp!\C2R_Setup.bat" 1>nul 2>nul
if not exist "!_Program!\Microsoft Office\root\Office16\*.dll" if not exist "%ProgramFiles(x86)%\Microsoft Office\root\Office16\*.dll" (
echo.
echo %line%
echo Installation failed.
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
goto :TheEnd
)
if defined _licenses (
echo.
@ -339,12 +349,8 @@ echo %line% @@ -339,12 +349,8 @@ echo %line%
echo.
call :Licenses 1>nul 2>nul
)
if %_tele%==True (
if defined _suit2 (
if /i not "%_suit2%"=="MondoVolume" call :Telemetry 1>nul 2>nul
) else (
call :Telemetry 1>nul 2>nul
)
if %_tele%==True if %_O365%==0 (
call :Telemetry 1>nul 2>nul
)
if %_unattend%==True goto :eof
echo.
@ -360,12 +366,11 @@ goto :eof @@ -360,12 +366,11 @@ goto :eof
:StopService
sc query WSearch | find /i "STOPPED" || net stop WSearch /y
sc query WSearch | find /i "STOPPED" || sc stop WSearch
if exist "!_file!" (
if not exist "!_file!" exit /b
sc query ClickToRunSvc | find /i "STOPPED" || net stop ClickToRunSvc /y
sc query ClickToRunSvc | find /i "STOPPED" || sc stop ClickToRunSvc
taskkill /t /f /IM OfficeC2RClient.exe
taskkill /t /f /IM OfficeClickToRun.exe
)
exit /b
:Licenses
@ -383,12 +388,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1 @@ -383,12 +388,15 @@ reg add %_Config% /f /v %%J.OSPPReady /t REG_SZ /d 1
exit /b
:Telemetry
if /i %CTRarc%==x64 if %wow64%==1 (set "_inter=Software\Wow6432Node") else (set "_inter=Software")
set "_inter=Software"
if /i %xOS%==x64 if %wow64%==1 (set "_inter=Software\Wow6432Node")
set "_rkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings"
set "_skey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\16.0"
set "_tkey=%_CTR%\REGISTRY\MACHINE\%_inter%\Microsoft\Office\16.0\User Settings\CustomSettings\Create\Software\Microsoft\Office\Common\ClientTelemetry"
for %%# in (Count,Order) do reg add "%_rkey%" /f /v %%# /t REG_DWORD /d 1
for %%# in (DisableTelemetry,SendTelemetry) do reg add "%_tkey%" /f /v %%# /t REG_DWORD /d 1
reg add "%_tkey%" /f /v SendTelemetry /t REG_DWORD /d 3
reg add "%_tkey%" /f /v DisableTelemetry /t REG_DWORD /d 1
for %%# in (disconnectedstate,usercontentdisabled,downloadcontentdisabled,controllerconnectedservicesenabled) do reg add "%_skey%\Common\Privacy" /f /v %%# /t REG_DWORD /d 2
for %%# in (qmenable,sendcustomerdata,updatereliabilitydata) do reg add "%_skey%\Common" /f /v %%# /t REG_DWORD /d 0
for %%# in (disableboottoofficestart,optindisable,shownfirstrunoptin,ShownFileFmtPrompt) do reg add "%_skey%\Common\General" /f /v %%# /t REG_DWORD /d 1
for %%# in (BootedRTM,disablemovie) do reg add "%_skey%\Firstrun" /f /v %%# /t REG_DWORD /d 1
@ -411,25 +419,21 @@ set "_schedule=Microsoft\Office" @@ -411,25 +419,21 @@ set "_schedule=Microsoft\Office"
exit /b
:E_FILE
echo ==== ERROR ====
echo %_err%
echo %ERRFILE% is missing in the specified source
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Admin
echo ==== ERROR ====
echo %_err%
echo Right click on this script and select 'Run as administrator'
echo.
echo Press any key to exit...
pause >nul
goto :eof
goto :TheEnd
:E_Win
echo ==== ERROR ====
echo %_err%
echo Windows 7 SP1 is the minimum supported OS.
:TheEnd
echo.
echo Press any key to exit...
echo Press any key to exit.
pause >nul
goto :eof

214
YAOCTRI/YAOCTRU_Generator.cmd

@ -1,14 +1,20 @@ @@ -1,14 +1,20 @@
@setlocal DisableDelayedExpansion
@echo off
:: 1 = check and return the highest available build for the choosen channel (some builds are conditional)
:: 0 = check and return the default available build for the choosen channel
set AllBuilds=0
:: set version choice to always latest available online
set latest=1
:: set specific valid version
set version=
set "_tempdir=%temp%"
set "_workdir=%~dp0"
if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%"
set "_temp=%temp%"
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
setlocal EnableDelayedExpansion
pushd "!_work!"
set /a cc=0
for %%A in (en-US,ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,es-ES,et-EE) do (
set /a cc+=1
@ -73,11 +79,11 @@ echo %line% @@ -73,11 +79,11 @@ echo %line%
echo.
echo Official CDNs:
echo. 1. Insiders ^| Insiders::DevMain
echo. 2. Monthly / Targeted ^| Insiders::CC
echo. 2. Monthly [Targeted] ^| Insiders::CC
echo. 3. Monthly ^| Production::CC
echo. 4. Semi-Annual / Targeted ^| Insiders::FRDC
echo. 4. Semi-Annual [Targeted] ^| Insiders::FRDC
echo. 5. Semi-Annual ^| Production::DC
echo. 6. Perpetual2019 VL / Targeted ^| Insiders::LTSC
echo. 6. Perpetual2019 VL [Targeted] ^| Insiders::LTSC
echo. 7. Perpetual2019 VL ^| Production::LTSC
echo.
echo Testing CDNs:
@ -143,22 +149,34 @@ echo Checking available version . . . @@ -143,22 +149,34 @@ echo Checking available version . . .
echo %line%
echo.
set "dms=https://mrodevicemgr.officeapps.live.com/mrodevicemgrsvc/api/v2/C2RReleaseData"
if exist "!_tempdir!\C2R.json" del /f /q "!_tempdir!\C2R.json"
1>nul 2>nul powershell -NoLogo -NoProfile -ExecutionPolicy Bypass (New-Object Net.WebClient).DownloadFile('%dms%?audienceFFN=%ffn%', '"!_tempdir!\C2R.json"')
if not exist "!_tempdir!\C2R.json" (
pushd "!_temp!"
if exist "C2R.json" del /f /q "C2R.json"
if %AllBuilds%==1 (
1>nul 2>nul powershell -nop -ep bypass -c "(New-Object Net.WebClient).DownloadFile('%dms%','C2R.json')"
) else (
1>nul 2>nul powershell -nop -ep bypass -c "(New-Object Net.WebClient).DownloadFile('%dms%?audienceFFN=%ffn%','C2R.json')"
)
if not exist "C2R.json" (
echo.
echo %line%
echo ERROR: could not check available version online
echo verify internet connection and powershell is not disabled
echo ERROR:
echo could not check available version online
echo check internet connection and if powershell is disabled
echo %line%
echo.
echo Press any key to exit.
pause >nul
goto :eof
)
for /f "usebackq tokens=2 delims=:, " %%G in (`findstr /i AvailableBuild "!_tempdir!\C2R.json"`) do set "vvv=%%~G"
for /f "usebackq tokens=2-6 delims=:/ " %%G in (`findstr /i TimestampUtc "!_tempdir!\C2R.json"`) do set "utc=%%I-%%~G-%%H %%J:%%K
del /f /q "!_tempdir!\C2R.json"
if %AllBuilds%==1 (
for /f "tokens=* delims=" %%i in ('powershell -nop -ep bypass -c "(([IO.File]::ReadAllText('C2R.json') | ConvertFrom-Json) | ? FFN -eq '%ffn%').AvailableBuild | sort" 2^>nul') do set "vvv=%%i"
for /f "tokens=1-3 delims=T:" %%i in ('powershell -nop -ep bypass -c "(([IO.File]::ReadAllText('C2R.json') | ConvertFrom-Json) | ? FFN -eq '%ffn%').UpdatedTimeUtc | sort" 2^>nul') do set "utc=%%i %%j:%%k"
) else (
for /f "usebackq tokens=2 delims=:, " %%G in (`findstr /i AvailableBuild C2R.json`) do set "vvv=%%~G"
for /f "usebackq tokens=2-6 delims=:/ " %%G in (`findstr /i TimestampUtc C2R.json`) do set "utc=%%I-%%~G-%%H %%J:%%K
)
del /f /q "C2R.json"
popd
if not defined vvv (
echo.
echo %line%
@ -275,7 +293,7 @@ set /p inpt= ^> Enter Output option number, and press "Enter": @@ -275,7 +293,7 @@ set /p inpt= ^> Enter Output option number, and press "Enter":
if "%inpt%"=="" goto :eof
for /l %%i in (1,1,4) do (if %inpt%==%%i set verified=1)
if %verified%==0 goto :OUTPUT
setlocal DisableDelayedExpansion
rem setlocal DisableDelayedExpansion
set "url=http://officecdn.microsoft.com/pr/%ffn%/Office/Data"
set "stp=http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/Office/Data"
set oar=%arc%
@ -288,8 +306,7 @@ goto :OUTPUT%inpt% @@ -288,8 +306,7 @@ goto :OUTPUT%inpt%
:OUTPUT1
cls
set "output=%_workdir%\%tag%_aria2.bat"
set "outpu2=%tag%_aria2.bat"
set "output=%tag%_aria2.bat"
(
echo @echo off
echo rem Limit the download speed, example: 1M, 500K "0 = unlimited"
@ -306,12 +323,13 @@ echo set "destDir=C2R_%chn%" @@ -306,12 +323,13 @@ echo set "destDir=C2R_%chn%"
echo set "uri=temp_aria2.txt"
echo echo Downloading...
echo echo.
echo pushd "%%~dp0"
echo set "_work=%%~dp0"
echo setlocal EnableDelayedExpansion
echo if exist "!uri!" del /f /q "!uri!"
echo pushd "^!_work^!"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo call :GenTXT
echo aria2c.exe -x16 -s16 -j%%parallel%% -c -R --max-overall-download-limit=%%speedLimit%% -d"!destDir!" -i"!uri!"
echo if exist "!uri!" del /f /q "!uri!"
echo aria2c.exe -x16 -s16 -j%%parallel%% -c -R --max-overall-download-limit=%%speedLimit%% -d"%%destDir%%" -i"%%uri%%"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo echo.
echo echo Done.
echo echo Press any key to exit.
@ -331,19 +349,15 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p = @@ -331,19 +349,15 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p =
echo for /L %%%%a in ^(1,1,%%NC%%^) do ^(
echo set LN=
echo set /p LN=
echo echo^(!LN!^)
echo ^)^>"!uri!"
echo echo^(^^!LN^^!^)
echo ^)^>"%%uri%%"
echo goto TXTEnd
echo.
echo :TXTBegin
)>"%output%"
for %%a in (
v%bit%.cab
v%bit%_%vvv%.cab
) do (
(echo %url%/%%a&echo. out=Office\Data\%%a&echo.)>>"%output%"
)
(echo %url%/v%bit%_%vvv%.cab&echo. out=Office\Data\v%bit%.cab&echo.)>>"%output%"
(echo %url%/v%bit%_%vvv%.cab&echo. out=Office\Data\v%bit%_%vvv%.cab&echo.)>>"%output%"
if %proof%==1 (
for %%a in (
@ -359,11 +373,9 @@ if %dual%==0 if %arc%==x86 for %%a in ( @@ -359,11 +373,9 @@ if %dual%==0 if %arc%==x86 for %%a in (
) do (
(echo %url%/%vvv%/%%a&echo. out=Office\Data\%vvv%\%%a&echo.)>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
(echo %url%/%%a&echo. out=Office\Data\%%a&echo.)>>"%output%"
if %dual%==1 (
(echo %url%/v64_%vvv%.cab&echo. out=Office\Data\v64.cab&echo.)>>"%output%"
(echo %url%/v64_%vvv%.cab&echo. out=Office\Data\v64_%vvv%.cab&echo.)>>"%output%"
)
if %dual%==1 for %%a in (
sp64%lcid%.cab
@ -405,11 +417,9 @@ SetupLanguagePack.%arc%.%lang%.exe @@ -405,11 +417,9 @@ SetupLanguagePack.%arc%.%lang%.exe
) do (
(echo %stp%/%%a&echo. out=%%a&echo.)>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
(echo %url%/%%a&echo. out=Office\Data\%%a&echo.)>>"%output%"
if %dual%==1 (
(echo %url%/v64_%vvv%.cab&echo. out=Office\Data\v64.cab&echo.)>>"%output%"
(echo %url%/v64_%vvv%.cab&echo. out=Office\Data\v64_%vvv%.cab&echo.)>>"%output%"
)
if %dual%==1 for %%a in (
i64%lcid%.cab
@ -439,8 +449,7 @@ goto :FIN @@ -439,8 +449,7 @@ goto :FIN
:OUTPUT2
cls
set "output=%_workdir%\%tag%_wget.bat"
set "outpu2=%tag%_wget.bat"
set "output=%tag%_wget.bat"
(
echo @echo off
echo rem Limit the download speed, example: 1M, 500K "0 = unlimited"
@ -454,13 +463,16 @@ echo set "destDir=C2R_%chn%" @@ -454,13 +463,16 @@ echo set "destDir=C2R_%chn%"
echo set "uri=temp_wget.txt"
echo echo Downloading...
echo echo.
echo pushd "%%~dp0"
echo set "_work=%%~dp0"
echo setlocal EnableDelayedExpansion
echo if exist "!uri!" del /f /q "!uri!"
echo pushd "^!_work^!"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo call :GenTXT
echo wget.exe --limit-rate=%%speedLimit%% --directory-prefix="!destDir!" --input-file="!uri!" --no-verbose --show-progress --progress=bar:force:noscroll --continue --retry-connrefused --tries=5 --ignore-case --force-directories --no-host-directories --cut-dirs=2
echo if exist "!destDir!\Office\Data\SetupLanguagePack*.exe" move /y "!destDir!\Office\Data\SetupLanguagePack*.exe" "!destDir!\"
echo if exist "!uri!" del /f /q "!uri!"
echo wget.exe --limit-rate=%%speedLimit%% --directory-prefix="%%destDir%%" --input-file="%%uri%%" --no-verbose --show-progress --progress=bar:force:noscroll --continue --retry-connrefused --tries=5 --ignore-case --force-directories --no-host-directories --cut-dirs=2
echo if exist "%%destDir%%\Office\Data\v32_*.cab" xcopy /cqry %%destDir%%\Office\Data\v32_*.cab %%destDir%%\Office\Data\v32.cab*
echo if exist "%%destDir%%\Office\Data\v64_*.cab" xcopy /cqry %%destDir%%\Office\Data\v64_*.cab %%destDir%%\Office\Data\v64.cab*
echo if exist "%%destDir%%\Office\Data\SetupLanguagePack*.exe" move /y "%%destDir%%\Office\Data\SetupLanguagePack*.exe" "%%destDir%%\"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo echo.
echo echo Done.
echo echo Press any key to exit.
@ -480,19 +492,14 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p = @@ -480,19 +492,14 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p =
echo for /L %%%%a in ^(1,1,%%NC%%^) do ^(
echo set LN=
echo set /p LN=
echo echo^(!LN!^)
echo ^)^>"!uri!"
echo echo^(^^!LN^^!^)
echo ^)^>"%%uri%%"
echo goto TXTEnd
echo.
echo :TXTBegin
)>"%output%"
for %%a in (
v%bit%.cab
v%bit%_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
)
echo %url%/v%bit%_%vvv%.cab>>"%output%"
if %proof%==1 (
for %%a in (
@ -508,11 +515,8 @@ if %dual%==0 if %arc%==x86 for %%a in ( @@ -508,11 +515,8 @@ if %dual%==0 if %arc%==x86 for %%a in (
) do (
echo %url%/%vvv%/%%a>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
if %dual%==1 (
echo %url%/v64_%vvv%.cab>>"%output%"
)
if %dual%==1 for %%a in (
sp64%lcid%.cab
@ -554,11 +558,8 @@ SetupLanguagePack.%arc%.%lang%.exe @@ -554,11 +558,8 @@ SetupLanguagePack.%arc%.%lang%.exe
) do (
echo %stp%/%%a>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
if %dual%==1 (
echo %url%/v64_%vvv%.cab>>"%output%"
)
if %dual%==1 for %%a in (
i64%lcid%.cab
@ -588,8 +589,7 @@ goto :FIN @@ -588,8 +589,7 @@ goto :FIN
:OUTPUT3
cls
set "output=%_workdir%\%tag%_curl.bat"
set "outpu2=%tag%_curl.bat"
set "output=%tag%_curl.bat"
set "destDir=C2R_%chn%"
(
echo @echo off
@ -604,12 +604,13 @@ echo set "uri=temp_curl.txt" @@ -604,12 +604,13 @@ echo set "uri=temp_curl.txt"
echo if defined speedLimit set "speedLimit=--limit-rate %%speedLimit%%"
echo echo Downloading...
echo echo.
echo pushd "%%~dp0"
echo set "_work=%%~dp0"
echo setlocal EnableDelayedExpansion
echo if exist "!uri!" del /f /q "!uri!"
echo pushd "^!_work^!"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo call :GenTXT
echo curl.exe -q --create-dirs --retry 5 --retry-connrefused %%speedLimit%% -k -L -C - -K "!uri!"
echo if exist "!uri!" del /f /q "!uri!"
echo curl.exe -q --create-dirs --retry 5 --retry-connrefused %%speedLimit%% -k -L -C - -K "%%uri%%"
echo if exist "%%uri%%" del /f /q "%%uri%%"
echo echo.
echo echo Done.
echo echo Press any key to exit.
@ -629,19 +630,15 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p = @@ -629,19 +630,15 @@ echo for /L %%%%a in ^(1,1,%%SN%%^) do set /p =
echo for /L %%%%a in ^(1,1,%%NC%%^) do ^(
echo set LN=
echo set /p LN=
echo echo^(!LN!^)
echo ^)^>"!uri!"
echo echo^(^^!LN^^!^)
echo ^)^>"%%uri%%"
echo goto TXTEnd
echo.
echo :TXTBegin
)>"%output%"
for %%a in (
v%bit%.cab
v%bit%_%vvv%.cab
) do (
(echo url %url%/%%a&echo -o %destDir%\Office\Data\%%a)>>"%output%"
)
(echo url %url%/v%bit%_%vvv%.cab&echo -o %destDir%\Office\Data\v%bit%.cab)>>"%output%"
(echo url %url%/v%bit%_%vvv%.cab&echo -o %destDir%\Office\Data\v%bit%_%vvv%.cab)>>"%output%"
if %proof%==1 (
for %%a in (
@ -657,11 +654,9 @@ if %dual%==0 if %arc%==x86 for %%a in ( @@ -657,11 +654,9 @@ if %dual%==0 if %arc%==x86 for %%a in (
) do (
(echo url %url%/%vvv%/%%a&echo -o %destDir%\Office\Data\%vvv%\%%a)>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
(echo url %url%/%%a&echo -o %destDir%\Office\Data\%%a)>>"%output%"
if %dual%==1 (
(echo url %url%/v64_%vvv%.cab&echo -o %destDir%\Office\Data\v64.cab)>>"%output%"
(echo url %url%/v64_%vvv%.cab&echo -o %destDir%\Office\Data\v64_%vvv%.cab)>>"%output%"
)
if %dual%==1 for %%a in (
sp64%lcid%.cab
@ -703,11 +698,9 @@ SetupLanguagePack.%arc%.%lang%.exe @@ -703,11 +698,9 @@ SetupLanguagePack.%arc%.%lang%.exe
) do (
(echo url %stp%/%%a&echo -o %destDir%\%%a)>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
(echo url %url%/%%a&echo -o %destDir%\Office\Data\%%a)>>"%output%"
if %dual%==1 (
(echo url %url%/v64_%vvv%.cab&echo -o %destDir%\Office\Data\v64.cab)>>"%output%"
(echo url %url%/v64_%vvv%.cab&echo -o %destDir%\Office\Data\v64_%vvv%.cab)>>"%output%"
)
if %dual%==1 for %%a in (
i64%lcid%.cab
@ -737,8 +730,7 @@ goto :FIN @@ -737,8 +730,7 @@ goto :FIN
:OUTPUT4
cls
set "output=%_workdir%\%tag%.txt"
set "outpu2=%tag%.txt"
set "output=%tag%.txt"
set "outpu3=%tag%_arrange.bat"
(
echo @echo off
@ -746,7 +738,9 @@ echo set _ver=%vvv% @@ -746,7 +738,9 @@ echo set _ver=%vvv%
echo set _rot=C2R_%chn%
echo set _dst=C2R_%chn%\Office\Data
echo set _uri=%%_dst%%\%%_ver%%
echo pushd "%%~dp0"
echo set "_work=%%~dp0"
echo setlocal EnableDelayedExpansion
echo pushd "^!_work^!"
echo if not exist *.cab if not exist *.dat ^(
echo echo ==== ERROR ====
echo echo no cab or dat files detected
@ -769,31 +763,29 @@ echo ^) do ^( @@ -769,31 +763,29 @@ echo ^) do ^(
echo if exist "%%%%i" move /y %%%%i %%_uri%%\
echo ^)
echo for %%%%i in ^(
echo v32*.cab
echo v64*.cab
echo SetupLanguagePack*.exe
echo ^) do ^(
echo if exist "%%%%i" move /y %%%%i %%_dst%%\
echo if exist "%%%%i" move /y %%%%i %%_rot%%\
echo ^)
echo for %%%%i in ^(
echo SetupLanguagePack*.exe
echo v32*.cab
echo v64*.cab
echo ^) do ^(
echo if exist "%%%%i" move /y %%%%i %%_rot%%\
echo if exist "%%%%i" move /y %%%%i %%_dst%%\
echo ^)
echo if exist "%%_dst%%\v32_*.cab" xcopy /cqry %%_dst%%\v32_*.cab %%_dst%%\v32.cab*
echo if exist "%%_dst%%\v64_*.cab" xcopy /cqry %%_dst%%\v64_*.cab %%_dst%%\v64.cab*
echo echo.
echo echo Done.
echo echo Press any key to exit.
echo popd
echo pause ^>nul
echo goto :eof
)>"%_workdir%\%outpu3%"
)>"%outpu3%"
if exist "%output%" del /f /q %output%
for %%a in (
v%bit%.cab
v%bit%_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
)
echo %url%/v%bit%_%vvv%.cab>>"%output%"
if %proof%==1 (
for %%a in (
@ -809,11 +801,8 @@ if %dual%==0 if %arc%==x86 for %%a in ( @@ -809,11 +801,8 @@ if %dual%==0 if %arc%==x86 for %%a in (
) do (
echo %url%/%vvv%/%%a>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
if %dual%==1 (
echo %url%/v64_%vvv%.cab>>"%output%"
)
if %dual%==1 for %%a in (
sp64%lcid%.cab
@ -851,11 +840,8 @@ stream.%arc%.x-none.dat @@ -851,11 +840,8 @@ stream.%arc%.x-none.dat
) do (
echo %url%/%vvv%/%%a>>"%output%"
)
if %dual%==1 for %%a in (
v64.cab
v64_%vvv%.cab
) do (
echo %url%/%%a>>"%output%"
if %dual%==1 (
echo %url%/v64_%vvv%.cab>>"%output%"
)
if %dual%==1 for %%a in (
i64%lcid%.cab
@ -886,7 +872,7 @@ echo Version : %vvv% @@ -886,7 +872,7 @@ echo Version : %vvv%
if defined utc echo Updated : %utc%
echo Bitness : %arc%
echo Language: %lang%
echo Output : %outpu2%
echo Output : %output%
if defined outpu3 echo %outpu3%
echo %line%
echo.

23
esd-decrypter-wimlib/decrypt.cmd

@ -45,9 +45,13 @@ goto :eof @@ -45,9 +45,13 @@ goto :eof
set "_Const=1>nul 2>nul"
set ENCRYPTEDESD=
set "_args=%1"
set _elev=
set "_args="
set "_args=%~1"
if not defined _args goto :NoProgArgs
if "%~1"=="" set "_args="&goto :NoProgArgs
if "%~1"=="-elevated" set _elev=1&set "_args="&goto :NoProgArgs
if "%~2"=="-elevated" set _elev=1
if /i "%~x1"==".esd" set "ENCRYPTEDESD=%~1"&set "ENCRYPTEDESDN=%~nx1"
:NoProgArgs
@ -63,18 +67,21 @@ if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 ( @@ -63,18 +67,21 @@ if /i %PROCESSOR_ARCHITECTURE%==x86 (if defined PROCESSOR_ARCHITEW6432 (
)
)
%_Const% reg query HKU\S-1-5-19 && goto :Passed
set "_PSarg="""%~f0""" "
if defined _args (
set "_PSarg="""%~f0""" %_args:"="""%"
%_Const% reg query HKU\S-1-5-19 && (
goto :Passed
) || (
if defined _elev goto :E_Admin
)
(%_Const% cscript //NoLogo "%~f0?.wsf" //job:ELAV /File:"%~f0" %1) && (
set _PSarg="""%~f0""" -elevated
if defined _args set _PSarg="""%~f0""" %_args:"="""% -elevated
set _PSarg=%_PSarg:'=''%
(%_Const% cscript //NoLogo "%~f0?.wsf" //job:ELAV /File:"%~f0" %1 -elevated) && (
exit /b
) || (
call setlocal EnableDelayedExpansion
%_Const% powershell -noprofile -exec bypass -c "start cmd -ArgumentList '/c \"!_PSarg!\"' -verb runas" && (
%_Const% powershell -noprofile -exec bypass -c "start cmd.exe -Arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin

2
esd-decrypter-wimlib/multi_arch_iso.cmd

@ -42,7 +42,7 @@ set _PSarg=%_PSarg:'=''% @@ -42,7 +42,7 @@ set _PSarg=%_PSarg:'=''%
exit /b
) || (
call setlocal EnableDelayedExpansion
%_Nul3% powershell -noprofile -exec bypass -c "start cmd.exe -ArgumentList '/c \"!_PSarg!\"' -verb runas" && (
%_Nul3% powershell -noprofile -exec bypass -c "start cmd.exe -Arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin

2
uup-converter-wimlib/convert-UUP.cmd

@ -90,7 +90,7 @@ set _PSarg=%_PSarg:'=''% @@ -90,7 +90,7 @@ set _PSarg=%_PSarg:'=''%
exit /b
) || (
call setlocal EnableDelayedExpansion
%_Const% powershell -noprofile -exec bypass -c "start cmd.exe -ArgumentList '/c \"!_PSarg!\"' -verb runas" && (
%_Const% powershell -noprofile -exec bypass -c "start cmd.exe -Arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin

2
uup-converter-wimlib/create_virtual_editions.cmd

@ -69,7 +69,7 @@ set _PSarg=%_PSarg:'=''% @@ -69,7 +69,7 @@ set _PSarg=%_PSarg:'=''%
exit /b
) || (
call setlocal EnableDelayedExpansion
%_Const% powershell -noprofile -exec bypass -c "start cmd.exe -ArgumentList '/c \"!_PSarg!\"' -verb runas" && (
%_Const% powershell -noprofile -exec bypass -c "start cmd.exe -Arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin

2
uup-converter-wimlib/multi_arch_iso.cmd

@ -42,7 +42,7 @@ set _PSarg=%_PSarg:'=''% @@ -42,7 +42,7 @@ set _PSarg=%_PSarg:'=''%
exit /b
) || (
call setlocal EnableDelayedExpansion
%_Nul3% powershell -noprofile -exec bypass -c "start cmd.exe -ArgumentList '/c \"!_PSarg!\"' -verb runas" && (
%_Nul3% powershell -noprofile -exec bypass -c "start cmd.exe -Arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin

Loading…
Cancel
Save