Typo in DownloadUpdates.cmd 12.3 (b12)

Typo in DownloadUpdates.cmd 12.3 (b12)

Postby hbuhrmester » 17.09.2020, 05:28

Ein Tippfehler im Skript DownloadUpdates.cmd verhindert, dass die ExcludeList-w100-1903_1909.txt auf dynamische Updates angewendet wird. Deshalb lädt das Skript DownloadUpdates.cmd bis zu 12 Updates zusätzlich herunter.


Für einen Vergleich der Ergebnisse unter Windows und Linux habe ich alle Windows-10-Versionen bis auf 1507_x86 und 1507_x64 abgewählt:

Code: Select all
[Platforms]
1507_x86=Enabled
1507_x64=Enabled
1607_x86=Disabled
1607_x64=Disabled
1709_x86=Disabled
1709_x64=Disabled
1803_x86=Disabled
1803_x64=Disabled
1809_x86=Disabled
1809_x64=Disabled
1903_x86=Disabled
1903_x64=Disabled
1909_x86=Disabled
1909_x64=Disabled
2004_x86=Disabled
2004_x64=Disabled



Mit dieser Auswahl wurden unter Windows 12 Dateien mehr heruntergeladen als unter Linux:

Code: Select all
windows10.0-kb4495620-x86_701452ef54a30d32c0f9c7ebf2128397a9b216c3.cab
windows10.0-kb4514359-x86_c4ca1c38fe65494d6d77338d50508dcd16999c00.cab
windows10.0-kb4532938-x86-ndp48_dddba0fbf5845801862b2ec634ee0361dd4d42dc.cab
windows10.0-kb4561600-x86_e102dadd7c65a801e518afbf04cbc63060bcffc1.cab
windows10.0-kb4565351-x86_f622f9a47848128ecc955627bf9169ce810ed433.cab
windows10.0-kb4565633-x86-ndp48_ef48b88b5457e3cebb192e0b662fa2120aa806cd.cab

windows10.0-kb4495620-x64_d12f276f70166c561b707d45f45e94d8da5265a5.cab
windows10.0-kb4514359-x64_8205dba609165b332076fbac1900860f577588a2.cab
windows10.0-kb4532938-x64-ndp48_d0049f1a78b9bdf166dbfce457310dd30e65dfc5.cab
windows10.0-kb4561600-x64_cbbba2f0ef6e8c529713ea687ea5a53dedb1db81.cab
windows10.0-kb4565351-x64_eff844b202eee94e3849e8de696891b0d7e1fa39.cab
windows10.0-kb4565633-x64-ndp48_2ef3fd9181bc103e2f6e5fe75858fd830c4eafc7.cab



Alle kb-Nummern stehen in der Datei ExcludeList-w100-1903_1909.txt. Wenn sowohl Version 1903 als auch Version 1909 abgewählt sind, sollten diese Dateien deshalb nicht heruntergeladen werden.

Bei der Berechnung der statischen Updates werden alle Dateien ExcludeList-w100-%%i.txt und die ExcludeList-w100-1903_1909.txt in eine temporäre Datei ExcludeListStatic.txt geschrieben:

DownloadUpdates.cmd 12.3 (b12), Zeilen 1315-1338 (Auszug)
Code: Select all
type ..\exclude\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeListStatic.txt"
type ..\exclude\custom\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeListStatic.txt"

type ..\exclude\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
type ..\exclude\custom\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"


DownloadUpdates.cmd 12.3 (b12), Zeilen 1315-1338
Code: Select all
rem *** Windows 10 version specific exclusion ***
if not errorlevel 1 (
  if exist ..\Windows10Versions.ini (
    for /f "skip=1 tokens=1-3 delims=_= " %%i in (..\Windows10Versions.ini) do (
      if "%%j"=="%3" (
        if /i "%%k"=="Disabled" (
          if exist ..\exclude\ExcludeList-w100-%%i.txt type ..\exclude\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeListStatic.txt"
          if exist ..\exclude\custom\ExcludeList-w100-%%i.txt type ..\exclude\custom\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeListStatic.txt"
          if "%%i"=="1903" set DISABLED1903=1
          if "%%i"=="1909" set DISABLED1909=1
        )
      )
    )
    if "!DISABLED1903!"=="1" (
      if "!DISABLED1909!"=="1" (
        if exist ..\exclude\ExcludeList-w100-1903_1909.txt type ..\exclude\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
        if exist ..\exclude\custom\ExcludeList-w100-1903_1909.txt type ..\exclude\custom\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
      )
    )
    set DISABLED1903=
    set DISABLED1909=
  )
)



Bei der Berechnung der dynamischen Updates werden die Dateien ExcludeList-w100-%%i.txt in eine temporäre Datei ExcludeList-%1.txt geschrieben.

Die Datei ExcludeList-w100-1903_1909.txt wird wieder in eine temporäre Datei ExcludeListStatic.txt geschrieben. Das ist an dieser Stelle ein Fehler, da hier die dynamischen Updates berechnet werden sollen. Deshalb wird die Datei ExcludeList-w100-1903_1909.txt nicht auf die dynamischen Updates angewendet, und die enthaltenen kb-Nummern werden nicht vom Download ausgeschlossen.

DownloadUpdates.cmd 12.3 (b12), Zeilen 1412-1435 (Auszug)
Code: Select all
type ..\exclude\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeList-%1.txt"
type ..\exclude\custom\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeList-%1.txt"

type ..\exclude\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
type ..\exclude\custom\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"


DownloadUpdates.cmd 12.3 (b12), Zeilen 1412-1435
Code: Select all
rem *** Windows 10 version specific exclusion ***
echo %1 | %SystemRoot%\System32\find.exe /I "w100" >nul 2>&1
if not errorlevel 1 (
  if exist ..\Windows10Versions.ini (
    for /f "skip=1 tokens=1-3 delims=_= " %%i in (..\Windows10Versions.ini) do (
      if "%%j"=="%3" (
        if /i "%%k"=="Disabled" (
          if exist ..\exclude\ExcludeList-w100-%%i.txt type ..\exclude\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeList-%1.txt"
          if exist ..\exclude\custom\ExcludeList-w100-%%i.txt type ..\exclude\custom\ExcludeList-w100-%%i.txt >>"%TEMP%\ExcludeList-%1.txt"
          if "%%i"=="1903" set DISABLED1903=1
          if "%%i"=="1909" set DISABLED1909=1
        )
      )
    )
    if "!DISABLED1903!"=="1" (
      if "!DISABLED1909!"=="1" (
        if exist ..\exclude\ExcludeList-w100-1903_1909.txt type ..\exclude\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
        if exist ..\exclude\custom\ExcludeList-w100-1903_1909.txt type ..\exclude\custom\ExcludeList-w100-1903_1909.txt >>"%TEMP%\ExcludeListStatic.txt"
      )
    )
    set DISABLED1903=
    set DISABLED1909=
  )
)



Viele Grüße
hbuhrmester
 
Posts: 525
Joined: 11.10.2013, 20:59

Re: Typo in DownloadUpdates.cmd 12.3 (b12)

Postby aker » 19.09.2020, 22:59

Danke für den Hinweis.
Ich habe den Fehler in der "12.3 (b15)" gefixt.

:arrow: https://gitlab.com/wsusoffline/wsusoffline/-/commit/634e5e41f6bfb1a5816f8b08f4fd82b806d6f712

Viele Grüße
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32


Return to Verschiedenes / Miscellaneous

Who is online

Users browsing this forum: No registered users and 6 guests