Best practices for a manual configuration of the seconly configuration filesThe default configuration files
- Code: Select all
wsusoffline/client/exclude/HideList-seconly.txt
wsusoffline/client/static/StaticUpdateIds-w61-seconly.txt
wsusoffline/client/static/StaticUpdateIds-w62-seconly.txt
wsusoffline/client/static/StaticUpdateIds-w63-seconly.txt
should not be edited manually by the user. They may be replaced by newer versions from the server at any time, and then all manual changes will be lost.
One the other hand, manual changes to these files may actually prevent their update from the server: Since the download utilities wget and aria2 use timestamping for all downloads, the remote file on the server may not get downloaded, if the local file is newer. But this could only happen in the rare case, that both copies are edited at the same time.
However, the best approach would be to create new files with the same filenames in the "custom" subdirectories.
Full quality update rollups are then added to the file:
- Code: Select all
wsusoffline/client/exclude/custom/HideList-seconly.txt
Security only update rollups are sorted out into the files:
- Code: Select all
wsusoffline/client/static/custom/StaticUpdateIds-w61-seconly.txt
wsusoffline/client/static/custom/StaticUpdateIds-w62-seconly.txt
wsusoffline/client/static/custom/StaticUpdateIds-w63-seconly.txt
Each entry consists of a kb number and a description, separated by a comma. Use the existing files as examples. Note, that each file should end with an empty line. The description doesn't really matter. It will be displayed during installation and added to the installation log, but this is only for information.
The configuration files for the August 2017 updates could then look like:
wsusoffline/client/exclude/custom/HideList-seconly.txt
- Code: Select all
kb4034664,Windows 7 Monthly Rollup, August 8, 2017
kb4034665,Windows 8 Monthly Rollup, August 8, 2017
kb4034681,Windows 8.1 Monthly Rollup, August 8, 2017
wsusoffline/client/static/custom/StaticUpdateIds-w61-seconly.txt
- Code: Select all
kb4034679,Windows 7 Security-only update, August 8, 2017
wsusoffline/client/static/custom/StaticUpdateIds-w62-seconly.txt
- Code: Select all
kb4034666,Windows 8 Security-only update, August 8, 2017
wsusoffline/client/static/custom/StaticUpdateIds-w63-seconly.txt
- Code: Select all
kb4034672,Windows 8.1 Security-only update, August 8, 2017
More on the usage of the configuration filesThe "custom" configuration files are actually used.
For download, the code is in the script
DownloadUpdates.cmd:
wsusoffline/cmd/DownloadUpdates.cmd, lines 1275-1286
- Code: Select all
if "%SECONLY%"=="1" (
if exist ..\client\exclude\HideList-seconly.txt (
for /F "tokens=1* delims=,;" %%i in (..\client\exclude\HideList-seconly.txt) do (
echo %%i>>"%TEMP%\ExcludeList-%1.txt"
)
)
if exist ..\client\exclude\custom\HideList-seconly.txt (
for /F "tokens=1* delims=,;" %%i in (..\client\exclude\custom\HideList-seconly.txt) do (
echo %%i>>"%TEMP%\ExcludeList-%1.txt"
)
)
)
Here, the kb numbers are extracted from both ..\client\exclude\HideList-seconly.txt and ..\client\exclude\custom\HideList-seconly.txt (if existing) and added to a temporary exclude list. This will prevent the download of full quality update rollups, if security only updates are requested.
wsusoffline/cmd/DownloadUpdates.cmd, lines 1133-1144
- Code: Select all
for %%i in (w61 w62 w63) do (
for /F %%j in ('dir /B ..\client\static\StaticUpdateIds-%%i*-seconly.txt 2^>nul') do (
for /F "tokens=1* delims=,;" %%k in (..\client\static\%%j) do (
echo %%k>>"%TEMP%\ExcludeList-superseded-exclude.txt"
)
)
for /F %%j in ('dir /B ..\client\static\custom\StaticUpdateIds-%%i*-seconly.txt 2^>nul') do (
for /F "tokens=1* delims=,;" %%k in (..\client\static\custom\%%j) do (
echo %%k>>"%TEMP%\ExcludeList-superseded-exclude.txt"
)
)
)
The kb numbers from the files StaticUpdateIds-*-seconly.txt from both ..\client\static and ..\client\static\custom are added to a temporary file ExcludeList-superseded-exclude.txt. This file is meant to include downloads, which have been marked as "superseded" by Microsoft. But this may not be necessary anymore, because it was changed by Microsoft in December 2016.
During installation, the script
ListMissingUpdateIds.vbs stores the filename HideList-seconly.txt in a constant and then searches both locations:
wsusoffline/client/cmd/ListMissingUpdateIds.vbs, lines 6, 28, 36-37
- Code: Select all
Private Const strHideFileName = "HideList-seconly.txt"
...
Set objExec = objShell.Exec(objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\System32\find.exe /I """ & strKBNumber & """ ..\exclude\" & strHideFileName & " >nul 2>&1")
...
If CreateObject("Scripting.FileSystemObject").FileExists("..\exclude\custom\" & strHideFileName) Then
Set objExec = objShell.Exec(objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\System32\find.exe /I """ & strKBNumber & """ ..\exclude\custom\" & strHideFileName & " >nul 2>&1")
The script
ListUpdatesToInstall.cmd evaluates the files StaticUpdateIds-*-seconly.txt
wsusoffline/client/cmd/ListUpdatesToInstall.cmd, lines 56-58
- Code: Select all
if "%SECONLY%"=="1" (
call :EvalStatics ..\static\custom\StaticUpdateIds-%OS_NAME%-seconly.txt
call :EvalStatics ..\static\StaticUpdateIds-%OS_NAME%-seconly.txt
...