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: 3
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 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

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: 3
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 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

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 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

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: 2245
Joined: 07.07.2009, 14:38

Re: Shutdown on completion does not (always) work

Postby 51449 » 25.09.2019, 20:43

looks like fixed in v11.8.1: system did shutdown even when no update to be installed.

I would welcome this enhancement: 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.

Code: Select all
Wed 09/25/2019 12:43:02.59 - Info: Starting WSUS Offline Update v. 11.8.1
Wed 09/25/2019 12:43:02.66 - Info: Used path "D:\wsusoffline\client\cmd\" on MyComputer(user: Administrator)
Wed 09/25/2019 12:43:02.67 - Info: Option /updatecpp detected
Wed 09/25/2019 12:43:02.71 - Info: Option /updatercerts detected
Wed 09/25/2019 12:43:02.75 - Info: Option /seconly detected
Wed 09/25/2019 12:43:02.78 - Info: Option /verify detected
Wed 09/25/2019 12:43:02.81 - Info: Option /shutdown detected
Wed 09/25/2019 12:43:47.49 - Info: Found Microsoft Windows version 10.0.17134.1 (w100 x64 enu sp0)
Wed 09/25/2019 12:43:47.63 - Info: Found Microsoft Windows Software Licensing Management Tool info...
Wed 09/25/2019 12:43:48.55 - Info: Name: Windows(R), Professional edition
Wed 09/25/2019 12:43:48.56 - Info: Description: Windows(R) Operating System, RETAIL channel
Wed 09/25/2019 12:43:48.57 - Info: Partial Product Key: 3V66T
Wed 09/25/2019 12:43:48.58 - Info: License Status: Licensed
Wed 09/25/2019 12:43:48.60 - Info: Found total physical memory: 4 GB
Wed 09/25/2019 12:43:48.61 - Info: Found Windows Update Agent version 10.0.17134.1006
Wed 09/25/2019 12:43:48.62 - Info: Found Windows Installer version 5.0.17134.829
Wed 09/25/2019 12:43:48.63 - Info: Found Windows Script Host version 5.812.10240.16384
Wed 09/25/2019 12:43:48.64 - Info: Found Internet Explorer version 9.11.17134.0
Wed 09/25/2019 12:43:48.66 - Info: Found Microsoft Silverlight version 5.1.50918.0
Wed 09/25/2019 12:43:48.67 - Info: Found Remote Desktop Client version 10.0.17134.112
Wed 09/25/2019 12:43:48.68 - Info: Found Microsoft .NET Framework 3.5 version 3.5.30729.4926
Wed 09/25/2019 12:43:48.70 - Info: Found Windows PowerShell version 2.0
Wed 09/25/2019 12:43:48.75 - Info: Found Microsoft .NET Framework 4 version 4.7.03056 (release: 461808)
Wed 09/25/2019 12:43:48.76 - Info: Found Windows Management Framework version 5.1.17134.1
Wed 09/25/2019 12:43:48.93 - Info: Found Windows Defender definitions version 1.301.1990.0
Wed 09/25/2019 12:43:51.65 - Info: Catalog date: 9/10/2019
Wed 09/25/2019 12:43:51.89 - Info: Medium build date: 09/25/2019
Wed 09/25/2019 12:43:51.90 - Info: Medium supports Microsoft Windows (w100 x64 glb)
Wed 09/25/2019 12:44:49.64 - Info: Disabled screensaver
Wed 09/25/2019 12:44:53.75 - Info: Created temporary power scheme
Wed 09/25/2019 12:44:55.44 - Info: Adjusted power management settings
Wed 09/25/2019 12:44:56.76 - Info: Installed ..\win\glb\MicRooCerAut2011_2011_03_22.crt
Wed 09/25/2019 12:44:57.00 - Info: Installed ..\win\glb\Microsoft ECC Product Root Certificate Authority 2018.crt
Wed 09/25/2019 12:44:57.13 - Info: Installed ..\win\glb\Microsoft ECC Root Certificate Authority 2017.crt
Wed 09/25/2019 12:44:57.28 - Info: Installed ..\win\glb\Microsoft ECC TS Root Certificate Authority 2018.crt
Wed 09/25/2019 12:44:57.67 - Info: Installed ..\win\glb\Microsoft EV ECC Root Certificate Authority 2017.crt
Wed 09/25/2019 12:44:57.94 - Info: Installed ..\win\glb\Microsoft EV RSA Root Certificate Authority 2017.crt
Wed 09/25/2019 12:44:58.33 - Info: Installed ..\win\glb\Microsoft RSA Root Certificate Authority 2017.crt
Wed 09/25/2019 12:44:58.53 - Info: Installed ..\win\glb\Microsoft Time Stamp Root Certificate Authority 2014.crt
Wed 09/25/2019 12:44:59.02 - Info: Installed ..\win\glb\MicRooCerAut_2010-06-23.crl
Wed 09/25/2019 12:44:59.49 - Info: Installed ..\win\glb\Microsoft ECC Product Root Certificate Authority 2018.crl
Wed 09/25/2019 12:44:59.70 - Info: Installed ..\win\glb\Microsoft ECC Root Certificate Authority 2017.crl
Wed 09/25/2019 12:45:00.04 - Info: Installed ..\win\glb\Microsoft ECC TS Root Certificate Authority 2018.crl
Wed 09/25/2019 12:45:00.32 - Info: Installed ..\win\glb\Microsoft EV ECC Root Certificate Authority 2017.crl
Wed 09/25/2019 12:45:01.02 - Info: Installed ..\win\glb\Microsoft EV RSA Root Certificate Authority 2017.crl
Wed 09/25/2019 12:45:01.59 - Info: Installed ..\win\glb\Microsoft RSA Root Certificate Authority 2017.crl
Wed 09/25/2019 12:45:01.95 - Info: Installed ..\win\glb\Microsoft Time Stamp Root Certificate Authority 2014.crl
Wed 09/25/2019 12:52:02.02 - Info: Installed ..\msse\x64-glb\mpam-fe.exe
Wed 09/25/2019 12:53:41.26 - Info: Starting service 'Windows Update' (wuauserv)
Wed 09/25/2019 12:53:42.01 - Info: Waiting for service 'wuauserv' to reach state 'Running' (timeout: 60s)
Wed 09/25/2019 12:53:57.63 - Info: Service 'wuauserv' reached state 'Running'
Wed 09/25/2019 12:53:57.65 - Info: Started service 'Windows Update' (wuauserv)
Wed 09/25/2019 13:15:12.11 - Info: Listed ids of missing updates
Wed 09/25/2019 13:15:20.19 - Info: Listed ids of installed updates
Wed 09/25/2019 13:15:21.96 - Warning: Update kb4513696 (id: 5bee8786-128b-4747-9443-96e71f574166) not found
Wed 09/25/2019 13:15:24.45 - Info: Listed update files
Wed 09/25/2019 13:15:24.46 - Info: Any missing update was either black listed or not found
Wed 09/25/2019 13:15:24.94 - Info: Restored screensaver setting
51449
 
Posts: 3
Joined: 31.08.2019, 14:49


Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 51 guests