Package "Cumulative Update for .NET Framework for Windows 10, version 1809 and Windows Server 2019"

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Answer
jlatieule
Messages: 59
Registration: July 3, 2019 - 9:18 AM

September 18, 2024 - 11:41

Good morning,


I just created a package to perform the "Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows 10, version 1809 and Windows Server 2019"

https://support.microsoft.com/fr-fr/top ... f09e30fcf3

More specifically, KB5042350 dated August 13, 2024

Depending on whether it's .NET Framework 4.8 or later, the msu file is different.
The versions can be found in the registry; more information on https://learn.microsoft.com/fr-fr/dotne ... -installed

Best of luck to everyone


Code: Select all

from setuphelpers import *
import re

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    with EnsureWUAUServRunning():
        # Choix du MSU en fonction du .NET Framework
        if registry_readstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full','Release') >= '528040' :
            # .NET Framework 4.8 ou plus
            kb_files = [
                'windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d',
                ]
        else:
            # .NET Framework 3.5 à 4.7.2
            kb_files = [
                'windows10.0-kb5041913-x64_b00cd2de1915f11b56c21d7001962f67854afe07.msu',
                ]
        for kb_file in kb_files:
            kb_guess = re.findall(r'^.*-(KB.*)-',kb_file)
            if not kb_guess or not is_kb_installed(kb_guess[0]):
                print("Installation de {}".format(kb_file))
                run('wusa.exe "{}" /quiet /norestart'.format(kb_file), accept_returncodes=[0, 3010, 2359302, -2145124329], timeout=1800)
            else:
                print("{} est déjà installé".format(kb_file))

    if is_pending_reboot():
        print("Un redémarrage est nécessaire !")
System and Network Administrator at Domitia Habitat
jlatieule
Messages: 59
Registration: July 3, 2019 - 9:18 AM

September 18, 2024 - 11:49

However, on servers with .NET Framework 4.8 installed, the MSU installation returns an exit status of 2
If I run the installation graphically, I don't get an error message... but if I restart the installation, I get the message that the message is already installed

Here is the installation log, and I don't know how to improve the situation

Code: Select all

Ensure wuauserv Auto Update option is disabled
Installation de windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d
re-enabling wuauserv previous state: 0
Erreur lors de l'installation de ['ophlm-kb5042350(=1.1.0-4)']: erreurs dans les paquets [[PackageRequest(package='ophlm-kb5042350',version=(Version('1.1.0.0'), 4),architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows-10', 'win-10', 'w-10', 'windows10', 'win10', 'w10', 'windows', 'win', 'w'],min_os_version=Version('10.0.17763'),max_os_version=Version('10.0.17763')), PackageEntry('ophlm-kb5042350','1.1.0-4' architecture='x64',maturity='PROD',target_os='windows'), 'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 5348, in install\n    result = self.install_wapt(p.localpath,\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4328, in install_wapt\n    raise e\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4235, in install_wapt\n    exitstatus = setup.install()\n  File "C:\\Windows\\TEMP\\waptxgn6fxcm\\setup.py", line 28, in install\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3991, in run\n    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))\n  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2177, in run\n    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))\nwaptutils.CalledProcessErrorOutput: Command \'wusa.exe "windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d" /quiet /norestart\' returned non-zero exit status 2.\nOutput:\n']]
Traceback (most recent call last):
  File "<string>", line 1943, in run
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 737, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 1341, in _run
    raise Exception(_('Error during install of {}: errors in packages {}').format(
Exception: Erreur lors de l'installation de ['ophlm-kb5042350(=1.1.0-4)']: erreurs dans les paquets [[PackageRequest(package='ophlm-kb5042350',version=(Version('1.1.0.0'), 4),architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows-10', 'win-10', 'w-10', 'windows10', 'win10', 'w10', 'windows', 'win', 'w'],min_os_version=Version('10.0.17763'),max_os_version=Version('10.0.17763')), PackageEntry('ophlm-kb5042350','1.1.0-4' architecture='x64',maturity='PROD',target_os='windows'), 'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 5348, in install\n    result = self.install_wapt(p.localpath,\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4328, in install_wapt\n    raise e\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4235, in install_wapt\n    exitstatus = setup.install()\n  File "C:\\Windows\\TEMP\\waptxgn6fxcm\\setup.py", line 28, in install\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3991, in run\n    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))\n  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2177, in run\n    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))\nwaptutils.CalledProcessErrorOutput: Command \'wusa.exe "windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d" /quiet /norestart\' returned non-zero exit status 2.\nOutput:\n']]

Exception: Erreur lors de l'installation de ['ophlm-kb5042350(=1.1.0-4)']: erreurs dans les paquets [[PackageRequest(package='ophlm-kb5042350',version=(Version('1.1.0.0'), 4),architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows-10', 'win-10', 'w-10', 'windows10', 'win10', 'w10', 'windows', 'win', 'w'],min_os_version=Version('10.0.17763'),max_os_version=Version('10.0.17763')), PackageEntry('ophlm-kb5042350','1.1.0-4' architecture='x64',maturity='PROD',target_os='windows'), 'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 5348, in install\n    result = self.install_wapt(p.localpath,\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4328, in install_wapt\n    raise e\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4235, in install_wapt\n    exitstatus = setup.install()\n  File "C:\\Windows\\TEMP\\waptxgn6fxcm\\setup.py", line 28, in install\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3991, in run\n    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))\n  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2177, in run\n    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))\nwaptutils.CalledProcessErrorOutput: Command \'wusa.exe "windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d" /quiet /norestart\' returned non-zero exit status 2.\nOutput:\n']]
Traceback (most recent call last):
  File "<string>", line 1943, in run
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 737, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 1341, in _run
    raise Exception(_('Error during install of {}: errors in packages {}').format(
Exception: Erreur lors de l'installation de ['ophlm-kb5042350(=1.1.0-4)']: erreurs dans les paquets [[PackageRequest(package='ophlm-kb5042350',version=(Version('1.1.0.0'), 4),architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows-10', 'win-10', 'w-10', 'windows10', 'win10', 'w10', 'windows', 'win', 'w'],min_os_version=Version('10.0.17763'),max_os_version=Version('10.0.17763')), PackageEntry('ophlm-kb5042350','1.1.0-4' architecture='x64',maturity='PROD',target_os='windows'), 'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 5348, in install\n    result = self.install_wapt(p.localpath,\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4328, in install_wapt\n    raise e\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4235, in install_wapt\n    exitstatus = setup.install()\n  File "C:\\Windows\\TEMP\\waptxgn6fxcm\\setup.py", line 28, in install\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3991, in run\n    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))\n  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2177, in run\n    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))\nwaptutils.CalledProcessErrorOutput: Command \'wusa.exe "windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d" /quiet /norestart\' returned non-zero exit status 2.\nOutput:\n']]
System and Network Administrator at Domitia Habitat
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

September 20, 2024 - 1:09 PM

Good morning

The following command should be run:

Code: Select all

wusa.exe "windows10.0-kb5041974-x64-ndp48_e8660214346c8ac124e2f99aa21eef697fff307d" /quiet /norestart
It clearly doesn't work on the machine

If you then remove the /quiet, you will likely get an error message explaining why it's not working
jlatieule
Messages: 59
Registration: July 3, 2019 - 9:18 AM

September 25, 2024 - 3:16 PM

I didn't understand why it worked when the command was executed on the server.

I had forgotten the file extension for the .msu file in setup.py.
The problem is solved.
System and Network Administrator at Domitia Habitat
Answer