Shutdown on completion does not (always) work

Shutdown on completion does not (always) work

Postby 51449 » 31.08.2019, 15:03

[how to reproduce]
when running the "WSUS Offline Update 11.8 - Installer" with "shut down on completion" checked, it does -not- shutdown when "No missing update found. Nothing to do!" and then leaves the computer up and running (the whole night).

[expected behaviour]
when running the "WSUS Offline Update 11.8 - Installer" with "shut down on completion" checked, it always shuts down when completed, even when "no missing update found".

It would be nice to give the user the option to -not- shutdown at that very moment, and if the user then does not respond within a minute the system should shutdown.
51449
 
Posts: 2
Joined: 31.08.2019, 14:49

Re: Shutdown on completion does not (always) work

Postby aker » 01.09.2019, 01:05

Please post the content of C:\Windows\wsusofflineupdate.log in Code-tags of a run, where the problem occurs, here.
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to sell it.
aker
aker
 
Posts: 3316
Joined: 02.03.2011, 15:32
Location: %SystemRoot%\System32\Boot\winload.efi

Re: Shutdown on completion does not (always) work

Postby 51449 » 01.09.2019, 19:54

Code: Select all
Sat 08/31/2019  7:53:45.53 - Info: Starting WSUS Offline Update v. 11.8
Sat 08/31/2019  7:53:45.56 - Info: Used path "D:\wsusoffline\client\cmd\" on MyComputer (user: Administrator)
Sat 08/31/2019  7:53:45.61 - Info: Option /updatecpp detected
Sat 08/31/2019  7:53:45.66 - Info: Option /updatercerts detected
Sat 08/31/2019  7:53:45.72 - Info: Option /seconly detected
Sat 08/31/2019  7:53:45.76 - Info: Option /shutdown detected
Sat 08/31/2019  7:53:49.55 - Info: Found Microsoft Windows version 10.0.17134.1 (w100 x64 enu sp0)
Sat 08/31/2019  7:53:49.57 - Info: Found Microsoft Windows Software Licensing Management Tool info...
Sat 08/31/2019  7:53:49.84 - Info: Name: Windows(R), Professional edition
Sat 08/31/2019  7:53:49.85 - Info: Description: Windows(R) Operating System, RETAIL channel
Sat 08/31/2019  7:53:49.87 - Info: Partial Product Key: 3V66T
Sat 08/31/2019  7:53:49.88 - Info: License Status: Licensed
Sat 08/31/2019  7:53:49.89 - Info: Found total physical memory: 4 GB
Sat 08/31/2019  7:53:49.91 - Info: Found Windows Update Agent version 10.0.17134.915
Sat 08/31/2019  7:53:49.92 - Info: Found Windows Installer version 5.0.17134.829
Sat 08/31/2019  7:53:49.93 - Info: Found Windows Script Host version 5.812.10240.16384
Sat 08/31/2019  7:53:49.94 - Info: Found Internet Explorer version 9.11.17134.0
Sat 08/31/2019  7:53:49.96 - Info: Found Microsoft Silverlight version 5.1.50918.0
Sat 08/31/2019  7:53:49.97 - Info: Found Remote Desktop Client version 10.0.17134.112
Sat 08/31/2019  7:53:49.98 - Info: Found Microsoft .NET Framework 3.5 version 3.5.30729.4926
Sat 08/31/2019  7:53:50.00 - Info: Found Windows PowerShell version 2.0
Sat 08/31/2019  7:53:50.01 - Info: Found Microsoft .NET Framework 4 version 4.7.03056 (release: 461808)
Sat 08/31/2019  7:53:50.02 - Info: Found Windows Management Framework version 5.1.17134.1
Sat 08/31/2019  7:53:50.04 - Info: Found Windows Defender definitions version 1.301.180.0
Sat 08/31/2019  7:53:50.50 - Info: Catalog date: 8/12/2019
Sat 08/31/2019  7:53:50.71 - Info: Medium build date: 08/31/2019
Sat 08/31/2019  7:53:50.74 - Info: Medium supports Microsoft Windows (w100 x64 glb)
Sat 08/31/2019  7:53:51.15 - Info: Disabled screensaver
Sat 08/31/2019  7:53:52.30 - Info: Created temporary power scheme
Sat 08/31/2019  7:53:53.38 - Info: Adjusted power management settings
Sat 08/31/2019  7:53:54.15 - Info: Installed ..\win\glb\MicRooCerAut2011_2011_03_22.crt
Sat 08/31/2019  7:53:54.33 - Info: Installed ..\win\glb\Microsoft ECC Product Root Certificate Authority 2018.crt
Sat 08/31/2019  7:53:54.52 - Info: Installed ..\win\glb\Microsoft ECC Root Certificate Authority 2017.crt
Sat 08/31/2019  7:53:54.70 - Info: Installed ..\win\glb\Microsoft ECC TS Root Certificate Authority 2018.crt
Sat 08/31/2019  7:53:54.92 - Info: Installed ..\win\glb\Microsoft EV ECC Root Certificate Authority 2017.crt
Sat 08/31/2019  7:53:55.05 - Info: Installed ..\win\glb\Microsoft EV RSA Root Certificate Authority 2017.crt
Sat 08/31/2019  7:53:55.30 - Info: Installed ..\win\glb\Microsoft RSA Root Certificate Authority 2017.crt
Sat 08/31/2019  7:53:55.45 - Info: Installed ..\win\glb\Microsoft Time Stamp Root Certificate Authority 2014.crt
Sat 08/31/2019  7:53:55.75 - Info: Installed ..\win\glb\MicRooCerAut_2010-06-23.crl
Sat 08/31/2019  7:53:56.01 - Info: Installed ..\win\glb\Microsoft ECC Product Root Certificate Authority 2018.crl
Sat 08/31/2019  7:53:56.14 - Info: Installed ..\win\glb\Microsoft ECC Root Certificate Authority 2017.crl
Sat 08/31/2019  7:53:56.34 - Info: Installed ..\win\glb\Microsoft ECC TS Root Certificate Authority 2018.crl
Sat 08/31/2019  7:53:56.50 - Info: Installed ..\win\glb\Microsoft EV ECC Root Certificate Authority 2017.crl
Sat 08/31/2019  7:53:56.71 - Info: Installed ..\win\glb\Microsoft EV RSA Root Certificate Authority 2017.crl
Sat 08/31/2019  7:53:56.85 - Info: Installed ..\win\glb\Microsoft RSA Root Certificate Authority 2017.crl
Sat 08/31/2019  7:53:57.03 - Info: Installed ..\win\glb\Microsoft Time Stamp Root Certificate Authority 2014.crl
Sat 08/31/2019  7:54:02.31 - Info: Starting service 'Windows Update' (wuauserv)
Sat 08/31/2019  7:54:02.50 - Info: Waiting for service 'wuauserv' to reach state 'Running' (timeout: 60s)
Sat 08/31/2019  7:54:05.23 - Info: Service 'wuauserv' reached state 'Running'
Sat 08/31/2019  7:54:05.28 - Info: Started service 'Windows Update' (wuauserv)
Sat 08/31/2019  8:01:19.34 - Info: Listed ids of missing updates
Sat 08/31/2019  8:01:21.86 - Info: Listed ids of installed updates
Sat 08/31/2019  8:01:22.13 - Warning: Update kb4507435 not found
Sat 08/31/2019  8:01:22.44 - Info: Listed update files
Sat 08/31/2019  8:01:22.47 - Info: No missing update found
Sat 08/31/2019  8:01:22.66 - Info: Restored screensaver setting
Sat 08/31/2019  8:01:22.86 - Info: Activated previous power scheme
Sat 08/31/2019  8:01:23.02 - Info: Deleted temporary power scheme
Sat 08/31/2019  8:01:23.04 - Info: Ending WSUS Offline Update
51449
 
Posts: 2
Joined: 31.08.2019, 14:49

Re: Shutdown on completion does not (always) work

Postby aker » 05.09.2019, 10:39

I wasn't able to find the problem yet, but I think, it can be possible, that there is a missing shutdown-call in this case. I'll still have to test it...

@WSUSUpdateAdmin
From what I see, when taking a look at DoUpdate.cmd, I'd say that the script behaves this way:
- :NoUpdates
51449 wrote:
Code: Select all
Sat 08/31/2019  8:01:22.47 - Info: No missing update found


- call :Cleanup
51449 wrote:
Code: Select all
Sat 08/31/2019  8:01:22.66 - Info: Restored screensaver setting
Sat 08/31/2019  8:01:22.86 - Info: Activated previous power scheme
Sat 08/31/2019  8:01:23.02 - Info: Deleted temporary power scheme


-> if "%FINISH_MODE%"=="/shutdown" goto :eof
- call :FinalHooks
-> goto eof
- goto EoF
51449 wrote:
Code: Select all
Sat 08/31/2019  8:01:23.04 - Info: Ending WSUS Offline Update



Maybe we should add a "call :RebootOrShutdown", when no missing update is found (as it is no real error message, which always requires user interaction).
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to sell it.
aker
aker
 
Posts: 3316
Joined: 02.03.2011, 15:32
Location: %SystemRoot%\System32\Boot\winload.efi

Re: Shutdown on completion does not (always) work

Postby aker » 05.09.2019, 14:57

I think, I found a solution for you.
Please check, if this modification fits your needs.

Open .\client\cmd\DoUpdate.cmd in an editor (e.g. notepad++; the normal Windows Editor isn't the best for editing cmd-scripts).
Search for the line
Code: Select all
:NoUpdates

It should be line 1788 (for version 11.8).

Replace lines 1798 - 1799 containing
Code: Select all
call :Cleanup
call :FinalHooks

with this
Code: Select all
call :Cleanup
call :FinalHooks
call :RebootOrShutdown
.

The whole block should now look like this:
Code: Select all
:NoUpdates
echo.
if "%NO_MISSING_IDS%"=="1" (
  echo No missing update found. Nothing to do!
  call :Log "Info: No missing update found"
) else (
  echo Any missing update was either black listed or not found. Nothing to do!
  call :Log "Info: Any missing update was either black listed or not found"
)
echo.
call :Cleanup
call :FinalHooks
call :RebootOrShutdown
goto EoF


Then check, if it fits your needs.
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to sell it.
aker
aker
 
Posts: 3316
Joined: 02.03.2011, 15:32
Location: %SystemRoot%\System32\Boot\winload.efi

Re: Shutdown on completion does not (always) work

Postby WSUSUpdateAdmin » 11.09.2019, 15:13

Moin!

Ich habe jetzt

Code: Select all
if "%FINISH_MODE%"=="/shutdown" call :RebootOrShutdown

eingebaut, da ich einen unnötigen Neustart vermeiden möchte, wenn nichts installiert wurde.

VG Torsten
WSUSUpdateAdmin
Administrator
 
Posts: 2211
Joined: 07.07.2009, 14:38


Return to Installation / Updating

Who is online

Users browsing this forum: Google [Bot], stargate and 13 guests