How to manually install updates from commandline

How to manually install updates from commandline

Postby DavidXanatos » 29.09.2018, 07:39

Hi,

I was looking through the cmd files used to install updates and saw that they are passing various parameters to different updates packet types.
if there a simple guide how to install all this msi, msu, etc... update packets silently from command line?

Cheers
David X.
DavidXanatos
 
Posts: 4
Joined: 22.09.2018, 17:17

Re: How to manually install updates from commandline

Postby Dalai » 29.09.2018, 13:25

Take a look at wsusoffline\client\cmd\InstallOSUpdate.cmd, in particular the sections InstExe, InstMsi, InstMsu and InstCab/InstDism. Example:
Code: Select all
:InstMsu
%SystemRoot%\System32\wusa.exe %1 /quiet /norestart


Code: Select all
:InstDism
[...]
if exist %SystemRoot%\Sysnative\Dism.exe (
  %SystemRoot%\Sysnative\Dism.exe /Online /Quiet /NoRestart /Add-Package /PackagePath:%1 /IgnoreCheck
) else (
  %SystemRoot%\System32\Dism.exe /Online /Quiet /NoRestart /Add-Package /PackagePath:%1 /IgnoreCheck
)


Regards
Dalai
Dalai
 
Posts: 1041
Joined: 12.07.2016, 21:00

Re: How to manually install updates from commandline

Postby DavidXanatos » 04.10.2018, 19:05

What about this:

Code: Select all
if "%SELECT_OPTIONS%" NEQ "1" set INSTALL_SWITCHES=%2 %3 %4 %5 %6 %7 %8 %9

it seams InstallOSUpdate.cmd can get additional switches from the script that calls it,
how to know which switches to give?

and how do i know if i need to reboot after an update?
DavidXanatos
 
Posts: 4
Joined: 22.09.2018, 17:17

Re: How to manually install updates from commandline

Postby Dalai » 04.10.2018, 21:43

DavidXanatos wrote:What about this:

Code: Select all
if "%SELECT_OPTIONS%" NEQ "1" set INSTALL_SWITCHES=%2 %3 %4 %5 %6 %7 %8 %9

it seams InstallOSUpdate.cmd can get additional switches from the script that calls it [...]

This section only applies to EXE files. It's there because EXE updates might need different switches, and they certainly did back in the Win2k and XP days.

how to know which switches to give?

Do you have any EXE update files you intend to install manually? They're rare these days, except the .NET updates. If you have any, you can see what's done in InstallOSUpdate.cmd: check OptionList-Q.txt and OptionList-qn.txt to see if the update (KB number) is in there, and if it's in neither of them, use the common /q /z.

and how do i know if i need to reboot after an update?

Check the %errorlevel% environment variable, just like InstallOSUpdate.cmd does.

Regards
Dalai
Dalai
 
Posts: 1041
Joined: 12.07.2016, 21:00

Re: How to manually install updates from commandline

Postby DavidXanatos » 05.10.2018, 15:30

those for starters:
Code: Select all
KB2979596\sqlserver2008sp4-kb2979596-x64-enu_13610d6cb39e37fcd4a3338244a3ca2a8a404cd8.exe
KB2993928\aspnetmvc4-kb2993928_760cf4c85474bbe1809b9fab9b2996ff04c23b88.exe
KB2993937\aspnetmvc3-kb2993937_414b06c8f9800e88e1abb6a28ead93e445f92878.exe
KB2993939\aspnetmvc2-kb2993939_1e3f60495160a568adb51b09af5c7b0a95146764.exe
KB4018073\sqlserver2012sp4-kb4018073-x64-enu_95127ee2e8dfef180752e531a83cd948c24a3a87.exe
KB4023307\silverlight_developer_x64_e2bfca198b98e1a16d947a5eeb7d1e47128a6d85.exe
KB4340004\ndp46-kb4338606-x64_63c347b905153e90bbf2e73d849cd176f3613ef4.exe
KB4345679\ndp46-kb4344167-x64_82ae8f8cfc9c6ba82e68a30a9167b93747fb423b.exe
KB4457144\pciclearstalecache_7e856b95c514e1ec18de7263030237e8ef0160a8.exe
KB4457914\ndp46-kb4457027-x64_d41e8cfe75d2d0ef99f9e1fd8c75db343027cbf0.exe
KB4457918\ndp46-kb4457035-x64_4291fe54102413fc8b00eb772951fcf412aec637.exe
KB890830\windows-kb890830-x64-v5.64_ad342265a4fcf94b6c1013e90990080449f16fe6.exe  <- thats teh amlicius sotware removal tool


but really i'm looking for a howto that would work with any update I may download.
DavidXanatos
 
Posts: 4
Joined: 22.09.2018, 17:17

Re: How to manually install updates from commandline

Postby Dalai » 05.10.2018, 15:48

Well, I don't know of any HowTo (which doesn't mean there isn't any). I can't tell you much more than to look in InstallOSUpdate.cmd (and perhaps DoUpdate.cmd). It's all in there. Yes, it's a bit of work to sift through the code.

Regards
Dalai
Dalai
 
Posts: 1041
Joined: 12.07.2016, 21:00

Re: How to manually install updates from commandline

Postby DavidXanatos » 05.10.2018, 16:06

Ok I see, thanks
DavidXanatos
 
Posts: 4
Joined: 22.09.2018, 17:17


Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 49 guests