-
Notifications
You must be signed in to change notification settings - Fork 0
/
OfficeRTool.cmd
2623 lines (2622 loc) · 189 KB
/
OfficeRTool.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
::===============================================================================================================
::===============================================================================================================
@echo off
cls
setLocal EnableExtensions EnableDelayedExpansion
set "OfficeRToolpath=%~dp0"
set "OfficeRToolpath=%OfficeRToolpath:~0,-1%"
set "OfficeRToolname=%~n0.cmd"
set "pswindowtitle=$Host.UI.RawUI.WindowTitle = 'Administrator: OfficeRTool - 2019/June/08 -'"
cd /D "%OfficeRToolpath%"
::===============================================================================================================
:: CHECK ADMIN RIGHTS
::===============================================================================================================
fltmc >nul 2>&1
if "%errorlevel%" NEQ "0" (goto:UACPrompt) else (goto:GotAdmin)
::===============================================================================================================
::===============================================================================================================
:UACPrompt
echo:
echo Requesting Administrative Privileges...
echo Press YES in UAC Prompt to Continue
echo:
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\GetAdmin.vbs"
echo args = "ELEV " >> "%temp%\GetAdmin.vbs"
echo For Each strArg in WScript.Arguments >> "%temp%\GetAdmin.vbs"
echo args = args ^& UCase(strArg) ^& " " >> "%temp%\GetAdmin.vbs"
echo Next >> "%temp%\GetAdmin.vbs"
echo UAC.ShellExecute "%OfficeRToolname%", args, "%OfficeRToolpath%", "runas", 1 >> "%temp%\GetAdmin.vbs"
cmd /u /c type "%temp%\GetAdmin.vbs">"%temp%\GetAdminUnicode.vbs"
cscript //nologo "%temp%\GetAdminUnicode.vbs" %1
del /f /q "%temp%\GetAdmin.vbs" >nul 2>&1
del /f /q "%temp%\GetAdminUnicode.vbs" >nul 2>&1
exit /B
::===============================================================================================================
::===============================================================================================================
:GotAdmin
if '%1'=='ELEV' shift /1
if exist "%temp%\GetAdmin.vbs" del /f /q "%temp%\GetAdmin.vbs"
if exist "%temp%\GetAdminUnicode.vbs" del /f /q "%temp%\GetAdminUnicode.vbs"
::===============================================================================================================
::===============================================================================================================
cls
mode con cols=82 lines=48
color 1F
echo:
::===============================================================================================================
:: DEFINE SYSTEM ENVIRONMENT
::===============================================================================================================
for /F "tokens=6 delims=[]. " %%A in ('ver') do set /a win=%%A
if %win% LSS 7601 (echo:)&&(echo:)&&(echo Unsupported Windows detected)&&(echo:)&&(echo Minimum OS must be Windows 7 SP1 or better)&&(echo:)&&(goto:TheEndIsNear)
for /F "tokens=2 delims==" %%a in ('wmic path Win32_Processor get AddressWidth /value') do (set winx=win_x%%a)
set "sls=SoftwareLicensingService"
set "slp=SoftwareLicensingProduct"
set "osps=OfficeSoftwareProtectionService"
set "ospp=OfficeSoftwareProtectionProduct"
for /F "tokens=2 delims==" %%A in ('"wmic path %sls% get version /VALUE" 2^>nul') do set "slsversion=%%A"
if %win% LSS 9200 (for /F "tokens=2 delims==" %%A IN ('"wmic path %osps% get version /VALUE" 2^>nul') do set ospsversion=%%A)
set "downpath=not set"
set "o16updlocid=not set"
set "o16arch=x86"
set "o16lang=en-US"
set "langtext=Default Language"
set "o16lcid=1033"
::===============================================================================================================
:: Read OfficeRTool.ini
::===============================================================================================================
SET /a countx=0
cd /D "%OfficeRToolpath%"
for /F "tokens=*" %%a in (OfficeRTool.ini) do (
SET /a countx=!countx! + 1
set var!countx!=%%a
)
if %countx% LSS 10 (echo:)&&(echo Error in OfficeRTool.ini)&&(echo:)&&(pause)&&(goto:Office16VnextInstall)
set "inidownpath=%var3%"
if "%inidownpath:~-1%" EQU " " set "inidownpath=%inidownpath:~0,-1%"
set "downpath=%inidownpath%"
set "inidownlang=%var6%"
if "%inidownlang:~-1%" EQU " " set "inidownlang=%inidownlang:~0,-1%"
set "o16lang=%inidownlang%"
set "inidownarch=%var9%"
if "%inidownarch:~-1%" EQU " " set "inidownarch=%inidownarch:~0,-1%"
set "o16arch=%inidownarch%"
::===============================================================================================================
::===============================================================================================================
if "%1" EQU "-NRC" goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:: Check Microsoft Content Delivery Network (CDN) server for new Office releases
::===============================================================================================================
echo:
echo Checking public Office distribution channels for new updates
call :CheckNewVersion Monthly_Channel 492350f6-3a01-4f97-b9c0-c7c6ddf67d60
call :CheckNewVersion Insider_Channel 5440fd1f-7ecb-4221-8110-145efaa6372f
call :CheckNewVersion Monthly_Channel_Targeted 64256afe-f5d9-4f86-8936-8840a6a4f5be
call :CheckNewVersion Semi_Annual_Channel 7ffbc6bf-bc32-4f92-8982-f9dd17fd3114
call :CheckNewVersion Semi_Annual_Channel_Targeted b8f9b850-328d-4355-9145-c59439a0c4cf
call :CheckNewVersion Dogfood_DevMain_Channel ea4a4090-de26-49d7-93c1-91bff9e53fc3
((echo:)&&(echo:)&&(echo:)&&(pause))
::===============================================================================================================
::===============================================================================================================
:Office16VnextInstall
cd /D "%OfficeRToolpath%"
mode con cols=82 lines=48
color 1F
title OfficeRTool - 2019/June/08 -
cls
echo:
echo ================== OFFICE DOWNLOAD AND INSTALL =============================
echo ____________________________________________________________________________
echo:
echo [D] DOWNLOAD OFFICE OFFLINE INSTALL PACKAGE
echo:
echo [I] INSTALL OFFICE SUITES OR SINGLE APPS
echo:
echo [C] CONVERT OFFICE RETAIL TO VOLUME
echo ____________________________________________________________________________
echo:
echo [A] SHOW CURRENT ACTIVATION STATUS
echo:
echo [K] START KMS ACTIVATION
echo ____________________________________________________________________________
echo:
echo [U] CHANGE OFFICE UPDATE-PATH (SWITCH DISTRIBUTION CHANNEL)
echo ____________________________________________________________________________
echo:
echo [T] DISABLE ACQUISITION AND SENDING OF TELEMETRY DATA
echo ____________________________________________________________________________
echo:
echo [O] CREATE OFFICE ONLINE WEB-INSTALLER LINK
echo ____________________________________________________________________________
echo:
echo [E] END - STOP AND LEAVE PROGRAM
echo:
echo ============================================================================
echo:
CHOICE /C DICAKUTOEX /N /M "YOUR CHOICE ?"
if %errorlevel%==1 goto:DownloadO16Offline
if %errorlevel%==2 goto:InstallO16
if %errorlevel%==3 goto:Convert16Activate
if %errorlevel%==4 goto:CheckActivationStatus
if %errorlevel%==5 goto:StartKMSActivation
if %errorlevel%==6 goto:ChangeUpdPath
if %errorlevel%==7 goto:DisableTelemetry
if %errorlevel%==8 goto:DownloadO16Online
if %errorlevel%==9 goto:TheEndIsNear
if %errorlevel%==10 goto:TheEndIsNear
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:CheckNewVersion
set "o16build=not set "
set "o16latestbuild=not set"
if "%1" EQU "Manual_Override" goto:CheckNewVersionSkip1
if exist "%OfficeRToolpath%\latest_%1_build.txt" (
set /p "o16build=" <"%OfficeRToolpath%\latest_%1_build.txt"
)
set "o16build=%o16build:~0,-1%"
:CheckNewVersionSkip1
echo:
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --no-verbose --output-document="%TEMP%\V32.cab" --tries=20 http://officecdn.microsoft.com.edgesuite.net/pr/%2/Office/Data/V32.cab >nul 2>&1
if %errorlevel% GEQ 1 goto:ErrCheckNewVersion1
expand "%TEMP%\V32.cab" -F:VersionDescriptor.xml "%TEMP%" >nul 2>&1
type "%TEMP%\VersionDescriptor.xml" | find "Available Build" >"%TEMP%\found_office_build.txt"
if %errorlevel% GEQ 1 goto:ErrCheckNewVersion2
set /p "o16latestbuild=" <"%TEMP%\found_office_build.txt"
set "o16latestbuild=%o16latestbuild:~20,16%"
set "spaces= "
if "%o16latestbuild:~15,1%" EQU " " ((set "o16latestbuild=%o16latestbuild:~0,14%")&&(set "spaces= "))
if "%o16latestbuild:~0,3%" NEQ "16." goto:ErrCheckNewVersion3
(echo --^> Checking channel: %1)
if "%1" EQU "Manual_Override" goto:CheckNewVersionSkip2a
if "%o16build%" NEQ "%o16latestbuild%" (
powershell -noprofile -command "%pswindowtitle%"; Write-Host "' 'New Build available:' '" -foreground "White" -nonewline; Write-Host "%o16latestbuild%'%spaces%'" -foreground "Red" -nonewline; Write-Host "LkgBuild:' '" -foreground "White" -nonewline; Write-Host "%o16build%" -foreground "Green"
echo %o16latestbuild% >"%OfficeRToolpath%\latest_%1_build.txt"
echo %o16build% >>"%OfficeRToolpath%\latest_%1_build.txt"
goto:CheckNewVersionSkip2b
)
:CheckNewVersionSkip2a
powershell -noprofile -command "%pswindowtitle%"; Write-Host "' 'Last known good Build:' '" -foreground "White" -nonewline; Write-Host "%o16latestbuild%'%spaces%'" -foreground "Green" -nonewline; Write-Host "No newer Build available" -foreground "White"
:CheckNewVersionSkip2b
del /f /q "%TEMP%\V32.cab"
del /f /q "%TEMP%\VersionDescriptor.xml"
del /f /q "%TEMP%\found_office_build.txt"
goto:eof
:ErrCheckNewVersion1
echo:
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** ERROR checking: * %1 * channel" -foreground "Red"
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** No response from Office content delivery server" -foreground "Red"
echo:
echo Check Internet connection and/or Channel-ID.
set "buildcheck=not ok"
goto:eof
:ErrCheckNewVersion2
echo:
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** ERROR checking: * %1 * " -foreground "Red"
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** No Build / Version number found in file: * VersionDescriptor.xml *" -foreground "Red"
copy "%TEMP%\V32.cab" "%TEMP%\%1_V32.cab" >nul 2>&1
copy "%TEMP%\VersionDescriptor.xml" "%TEMP%\%1_VersionDescriptor.xml" >nul 2>&1
echo:
echo Check file "%TEMP%\%1_V32.cab"
echo Check file "%TEMP%\%1_VersionDescriptor.xml"
set "buildcheck=not ok"
goto:eof
:ErrCheckNewVersion3
echo:
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** ERROR checking: * %1 * " -foreground "Red"
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** Unsupported Build / Version number detected: * %o16latestbuild% *" -foreground "Red"
copy "%TEMP%\VersionDescriptor.xml" "%TEMP%\%1_VersionDescriptor.xml" >nul 2>&1
copy "%TEMP%\found_office_build.txt" "%TEMP%\%1_found_office_build.txt" >nul 2>&1
echo:
echo Check file "%TEMP%\%1_VersionDescriptor.xml"
echo Check file "%TEMP%\%1_found_office_build.txt"
set "buildcheck=not ok"
goto:eof
::===============================================================================================================
::===============================================================================================================
:DownloadO16Offline
cd /D "%OfficeRToolpath%"
if not defined o16arch set "o16arch=x86"
set "installtrigger=0"
set "channeltrigger=0"
set "o16updlocid=not set"
set "o16build=not set "
cls
echo:
echo ================== DOWNLOAD OFFICE OFFLINE INSTALL PACKAGE =================
echo ____________________________________________________________________________
echo:
echo DownloadPath: "%inidownpath%"
echo:
if "%o16updlocid%" EQU "492350f6-3a01-4f97-b9c0-c7c6ddf67d60" echo Channel-ID: %o16updlocid% (Monthly_Channel) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "5440fd1f-7ecb-4221-8110-145efaa6372f" echo Channel-ID: %o16updlocid% (Insider_Channel) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "64256afe-f5d9-4f86-8936-8840a6a4f5be" echo Channel-ID: %o16updlocid% (Monthly_Channel_Targeted) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114" echo Channel-ID: %o16updlocid% (Semi_Annual_Channel) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "b8f9b850-328d-4355-9145-c59439a0c4cf" echo Channel-ID: %o16updlocid% (Semi_Annual_Channel_Targeted) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "ea4a4090-de26-49d7-93c1-91bff9e53fc3" echo Channel-ID: %o16updlocid% (Dogfood_DevMain_Channel) && goto:DownOfflineContinue
if "%o16updlocid%" EQU "not set" echo Channel-ID: not set && goto:DownOfflineContinue
echo Channel-ID: %o16updlocid% (Manual_Override)
::===============================================================================================================
:DownOfflineContinue
echo:
echo Office build: %o16build%
echo:
echo Language: %o16lang% (%langtext%)
echo:
echo Architecture: %o16arch%
echo ____________________________________________________________________________
echo:
echo Set new Office Package download path or press return for
set /p downpath=DownloadPath^= "%downpath%" ^>
set "downpath=%downpath:"=%"
if /I "%downpath%" EQU "X" (set "downpath=not set")&&(goto:Office16VnextInstall)
set "downdrive=%downpath:~0,2%"
if "%downdrive:~-1%" NEQ ":" (echo:)&&(echo Unknown Drive "%downdrive%" - Drive not found)&&(echo Enter correct driveletter:\directory or enter "X" to exit)&&(echo:)&&(pause)&&(set "downpath=not set")&&(goto:DownloadO16Offline)
cd /d %downdrive%\ >nul 2>&1
if errorlevel 1 (echo:)&&(echo Unknown Drive "%downdrive%" - Drive not found)&&(echo Enter correct driveletter:\directory or enter "X" to exit)&&(echo:)&&(pause)&&(set "downpath=not set")&&(goto:DownloadO16Offline)
set "downdrive=%downpath:~0,3%"
if "%downdrive:~-1%" EQU "\" (set "downpath=%downdrive%%downpath:~3%") else (set "downpath=%downdrive:~0,2%\%downpath:~2%")
if "%downpath:~-1%" EQU "\" set "downpath=%downpath:~0,-1%"
::===============================================================================================================
cd /D "%OfficeRToolpath%"
set "installtrigger=0"
echo:
if "%inidownpath%" NEQ "%downpath%" ((echo Office install package download path changed)&&(echo old path "%inidownpath%" -- new path "%downpath%")&&(echo:))
if "%inidownpath%" NEQ "%downpath%" set /p installtrigger=Save new path to OfficeRTool.ini? (1/0) ^>
if "%installtrigger%" EQU "0" goto:SkipDownPathSave
if /I "%installtrigger%" EQU "X" goto:SkipDownPathSave
set "inidownpath=%downpath%"
echo -------------------------------->OfficeRTool.ini
echo ^:^: default download-path>>OfficeRTool.ini
echo %inidownpath%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-language>>OfficeRTool.ini
echo %inidownlang%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-architecture>>OfficeRTool.ini
echo %inidownarch%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo Download path saved.
::===============================================================================================================
:SkipDownPathSave
echo:
echo "Public known" standard distribution channels
echo Channel Name - Internal Naming Index-#
echo ___________________________________________________________________________
echo:
echo Monthly_Channel (Retail/RTM) - (Production::CC) (1)
echo Insider_Channel (Office Insider FAST) - (Insiders::DevMain) (2)
echo Monthly_Channel_Targeted (Office Insider SLOW) - (Insiders::CC) (3)
echo Semi_Annual_Channel (Business) - (Production::DC) (4)
echo Semi_Annual_Channel_Targeted (Business Insider) - (Insiders::FRDC) (5)
echo Manual_Override (set identifier for Channel-ID's not public known) (M)
echo Exit to Main Menu (X)
echo:
set /p channeltrigger=Set Channel-Index-# (1,2,3,4,5,M) or X ^>
if "%channeltrigger%" EQU "1" goto:ChanSel1
if "%channeltrigger%" EQU "2" goto:ChanSel2
if "%channeltrigger%" EQU "3" goto:ChanSel3
if "%channeltrigger%" EQU "4" goto:ChanSel4
if "%channeltrigger%" EQU "5" goto:ChanSel5
if /I "%channeltrigger%" EQU "M" ((set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:ChanSelMan))
if "%channeltrigger%" EQU "0" ((set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall))
if /I "%channeltrigger%" EQU "X" ((set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall))
(set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:DownloadO16Offline)
::===============================================================================================================
:ChanSel1
set "o16updlocid=492350f6-3a01-4f97-b9c0-c7c6ddf67d60"
call :CheckNewVersion Monthly_Channel %o16updlocid%
set "o16build=%o16latestbuild%"
goto:ChannelSelected
::===============================================================================================================
:ChanSel2
set "o16updlocid=5440fd1f-7ecb-4221-8110-145efaa6372f"
call :CheckNewVersion Insider_Channel %o16updlocid%
set "o16build=%o16latestbuild%"
goto:ChannelSelected
::===============================================================================================================
:ChanSel3
set "o16updlocid=64256afe-f5d9-4f86-8936-8840a6a4f5be"
call :CheckNewVersion Monthly_Channel_Targeted %o16updlocid%
set "o16build=%o16latestbuild%"
goto:ChannelSelected
::===============================================================================================================
:ChanSel4
set "o16updlocid=7ffbc6bf-bc32-4f92-8982-f9dd17fd3114"
call :CheckNewVersion Semi_Annual_Channel %o16updlocid%
set "o16build=%o16latestbuild%"
goto:ChannelSelected
::===============================================================================================================
:ChanSel5
set "o16updlocid=b8f9b850-328d-4355-9145-c59439a0c4cf"
call :CheckNewVersion Semi_Annual_Channel_Targeted %o16updlocid%
set "o16build=%o16latestbuild%"
goto:ChannelSelected
::===============================================================================================================
:ChanSelMan
echo:
echo "Microsoft Internal Use Only" Beta/Testing distribution channels
echo Internal Naming Channel-ID: Index-#
echo ___________________________________________________________________________
echo:
echo Dogfood::DevMain -----^> ea4a4090-de26-49d7-93c1-91bff9e53fc3 (1)
echo Dogfood::CC -----^> f3260cf1-a92c-4c75-b02e-d64c0a86a968 (2)
echo Dogfood::DCEXT -----^> c4a7726f-06ea-48e2-a13a-9d78849eb706 (3)
echo Dogfood::FRDC -----^> 834504cc-dc55-4c6d-9e71-e024d0253f6d (4)
echo Microsoft::CC -----^> 5462eee5-1e97-495b-9370-853cd873bb07 (5)
echo Microsoft::DC -----^> f4f024c8-d611-4748-a7e0-02b6e754c0fe (6)
echo Microsoft::DevMain -----^> b61285dd-d9f7-41f2-9757-8f61cba4e9c8 (7)
echo Microsoft::FRDC -----^> 9a3b7ff2-58ed-40fd-add5-1e5158059d1c (8)
echo Production::LTSC -----^> f2e724c1-748f-4b47-8fb8-8e0d210e9208 (9)
echo Insider::LTSC -----^> 2e148de9-61c8-4051-b103-4af54baffbb4 (A)
echo Exit to Main Menu (X)
echo:
set /p o16updlocid=Set Channel (enter Channel-ID or Index-#) ^>
if "%o16updlocid%" EQU "not set" goto:DownloadO16Offline
if /I "%o16updlocid%" EQU "X" (set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall)
if "%o16updlocid%" EQU "0" (set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall)
if "%o16updlocid%" EQU "1" set "o16updlocid=ea4a4090-de26-49d7-93c1-91bff9e53fc3"
if "%o16updlocid%" EQU "2" set "o16updlocid=f3260cf1-a92c-4c75-b02e-d64c0a86a968"
if "%o16updlocid%" EQU "3" set "o16updlocid=c4a7726f-06ea-48e2-a13a-9d78849eb706"
if "%o16updlocid%" EQU "4" set "o16updlocid=834504cc-dc55-4c6d-9e71-e024d0253f6d
if "%o16updlocid%" EQU "5" set "o16updlocid=5462eee5-1e97-495b-9370-853cd873bb07"
if "%o16updlocid%" EQU "6" set "o16updlocid=f4f024c8-d611-4748-a7e0-02b6e754c0fe"
if "%o16updlocid%" EQU "7" set "o16updlocid=b61285dd-d9f7-41f2-9757-8f61cba4e9c8"
if "%o16updlocid%" EQU "8" set "o16updlocid=9a3b7ff2-58ed-40fd-add5-1e5158059d1c"
if "%o16updlocid%" EQU "9" set "o16updlocid=f2e724c1-748f-4b47-8fb8-8e0d210e9208"
if /I "%o16updlocid%" EQU "A" set "o16updlocid=2e148de9-61c8-4051-b103-4af54baffbb4"
call :CheckNewVersion Manual_Override %o16updlocid%
set "o16build=%o16latestbuild%"
::===============================================================================================================
:ChannelSelected
set "o16downloadloc=officecdn.microsoft.com.edgesuite.net/pr/%o16updlocid%/Office/Data"
echo:
if "%buildcheck%" EQU "not ok" ((pause)&&(set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall))
set /p o16build=Set Office Build - or press return for %o16build% ^>
if "%o16build%" EQU "cb" (set "o16build=%o16latestbuild%")&&(goto:DownloadO16Offline)
if "%o16build%" EQU "not set" (set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall)
if /I "%o16build%" EQU "X" (set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall)
::===============================================================================================================
:LangSelect
echo:
echo Possible Language VALUES (enter exactly in small-CAPITAL letters as shown):
echo ar-SA, bg-BG, cs-CZ, da-DK, de-DE, el-GR, en-US, es-ES, et-EE, fi-FI, fr-FR,
echo he-IL, hi-IN, hr-HR, hu-HU, id-ID, it-IT, ja-JP, kk-KZ, ko-KR, lt-LT, lv-LV,
echo ms-MY, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sr-latn-RS,
echo sv-SE, th-TH, tr-TR, uk-UA, vi-VN, zh-CN, zh-TW
echo:
set /p o16lang=Set Language Value - or press return for %o16lang% ^>
call :SetO16Language
if "%langnotfound%" EQU "TRUE" goto:LangSelect
::===============================================================================================================
cd /D "%OfficeRToolpath%"
set "installtrigger=0"
if "%inidownlang%" NEQ "%o16lang%" ((echo:)&&(echo Office install package download language changed)&&(echo old language "%inidownlang%" -- new language "%o16lang%")&&(echo:))
if "%inidownlang%" NEQ "%o16lang%" set /p installtrigger=Save new language to OfficeRTool.ini? (1/0) ^>
if "%installtrigger%" EQU "0" goto:ArchSelect
if /I "%installtrigger%" EQU "X" goto:ArchSelect
set "inidownlang=%o16lang%"
echo -------------------------------->OfficeRTool.ini
echo ^:^: default download-path>>OfficeRTool.ini
echo %inidownpath%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-language>>OfficeRTool.ini
echo %inidownlang%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-architecture>>OfficeRTool.ini
echo %inidownarch%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo Download language saved.
::===============================================================================================================
:ArchSelect
echo:
set /p o16arch=Set architecture to download (x86 or x64) - or press return for %o16arch% ^>
if "%o16arch%" EQU "not set" goto:ArchSelect
if "%o16arch%" EQU "x86" goto:SkipArchSelect
if "%o16arch%" EQU "X86" (set "o16arch=x86")&&(goto:SkipArchSelect)
if "%o16arch%" EQU "x64" goto:SkipArchSelect
if "%o16arch%" EQU "X64" (set "o16arch=x64")&&(goto:SkipArchSelect)
set "o16arch=x86"
::===============================================================================================================
:SkipArchSelect
cd /D "%OfficeRToolpath%"
set "installtrigger=0"
echo:
if "%inidownarch%" NEQ "%o16arch%" ((echo Office install package download architecture changed)&&(echo old architecture "%inidownarch%" -- new architecture "%o16arch%")&&(echo:))
if "%inidownarch%" NEQ "%o16arch%" set /p installtrigger=Save new architecture to OfficeRTool.ini? (1/0) ^>
if "%installtrigger%" EQU "0" goto:SkipDownArchSave
if /I "%installtrigger%" EQU "X" goto:SkipDownArchSave
set "inidownarch=%o16arch%"
echo -------------------------------->OfficeRTool.ini
echo ^:^: default download-path>>OfficeRTool.ini
echo %inidownpath%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-language>>OfficeRTool.ini
echo %inidownlang%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo ^:^: default download-architecture>>OfficeRTool.ini
echo %inidownarch%>>OfficeRTool.ini
echo -------------------------------->>OfficeRTool.ini
echo Download architecture saved.
::===============================================================================================================
:SkipDownArchSave
echo:
echo ____________________________________________________________________________
echo:
echo ================== Pending Download (SUMMARY) ==============================
echo:
echo DownloadPath: %downpath%
echo:
if "%o16updlocid%" EQU "492350f6-3a01-4f97-b9c0-c7c6ddf67d60" echo Channel-ID: %o16updlocid% (Monthly_Channel) && goto:PendDownContinue
if "%o16updlocid%" EQU "5440fd1f-7ecb-4221-8110-145efaa6372f" echo Channel-ID: %o16updlocid% (Insider_Channel) && goto:PendDownContinue
if "%o16updlocid%" EQU "64256afe-f5d9-4f86-8936-8840a6a4f5be" echo Channel-ID: %o16updlocid% (Monthly_Channel_Targeted) && goto:PendDownContinue
if "%o16updlocid%" EQU "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114" echo Channel-ID: %o16updlocid% (Semi_Annual_Channel) && goto:PendDownContinue
if "%o16updlocid%" EQU "b8f9b850-328d-4355-9145-c59439a0c4cf" echo Channel-ID: %o16updlocid% (Semi_Annual_Channel_Targeted) && goto:PendDownContinue
if "%o16updlocid%" EQU "ea4a4090-de26-49d7-93c1-91bff9e53fc3" echo Channel-ID: %o16updlocid% (Dogfood_DevMain_Channel) && goto:PendDownContinue
echo Channel-ID: %o16updlocid% (Manual_Override)
::===============================================================================================================
:PendDownContinue
set "installtrigger=0"
echo Office Build: %o16build%
echo Language: %o16lang% (%langtext%)
echo Architecture: %o16arch%
echo ____________________________________________________________________________
echo:
set /p installtrigger=Start download now? (1/0) ^>
if "%installtrigger%" EQU "0" goto:DownloadO16Offline
if "%installtrigger%" EQU "1" goto:Office16VNextDownload
if /I "%installtrigger%" EQU "X" (set "o16updlocid=not set")&&(set "o16build=not set")&&(goto:Office16VnextInstall)
goto:DownloadO16Offline
::===============================================================================================================
::===============================================================================================================
:Office16VNextDownload
cls
echo:
echo ================== DOWNLOADING OFFICE OFFLINE SETUP PACKAGE ================
echo ____________________________________________________________________________
if "%o16updlocid%" EQU "492350f6-3a01-4f97-b9c0-c7c6ddf67d60" set "downbranch=Monthly_Channel" && goto:ContVNextDownload
if "%o16updlocid%" EQU "5440fd1f-7ecb-4221-8110-145efaa6372f" set "downbranch=Insider_Channel" && goto:ContVNextDownload
if "%o16updlocid%" EQU "64256afe-f5d9-4f86-8936-8840a6a4f5be" set "downbranch=Monthly_Channel_Targeted" && goto:ContVNextDownload
if "%o16updlocid%" EQU "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114" set "downbranch=Semi_Annual_Channel" && goto:ContVNextDownload
if "%o16updlocid%" EQU "b8f9b850-328d-4355-9145-c59439a0c4cf" set "downbranch=Semi_Annual_Channel_Targeted" && goto:ContVNextDownload
if "%o16updlocid%" EQU "ea4a4090-de26-49d7-93c1-91bff9e53fc3" set "downbranch=Dogfood_DevMain" && goto:ContVNextDownload
set "downbranch=Manual_Override"
::===============================================================================================================
:ContVNextDownload
cd /d "%downdrive%\" >nul 2>&1
md "%downpath%" >nul 2>&1
cd /d "%downpath%" >nul 2>&1
mode con cols=147
if "%o16arch%" EQU "x64" goto:X64DOWNLOAD
::===============================================================================================================
:: Download x86/32bit Office setup files
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/v32_%o16build%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/v32_%o16build%.cab"
copy %o16build%_%o16lang%_%o16arch%_%downbranch%\Office\Data\v32_%o16build%.cab %o16build%_%o16lang%_%o16arch%_%downbranch%\Office\Data\v32.cab >nul 2>&1
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/stream.x86.%o16lang%.dat
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/stream.x86.%o16lang%.dat"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/stream.x86.x-none.dat
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/stream.x86.x-none.dat"
goto:GENERALDOWNLOAD
::===============================================================================================================
:: Download x64/64bit Office setup files
:X64DOWNLOAD
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/v64_%o16build%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/v64_%o16build%.cab"
copy %o16build%_%o16lang%_%o16arch%_%downbranch%\Office\Data\v64_%o16build%.cab %o16build%_%o16lang%_%o16arch%_%downbranch%\Office\Data\v64.cab >nul 2>&1
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/stream.x64.%o16lang%.dat
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/stream.x64.%o16lang%.dat"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/stream.x64.x-none.dat
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/stream.x64.x-none.dat"
::===============================================================================================================
:: Download setup file(s) used in both x86 and x64 architectures
:GENERALDOWNLOAD
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/i320.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/i320.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/i32%o16lcid%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/i32%o16lcid%.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/s320.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/s320.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/s32%o16lcid%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/s32%o16lcid%.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/i640.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/i640.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/i64%o16lcid%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/i64%o16lcid%.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/s640.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/s640.cab"
"%OfficeRToolpath%\OfficeFixes\%winx%\wget.exe" --progress=bar:force:noscroll --retry-connrefused --continue --tries=20 --force-directories --no-host-directories --cut-dirs=2 --directory-prefix=%o16build%_%o16lang%_%o16arch%_%downbranch% http://%o16downloadloc%/%o16build%/s64%o16lcid%.cab
if %errorlevel% GEQ 1 call :WgetError "http://%o16downloadloc%/%o16build%/s64%o16lcid%.cab"
::===============================================================================================================
echo ____________________________________________________________________________
if "%downbranch%" EQU "Monthly_Channel" echo Current>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Insider_Channel" echo InsiderFast>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Monthly_Channel_Targeted" echo FirstReleaseCurrent>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Semi_Annual_Channel" echo Deferred>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Semi_Annual_Channel_Targeted" echo FirstReleaseDeferred>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Dogfood_DevMain" echo DogfoodDevMain>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
if "%downbranch%" EQU "Manual_Override" echo ManualOverride>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
echo %o16build%>>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
echo %o16lang%>>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
echo %o16arch%>>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
echo %o16updlocid%>>%o16build%_%o16lang%_%o16arch%_%downbranch%\package.info
echo:
echo:
timeout /t 7
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:WgetError
set "errortrigger=0"
powershell -noprofile -command "%pswindowtitle%"; Write-Host "*** ERROR downloading: %1" -foreground "Red"
echo:
set /p errortrigger=Cancel Download now? (1/0) ^>
if "%errortrigger%" EQU "1" (
if exist "%downpath%\%o16build%_%o16lang%_%o16arch%_%downbranch%" rd "%downpath%\%o16build%_%o16lang%_%o16arch%_%downbranch%" /S /Q
goto:Office16VnextInstall
)
echo:
goto :eof
::===============================================================================================================
::===============================================================================================================
:DownloadO16Online
cd /D "%OfficeRToolpath%"
cls
echo:
echo ============= DOWNLOAD OFFICE 2016/2019 ONLINE WEB INSTALLER ===============
echo ____________________________________________________________________________
set "WebProduct=not set"
set "o16arch=x86"
set "o16lang=en-US"
set "of16install=0"
set "pr16install=0"
set "vi16install=0"
set "of19install=0"
set "pr19install=0"
set "vi19install=0"
set "installtrigger=O"
echo:
set /p installtrigger=Generate Office 2016 products setup.exe download-link (1=YES/0=NO) ^>
if /I "%installtrigger%" EQU "X" goto:Office16VnextInstall
if "%installtrigger%" EQU "1" goto:WEBOFF2016
echo:
set /p installtrigger=Generate Office 2019 products setup.exe download-link (1=YES/0=NO) ^>
if /I "%installtrigger%" EQU "X" goto:Office16VnextInstall
if "%installtrigger%" EQU "1" goto:WEBOFF2019
goto:DownloadO16Online
:WEBOFF2016
echo:
echo ____________________________________________________________________________
echo:
set /p of16install=Set Office 2016 ProfessionalPlus Install (1/0) ^>
if "%of16install%" EQU "1" (set "WebProduct=ProPlusRetail")&&(goto:WebArchSelect)
echo:
set /p pr16install=Set Project 2016 Professional Install (1/0) ^>
if "%pr16install%" EQU "1" (set "WebProduct=ProjectProRetail")&&(goto:WebArchSelect)
echo:
set /p vi16install=Set Visio 2016 Professional Install (1/0) ^>
if "%vi16install%" EQU "1" (set "WebProduct=VisioProRetail")&&(goto:WebArchSelect)
goto:WEBOFFNOTHING
:WEBOFF2019
echo:
echo ____________________________________________________________________________
echo:
set /p of19install=Set Office 2019 ProfessionalPlus Install (1/0) ^>
if "%of19install%" EQU "1" (set "WebProduct=ProPlus2019Retail")&&(goto:WebArchSelect)
echo:
set /p pr19install=Set Project 2019 Professional Install (1/0) ^>
if "%pr19install%" EQU "1" (set "WebProduct=ProjectPro2019Retail")&&(goto:WebArchSelect)
echo:
set /p vi19install=Set Visio 2019 Professional Install (1/0) ^>
if "%vi19install%" EQU "1" (set "WebProduct=VisioPro2019Retail")&&(goto:WebArchSelect)
:WEBOFFNOTHING
echo:
echo ____________________________________________________________________________
echo:
echo Nothing selected - Returning to Main Menu now
echo:
pause
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:WebArchSelect
echo ____________________________________________________________________________
if "%winx%" EQU "win_x32" (set "o16arch=x86")&&(goto:WebLangSelect)
echo:
set /p o16arch=Set architecture to install (enter x86 or x64) - press return for %o16arch% ^>
echo ____________________________________________________________________________
::===============================================================================================================
::===============================================================================================================
:WebLangSelect
echo:
echo Possible Language VALUES (enter exactly in small-CAPITAL letters as shown):
echo ar-SA, bg-BG, cs-CZ, da-DK, de-DE, el-GR, en-US, es-ES, et-EE, fi-FI, fr-FR,
echo he-IL, hi-IN, hr-HR, hu-HU, id-ID, it-IT, ja-JP, kk-KZ, ko-KR, lt-LT, lv-LV,
echo ms-MY, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sr-latn-RS,
echo sv-SE, th-TH, tr-TR, uk-UA, vi-VN, zh-CN, zh-TW
echo:
set /p o16lang=Set Language Value - or press return for %o16lang% ^>
call :SetO16Language
if "%langnotfound%" EQU "TRUE" goto:WebLangSelect
::===============================================================================================================
echo:
echo ____________________________________________________________________________
echo:
echo Pending Online WEB Install (SUMMARY)
echo:
if "%of16install%" EQU "1" echo Install Office 2016 ? : YES
if "%pr16install%" EQU "1" echo Install Project 2016 ? : YES
if "%vi16install%" EQU "1" echo Install Visio 2016 ? : YES
if "%of19install%" EQU "1" echo Install Office 2019 ? : YES
if "%pr19install%" EQU "1" echo Install Project 2019 ? : YES
if "%vi19install%" EQU "1" echo Install Visio 2019 ? : YES
echo:
echo Install Architecture ? : %o16arch%
echo Install Language ? : %o16lang%
echo ____________________________________________________________________________
echo:
set /p installtrigger=Start Online WEB Install now (1/0)? ^>
if "%installtrigger%" EQU "0" goto:DownloadO16Online
if "%installtrigger%" EQU "1" goto:OfficeWebInstall
if /I "%installtrigger%" EQU "X" goto:Office16VnextInstall
goto:DownloadO16Online
::===============================================================================================================
::===============================================================================================================
:OfficeWebInstall
cls
echo:
echo ================== DOWNLOAD OFFICE ONLINE WEB INSTALLER ====================
echo ____________________________________________________________________________
echo:
echo Sending generated link to your browser.
echo:
echo Save the offered Setup.exe and run it to start Online WEB Install
start "" "https://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/Office/Data/setup%WebProduct%.%o16arch%.%o16lang%.exe
echo ____________________________________________________________________________
echo:
echo:
timeout /t 7
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:CheckActivationStatus
::===============================================================================================================
call :CheckOfficeApplications
::===============================================================================================================
set "CDNBaseUrl=not set"
set "UpdateUrl=not set"
set "UpdateBranch=not set"
cls
powershell.exe -command "& {$pshost = Get-Host;$pswindow = $pshost.UI.RawUI;$newsize = $pswindow.BufferSize;$newsize.height = 100;$pswindow.buffersize = $newsize;}"
echo:
echo ================== SHOW CURRENT ACTIVATION STATUS ==========================
echo ____________________________________________________________________________
echo:
echo Office installation path:
echo %installpath16%
echo:
if "%ProPlusVLFound%" EQU "YES" ((set "ChannelName=Native Volume (VLSC)")&&(set "UpdateUrl=Windows Update")&&(goto:CheckActCont))
if "%StandardVLFound%" EQU "YES" ((set "ChannelName=Native Volume (VLSC)")&&(set "UpdateUrl=Windows Update")&&(goto:CheckActCont))
if "%ProjectProVLFound%" EQU "YES" ((set "ChannelName=Native Volume (VLSC)")&&(set "UpdateUrl=Windows Update")&&(goto:CheckActCont))
if "%VisioProVLFound%" EQU "YES" ((set "ChannelName=Native Volume (VLSC)")&&(set "UpdateUrl=Windows Update")&&(goto:CheckActCont))
if "%_UWPappINSTALLED%" EQU "YES" ((set "ChannelName=Microsoft Apps Store")&&(set "UpdateUrl=Microsoft Apps Store")&&(goto:CheckActCont))
for /F "tokens=2,*" %%A IN ('reg query "HKLM\Software\Microsoft\Office\ClickToRun\Configuration" /v "CDNBaseUrl" 2^>nul') DO (Set "CDNBaseUrl=%%B")
for /F "tokens=2,*" %%A IN ('reg query "HKLM\Software\Microsoft\Office\ClickToRun\Configuration" /v "UpdateUrl" 2^>nul') DO (Set "UpdateUrl=%%B")
call:DecodeChannelName %UpdateUrl%
::===============================================================================================================
:CheckActCont
echo Distribution-Channel:
echo %ChannelName%
echo:
echo Updates-Url:
echo %UpdateUrl%
echo ____________________________________________________________________________
echo:
if "%_ProPlusRetail%" EQU "YES" ((echo Office 2016 ProfessionalPlus --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_ProPlus2019Retail%" EQU "YES" ((echo Office 2019 ProfessionalPlus --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProPlus2019))
if "%_ProPlus2019Volume%" EQU "YES" ((echo Office 2019 ProfessionalPlus --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProPlus2019))
if "%_StandardRetail%" EQU "YES" ((echo Office 2016 Standard --- ProductVersion: %o16version%)&&(echo:)&&(call :CheckKMSActivation Standart))
if "%_O365ProPlusRetail%" EQU "YES" ((echo Office 365 ProfessionalPlus --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Mondo))
if "%_O365BusinessRetail%" EQU "YES" ((echo Office 365 Business --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Mondo))
if "%_MondoRetail%" EQU "YES" ((echo Office Mondo Grande Suite --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Mondo))
if "%_WordRetail%" EQU "YES" ((echo Word 2016 SingleApp ------------------ ProductVersion : %o16version%)&&(call :CheckKMSActivation Word))
if "%_ExcelRetail%" EQU "YES" ((echo Excel 2016 SingleApp ----------------- ProductVersion : %o16version%)&&(call :CheckKMSActivation Excel))
if "%_PowerPointRetail%" EQU "YES" ((echo PowerPoint 2016 SingleApp ------------ ProductVersion : %o16version%)&&(call :CheckKMSActivation PowerPoint))
if "%_AccessRetail%" EQU "YES" ((echo Access 2016 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Access))
if "%_OutlookRetail%" EQU "YES" ((echo Outlook 2016 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Outlook))
if "%_PublisherRetail%" EQU "YES" ((echo Publisher 2016 Single App --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Publisher))
if "%_OneNoteRetail%" EQU "YES" ((echo OneNote 2016 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation OneNote))
if "%_SkypeForBusinessRetail%" EQU "YES" ((echo Skype For Business 2016 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation SkypeForBusiness))
if "%_AppxWinword%" EQU "YES" ((echo Word 2016 UWP Appx Desktop App --- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxExcel%" EQU "YES" ((echo Excel 2016 UWP Appx Desktop App --- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxPowerPoint%" EQU "YES" ((echo PowerPoint 2016 UWP Appx Desktop App - ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxAccess%" EQU "YES" ((echo Access 2016 UWP Appx Desktop App ----- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxOutlook%" EQU "YES" ((echo Outlook 2016 UWP Appx Desktop App ---- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxPublisher%" EQU "YES" ((echo Publisher 2016 UWP Appx Desktop App -- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxOneNote%" EQU "YES" ((echo OneNote 2016 UWP Appx Desktop App ---- ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_AppxSkypeForBusiness%" EQU "YES" ((echo Skype 2016 UWP Appx Desktop App ------ ProductVersion : %o16version%)&&(call :CheckKMSActivation ProPlus))
if "%_Word2019Retail%" EQU "YES" ((echo Word 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Word2019))
if "%_Excel2019Retail%" EQU "YES" ((echo Excel 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Excel2019))
if "%_PowerPoint2019Retail%" EQU "YES" ((echo PowerPoint 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation PowerPoint2019))
if "%_Access2019Retail%" EQU "YES" ((echo Access 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Access2019))
if "%_Outlook2019Retail%" EQU "YES" ((echo Outlook 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Outlook2019))
if "%_Publisher2019Retail%" EQU "YES" ((echo Publisher 2019 Single App --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Publisher2019))
if "%_SkypeForBusiness2019Retail%" EQU "YES" ((echo Skype For Business 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation SkypeForBusiness2019))
if "%_Word2019Volume%" EQU "YES" ((echo Word 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Word2019))
if "%_Excel2019Volume%" EQU "YES" ((echo Excel 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Excel2019))
if "%_PowerPoint2019Volume%" EQU "YES" ((echo PowerPoint 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation PowerPoint2019))
if "%_Access2019Volume%" EQU "YES" ((echo Access 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Access2019))
if "%_Outlook2019Volume%" EQU "YES" ((echo Outlook 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Outlook2019))
if "%_Publisher2019Volume%" EQU "YES" ((echo Publisher 2019 Single App --- ProductVersion: %o16version%)&&(call :CheckKMSActivation Publisher2019))
if "%_SkypeForBusiness2019Volume%" EQU "YES" ((echo Skype For Business 2019 SingleApp --- ProductVersion: %o16version%)&&(call :CheckKMSActivation SkypeForBusiness2019))
if "%_VisioProRetail%" EQU "YES" ((echo VisioPro 2016 --- ProductVersion: %o16version%)&&(call :CheckKMSActivation VisioPro))
if "%_AppxVisio%" EQU "YES" ((echo VisioPro 2016 UWP Appx Desktop App --- ProductVersion : %o16version%)&&(call :CheckKMSActivation VisioPro))
if "%_ProjectProRetail%" EQU "YES" ((echo Project 2016 Professional --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProjectPro))
if "%_AppxProject%" EQU "YES" ((echo ProjectPro 2016 UWP Appx Desktop App - ProductVersion : %o16version%)&&(call :CheckKMSActivation ProjectPro))
if "%_VisioPro2019Retail%" EQU "YES" ((echo Visio 2019 Professional ---- ProductVersion: %o16version%)&&(call :CheckKMSActivation VisioPro2019))
if "%_VisioPro2019Volume%" EQU "YES" ((echo Visio 2019 Professional ---- ProductVersion: %o16version%)&&(call :CheckKMSActivation VisioPro2019))
if "%_ProjectPro2019Retail%" EQU "YES" ((echo Project 2019 Professional --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProjectPro2019))
if "%_ProjectPro2019Volume%" EQU "YES" ((echo Project 2019 Professional --- ProductVersion: %o16version%)&&(call :CheckKMSActivation ProjectPro2019))
echo:
echo:
pause
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:CheckKMSActivation
set "LicStatus=9"
set "LicStatusText=(---UNKNOWN---) "
set /a "GraceMin=0"
set "EvalEndDate=00000000"
set "activationtext=unknown"
set "PartProdKey=not set"
if %win% GEQ 9200 (
for /F "tokens=2 delims==" %%A in ('"wmic path %slp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get LicenseFamily /format:list" 2^>nul') do (set "LicFamily=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %slp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get LicenseStatus /value" 2^>nul') do (set "LicStatus=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %slp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get GracePeriodRemaining /value" 2^>nul') do (set /a "GraceMin=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %slp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get EvaluationEndDate /format:list" 2^>nul') do (set "EvalEndDate=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %slp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get PartialProductKey /format:list" 2^>nul') do (set "PartProdKey=%%A")
)
if %win% LSS 9200 (
for /F "tokens=2 delims==" %%A in ('"wmic path %ospp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get LicenseFamily /format:list" 2^>nul') do (set /a "LicFamily=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %ospp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get LicenseStatus /value" 2^>nul') do (set /a "LicStatus=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %ospp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get GracePeriodRemaining /value" 2^>nul') do (set /a "GraceMin=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %ospp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get EvaluationEndDate /format:list" 2^>nul') do (set "EvalEndDate=%%A")
for /F "tokens=2 delims==" %%A in ('"wmic path %ospp% where (Name like '%%^%1^%%' and PartialProductKey is not NULL) get PartialProductKey /format:list" 2^>nul') do (set "PartProdKey=%%A")
)
set /a GraceDays=%GraceMin%/1440
set "GraceDays= %GraceDays%"
set "GraceDays=%GraceDays:~-3%"
set "EvalEndDate=%EvalEndDate:~0,8%"
set "EvalEndDate=%EvalEndDate:~4,2%/%EvalEndDate:~6,2%/%EvalEndDate:~0,4%"
if "%LicStatus%" EQU "0" (set "LicStatusText=(---UNLICENSED---) ")
if "%LicStatus%" EQU "1" (set "LicStatusText=(---LICENSED---) ")
if "%LicStatus%" EQU "2" (set "LicStatusText=(---OOB_GRACE---) ")
if "%LicStatus%" EQU "3" (set "LicStatusText=(---OOT_GRACE---) ")
if "%LicStatus%" EQU "4" (set "LicStatusText=(---NONGENUINE_GRACE---) ")
if "%LicStatus%" EQU "5" (set "LicStatusText=(---NOTIFICATIONS---) ")
if "%LicStatus%" EQU "6" (set "LicStatusText=(---EXTENDED_GRACE---) ")
echo:
echo License Family: %LicFamily%
echo:
echo Activation status: %LicStatus% %LicStatusText% PartialProductKey: -%PartProdKey%
if "%EvalEndDate%" NEQ "01/01/1601" (set "activationtext=Product's activation is time-restricted")
if "%EvalEndDate%" EQU "01/01/1601" (set "activationtext=Product is permanently activated")
if %LicStatus% EQU 1 if %GraceMin% EQU 0 ((echo:)&&(echo Remaining Retail activation period: %activationtext%))
if %LicStatus% GEQ 1 if %GraceDays% GEQ 1 (echo:)
if %LicStatus% GEQ 1 if %GraceDays% GEQ 1 powershell -noprofile -command "%pswindowtitle%"; Write-Host "Remaining KMS activation period: '%GraceDays%' days left '-' License expires at:' '" -nonewline; Get-Date -date $(Get-Date).AddMinutes(%GraceMin%) -Format (Get-Culture).DateTimeFormat.ShortDatePattern
if "%EvalEndDate%" NEQ "00/00/0000" if "%EvalEndDate%" NEQ "01/01/1601" ((echo:)&&(echo Evaluation-/Beta-Version timebomb active - Product end-of-life: %EvalEndDate%))
echo ____________________________________________________________________________
echo:
goto :eof
::===============================================================================================================
::===============================================================================================================
:ChangeUpdPath
::===============================================================================================================
call :CheckOfficeApplications
::===============================================================================================================
set "CDNBaseUrl=not set"
set "UpdateUrl=not set"
set "UpdateBranch=not set"
set "installtrigger=O"
set "channeltrigger=O"
set "restrictbuild=newest available"
set "updatetoversion="
cls
echo:
echo ================== CHANGE INSTALLED OFFICE UPDATE-PATH =====================
echo ____________________________________________________________________________
echo:
if "%ProPlusVLFound%" EQU "YES" ((echo:)&&(echo CHANGE OFFICE UPDATE-PATH is not possible for native VLSC Volume version)&&(echo:)&&(pause)&&(goto:Office16VnextInstall))
if "%StandardVLFound%" EQU "YES" ((echo:)&&(echo CHANGE OFFICE UPDATE-PATH is not possible for native VLSC Volume version)&&(echo:)&&(pause)&&(goto:Office16VnextInstall))
if "%ProjectProVLFound%" EQU "YES" ((echo:)&&(echo CHANGE OFFICE UPDATE-PATH is not possible for native VLSC Volume version)&&(echo:)&&(pause)&&(goto:Office16VnextInstall))
if "%VisioProVLFound%" EQU "YES" ((echo:)&&(echo CHANGE OFFICE UPDATE-PATH is not possible for native VLSC Volume version)&&(echo:)&&(pause)&&(goto:Office16VnextInstall))
if "%_UWPappINSTALLED%" EQU "YES" ((echo:)&&(echo CHANGE OFFICE UPDATE-PATH is not possible for Office UWP Appx Desktop Apps)&&(echo:)&&(pause)&&(goto:Office16VnextInstall))
if "%_ProPlusRetail%" EQU "YES" (echo Office 2016 ProfessionalPlus --------- ProductVersion : %o16version%)
if "%_ProPlus2019Retail%" EQU "YES" (echo Office 2019 ProfessionalPlus --------- ProductVersion : %o16version%)
if "%_ProPlus2019Volume%" EQU "YES" (echo Office 2019 ProfessionalPlus --------- ProductVersion : %o16version%)
if "%_O365ProPlusRetail%" EQU "YES" (echo Office 365 ProfessionalPlus ---------- ProductVersion : %o16version%)
if "%_O365BusinessRetail%" EQU "YES" (echo Office 365 Business ------------------ ProductVersion : %o16version%)
if "%_MondoRetail%" EQU "YES" (echo Office Mondo Grande Suite ------------ ProductVersion : %o16version%)
if "%_WordRetail%" EQU "YES" (echo Word 2016 SingleApp ------------------ ProductVersion : %o16version%)
if "%_ExcelRetail%" EQU "YES" (echo Excel 2016 SingleApp ----------------- ProductVersion : %o16version%)
if "%_PowerPointRetail%" EQU "YES" (echo PowerPoint 2016 SingleApp ------------ ProductVersion : %o16version%)
if "%_AccessRetail%" EQU "YES" (echo Access 2016 SingleApp ---------------- ProductVersion : %o16version%)
if "%_OutlookRetail%" EQU "YES" (echo Outlook 2016 SingleApp --------------- ProductVersion : %o16version%)
if "%_PublisherRetail%" EQU "YES" (echo Publisher 2016 SingleApp ------------- ProductVersion : %o16version%)
if "%_OneNoteRetail%" EQU "YES" (echo OneNote 2016 SingleApp --------------- ProductVersion : %o16version%)
if "%_SkypeForBusinessRetail%" EQU "YES" (echo Skype 2016 SingleApp ----------------- ProductVersion : %o16version%)
if "%_AppxWinword%" EQU "YES" (echo Word 2016 UWP Appx Desktop App ------- ProductVersion : %o16version%)
if "%_AppxExcel%" EQU "YES" (echo Excel 2016 UWP Appx Desktop App ------ ProductVersion : %o16version%)
if "%_AppxPowerPoint%" EQU "YES" (echo PowerPoint 2016 UWP Appx Desktop App - ProductVersion : %o16version%)
if "%_AppxAccess%" EQU "YES" (echo Access 2016 UWP Appx Desktop App ----- ProductVersion : %o16version%)
if "%_AppxOutlook%" EQU "YES" (echo Outlook 2016 UWP Appx Desktop App ---- ProductVersion : %o16version%)
if "%_AppxPublisher%" EQU "YES" (echo Publisher 2016 UWP Appx Desktop App -- ProductVersion : %o16version%)
if "%_AppxOneNote%" EQU "YES" (echo OneNote 2016 UWP Appx Desktop App ---- ProductVersion : %o16version%)
if "%_AppxSkypeForBusiness%" EQU "YES" (echo Skype 2016 UWP Appx Desktop App ------ ProductVersion : %o16version%)
if "%_Word2019Retail%" EQU "YES" (echo Word 2019 SingleApp ------------------ ProductVersion : %o16version%)
if "%_Excel2019Retail%" EQU "YES" (echo Excel 2019 SingleApp ----------------- ProductVersion : %o16version%)
if "%_PowerPoint2019Retail%" EQU "YES" (echo PowerPoint 2019 SingleApp ------------ ProductVersion : %o16version%)
if "%_Access2019Retail%" EQU "YES" (echo Access 2019 SingleApp ---------------- ProductVersion : %o16version%)
if "%_Outlook2019Retail%" EQU "YES" (echo Outlook 2019 SingleApp --------------- ProductVersion : %o16version%)
if "%_Publisher2019Retail%" EQU "YES" (echo Publisher 2019 SingleApp ------------- ProductVersion : %o16version%)
if "%_SkypeForBusiness2019Retail%" EQU "YES" (echo Skype 2019 SingleApp ----------------- ProductVersion : %o16version%)
if "%_Word2019Volume%" EQU "YES" (echo Word 2019 SingleApp ------------------ ProductVersion : %o16version%)
if "%_Excel2019Volume%" EQU "YES" (echo Excel 2019 SingleApp ----------------- ProductVersion : %o16version%)
if "%_PowerPoint2019Volume%" EQU "YES" (echo PowerPoint 2019 SingleApp ------------ ProductVersion : %o16version%)
if "%_Access2019Volume%" EQU "YES" (echo Access 2019 SingleApp ---------------- ProductVersion : %o16version%)
if "%_Outlook2019Volume%" EQU "YES" (echo Outlook 2019 SingleApp --------------- ProductVersion : %o16version%)
if "%_Publisher2019Volume%" EQU "YES" (echo Publisher 2019 SingleApp ------------- ProductVersion : %o16version%)
if "%_SkypeForBusiness2019Volume%" EQU "YES" (echo Skype 2019 SingleApp ----------------- ProductVersion : %o16version%)
if "%_VisioProRetail%" EQU "YES" (echo VisioPro 2016 ------------------------ ProductVersion : %o16version%)
if "%_AppxVisio%" EQU "YES" (echo VisioPro 2016 UWP Appx Desktop App --- ProductVersion : %o16version%)
if "%_VisioPro2019Retail%" EQU "YES" (echo VisioPro 2019 ------------------------ ProductVersion : %o16version%)
if "%_VisioPro2019Volume%" EQU "YES" (echo VisioPro 2019 ------------------------ ProductVersion : %o16version%)
if "%_ProjectProRetail%" EQU "YES" (echo ProjectPro 2016 ---------------------- ProductVersion : %o16version%)
if "%_AppxProject%" EQU "YES" (echo ProjectPro 2016 UWP Appx Desktop App - ProductVersion : %o16version%)
if "%_ProjectPro2019Retail%" EQU "YES" (echo ProjectPro 2019 ---------------------- ProductVersion : %o16version%)
if "%_ProjectPro2019Volume%" EQU "YES" (echo ProjectPro 2019 ---------------------- ProductVersion : %o16version%)
echo ____________________________________________________________________________
echo:
for /F "tokens=2,*" %%A IN ('reg query "HKLM\Software\Microsoft\Office\ClickToRun\Configuration" /v "CDNBaseUrl" 2^>nul') DO (Set "CDNBaseUrl=%%B")
call:DecodeChannelName %CDNBaseUrl%
echo Distribution-Channel:
echo %ChannelName%
echo:
echo CDNBase-Url:
echo %CDNBaseUrl%
echo:
for /F "tokens=2,*" %%A IN ('reg query "HKLM\Software\Microsoft\Office\ClickToRun\Configuration" /v "UpdateUrl" 2^>nul') DO (Set "UpdateUrl=%%B")
call:DecodeChannelName %UpdateUrl%
echo Updates-Channel:
echo %ChannelName%
echo:
echo Updates-Url:
echo %UpdateUrl%
echo:
echo Group-Policy defined UpdateBranch:
for /F "tokens=2,*" %%A IN ('reg query "HKLM\SOFTWARE\Policies\Microsoft\Office\16.0\Common\OfficeUpdate" /v "UpdateBranch" 2^>nul') DO (Set "UpdateBranch=%%B")
echo %UpdateBranch%
echo ____________________________________________________________________________
echo:
echo Possible Office 2016 Update-Channel ID VALUES:
echo 1 = Monthly_Channel (Retail/RTM)
echo 2 = Insider_Channel (Office Insider FAST)
echo 3 = Monthly_Channel_Targeted (Office Insider SLOW)
echo 4 = Semi_Annual_Channel (Business)
echo 5 = Semi_Annual_Channel_Targeted (Business Insider)
echo 6 = Dogfood_DevMain_Channel (MS Internal Use Only)
echo X = exit to Main Menu
echo:
set /p channeltrigger=Set New Update-Channel-ID (1,2,3,4,5,6) or X ^>
if "%channeltrigger%" EQU "1" (
set "latestfile=latest_Monthly_Channel_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60"
set "UpdateBranch=Current"
goto:UpdateChannelSel
)
if "%channeltrigger%" EQU "2" (
set "latestfile=latest_Insider_Channel_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/5440fd1f-7ecb-4221-8110-145efaa6372f"
set "UpdateBranch=InsiderFast"
goto:UpdateChannelSel
)
if "%channeltrigger%" EQU "3" (
set "latestfile=latest_Monthly_Channel_Targeted_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-8840a6a4f5be"
set "UpdateBranch=FirstReleaseCurrent"
goto:UpdateChannelSel
)
if "%channeltrigger%" EQU "4" (
set "latestfile=latest_Semi_Annual_Channel_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/7ffbc6bf-bc32-4f92-8982-f9dd17fd3114"
set "UpdateBranch=Deferred"
goto:UpdateChannelSel
)
if "%channeltrigger%" EQU "5" (
set "latestfile=latest_Semi_Annual_Channel_Targeted_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/b8f9b850-328d-4355-9145-c59439a0c4cf"
set "UpdateBranch=FirstReleaseDeferred"
goto:UpdateChannelSel
)
if "%channeltrigger%" EQU "6" (
set "latestfile=latest_Dogfood_DevMain_Channel_build.txt"
set "UpdateUrl=http://officecdn.microsoft.com/pr/ea4a4090-de26-49d7-93c1-91bff9e53fc3"
set "UpdateBranch=not set"
goto:UpdateChannelSel
)
if /I "%channeltrigger%" EQU "X" (goto:Office16VnextInstall)
goto:ChangeUpdPath
::===============================================================================================================
:UpdateChannelSel
echo:
set /a countx=0
cd /D "%OfficeRToolpath%"
for /F "tokens=*" %%a in (!latestfile!) do (
SET /a countx=!countx! + 1
set var!countx!=%%a
)
set "o16upg1build=%var1%"
set "o16upg2build=%var2%"
echo Manually enter any build-nummer such as %o16upg2build%(prior build)
echo or simply press return for updating to: %o16upg1build%(newest build)
set /p restrictbuild=Set Office update build ^>
if "%restrictbuild%" NEQ "newest available" set "updatetoversion=updatetoversion=%restrictbuild%"
call :DecodeChannelName %UpdateUrl%
echo ____________________________________________________________________________
echo:
echo New Update-Configuration will be set to:
echo:
echo Distribution-Channel : %ChannelName%
echo Update To Version : %restrictbuild%
echo:
set /p installtrigger=Change Configuration and start download of new Office version (1/0)? ^>
if "%installtrigger%" EQU "0" goto:ChangeUpdPath
if "%installtrigger%" EQU "1" goto:ChangeUpdateConf
if /I "%installtrigger%" EQU "X" goto:Office16VnextInstall
goto:ChangeUpdPath
::===============================================================================================================
:ChangeUpdateConf
reg add HKLM\Software\Microsoft\Office\ClickToRun\Configuration /v CDNBaseUrl /d %UpdateUrl% /f >nul 2>&1
reg add HKLM\Software\Microsoft\Office\ClickToRun\Configuration /v UpdateUrl /d %UpdateUrl% /f >nul 2>&1
reg add HKLM\Software\Microsoft\Office\ClickToRun\Configuration /v UpdateChannel /d %UpdateUrl% /f >nul 2>&1
reg add HKLM\Software\Microsoft\Office\ClickToRun\Configuration /v UpdateChannelChanged /d True /f >nul 2>&1
if "%UpdateBranch%" EQU "not set" reg delete HKLM\Software\Policies\Microsoft\Office\16.0\Common\OfficeUpdate /v UpdateBranch /f >nul 2>&1
if "%UpdateBranch%" NEQ "not set" reg add HKLM\Software\Policies\Microsoft\Office\16.0\Common\OfficeUpdate /v UpdateBranch /d %UpdateBranch% /f >nul 2>&1
reg delete HKLM\Software\Microsoft\Office\ClickToRun\Configuration /v UpdateToVersion /f >nul 2>&1
reg delete HKLM\Software\Microsoft\Office\ClickToRun\Updates /v UpdateToVersion /f >nul 2>&1
if "%restrictbuild%" NEQ "newest available" (("%CommonProgramFiles%\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user %updatetoversion% updatepromptuser=True displaylevel=True)&&(goto:Office16VnextInstall))
"%CommonProgramFiles%\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user updatepromptuser=True displaylevel=True >nul 2>&1
goto:Office16VnextInstall
::===============================================================================================================
::===============================================================================================================
:DecodeChannelName
set "ChannelName=%1"
set "ChannelName=%ChannelName:~-36%"
if "%ChannelName%" EQU "492350f6-3a01-4f97-b9c0-c7c6ddf67d60" (set "ChannelName=Monthly_Channel (Retail/RTM)")&&(goto:eof)
if "%ChannelName%" EQU "5440fd1f-7ecb-4221-8110-145efaa6372f" (set "ChannelName=Insider (Office Insider FAST)")&&(goto:eof)
if "%ChannelName%" EQU "64256afe-f5d9-4f86-8936-8840a6a4f5be" (set "ChannelName=Monthly_Channel_Targeted (Office Insider SLOW)")&&(goto:eof)
if "%ChannelName%" EQU "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114" (set "ChannelName=Semi_Annual_Channel (Business)")&&(goto:eof)