HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/win_dotnet.cpython-310.pyc
o

�N�g��@sZdZddlZddlmmZddlmZdZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dS)z+
Dot NET functions

.. versionadded:: 3001
�N)�VersionZdotnetcCstjj��sdStS)z*
    Only load if platform is Windows
    )Fz"This utility only works on Windows)�salt�utils�platformZ
is_windows�__virtualname__�rr�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/win_dotnet.py�__virtual__sr	c
	Csjd}d}tj||d�}dd�}gid�}|D]�}|�d�r�tj|d�||g�d	d
�r[tj|d�||g�dd
�d}|s<qtj|d�||g�d	d
�d}tj|d�||g�d
d
�d}n7tj|d�||dg�dd
�r�tj|d�||dg�dd
�d}|s|q|tj|d�||dg�dd
�d�}d}nq|dkr�d|��nd}	|d�|�|||�|	��d�|d|<q|S)a1
    Figure out what versions of .NET are installed on the system

    Returns:
        dict: A dictionary containing two keys:
            - versions: A list of versions installed on the system
            - details: A dictionary with details about the versions installed on
              the system
    ZHKLMz*SOFTWARE\Microsoft\NET Framework Setup\NDP)�hive�keycSs||dkrdS|dkrdS|dkrdS|dkrdS|d	krd
S|dkr$dS|d
kr*dS|dkr0dS|dkr6dS|dkr<dSdS)Ni�z4.8i�z4.7.2i�	z4.7.1i�z4.7i2z4.6.2iz4.6.1iOz4.6i��z4.5.2i3�z4.5.1i�z4.5r)�releaserrr�dotnet_45_plus_versions(s*�z)versions.<locals>.dotnet_45_plus_versions)�versions�details�v�\r)r
rZvnameZInstallZvdata�SP�FullZReleasezN/Az SP�r)�version�service_pack�fullr)�win_regZ	list_keys�
startswithZvalue_exists�joinZ
read_value�append)
r
rZver_keysr
Zreturn_dictZver_key�installr�sprrrrrsp


�������������
��rcCstt�d�S)z�
    Get a sorted list of .NET versions installed on the system

    Returns:
        list: A sorted list of versions installed on the system
    r)�sortedrrrrr�
versions_listpsrcCs
t�dS)az
    Get the details for all versions of .NET installed on a system

    Returns:
        dict: A dictionary of details for each version on the system. Contains
        the following keys:
            - version: The version installed
            - service_pack: The service pack for the version installed
            - full: The full version name including the service pack
    r)rrrrr�versions_detailszs
r cCs*t�D]}t|�tt|��krdSqdS)a.
    Check that the system contains a version of .NET that is at least the
    passed version.

    Args:

        version (str): The version to check for

    Returns:
        bool: ``True`` if the system contains a version of .NET that is at least
        the passed version, otherwise ``False``
    TF)rr�str)rZdotnet_versionrrr�version_at_least�s


�r")�__doc__Zsalt.utils.platformrZsalt.utils.win_regrrZsalt.utils.versionsrrr	rrr r"rrrr�<module>s
V