Sometimes you may need to deployment via SCCM through Packages using the command WUSA. You may put in Command line in Program something like below: wusa.exe …..
After deployment, the client shows the update gets installed successfully but the SCCM console shows Error with the code 1641.
Strictly speaking, 1641 cannot even be considered as an error because all it asks is a reboot:
Error Code: 0x669 (1641) Error Name: ERROR_SUCCESS_REBOOT_INITIATED Error Source: Msi.h Error Message: The requested operation completed successfully. The system will be restarted so the changes can take effect.
If you look at the execmgr.log, you can find similar information as below. You follow the instructions to restart the client computer, but the error messages in the SCCM console stays forever.
07-15-2021 16:18:03.644 execmgr 10342 (0x27a4) Program exit code 1641 07-15-2021 16:18:03.645 execmgr 10342 (0x27a4) Looking for MIF file to get program status 07-15-2021 16:18:03.647 execmgr 10342 (0x27a4) Script for Package:testpkg, Program: Install failed with exit code 1641 07-15-2021 16:18:03.660 execmgr 10342 (0x27a4) Raising event: [SMS_CodePage(874), SMS_LocaleID(1054)] instance of SoftDistProgramErrorEvent { AdvertisementId = "APRCONTOSO"; ClientID = "GUID:ed123456-e3e9-2345-9f26-3ff8b875f376"; DateTime = "20210715091803.654000+000"; ExitCode = "1641"; MachineName = "cntcontoso"; PackageName = "testpkg"; ProcessID = 4788; ProgramName = "Install"; SiteCode = "CNT"; ThreadID = 10342; UserContext = "NT AUTHORITY\SYSTEM"; }; 07-15-2021 16:18:03.663 execmgr 10342 (0x27a4) Raised Program Error Event for Ad:APRCONTOSO, Package:testpkg, Program: Install 07-15-2021 16:18:03.685 execmgr 8256 (0x2040) Execution is complete for program Install. The exit code is 1641, the execution status is FailureNonRetry
A simple way to resolve is to wrap the command wusa.exe in a bat file, eg. installupdate.bat and add exit 0
at the end. Something like this:
wusa.exe .....
exit 0
That way the package will always return 0, which will be considered as a Success.