tis-nomachine-client icon

NoMachine Client

Silent install package for NoMachine Client

8.13.1-20

  • package: tis-nomachine-client
  • name: NoMachine Client
  • version: 8.13.1-20
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: NoMachine S.à r.l.
  • licence: proprietary_free,wapt_public
  • locale: all
  • target_os: windows
  • impacted_process: nxagent,nxauth,nxd,nxdisplay,nxdx32,nxdx64,nxexec,nxfs,nxfsserver,nxkb,nxkeygen,nxlocate,nxlpd,nxnode,nxplayer,nxpost,nxrunner,nxserver,nxservice32,nxservice64,nxsh,nxssh-add,nxssh-agent,nxssh-pkcs11,nxssh,nxupdatecli,nxcodec.bin,nxnode.bin,nxplayer.bin,nxrunner.bin,nxserver.bin
  • architecture: x86
  • signature_date:
  • size: 43.37 Mo
  • installed_size: 201.43 Mo
  • homepage : https://www.nomachine.com/
  • conflicts :

package           : tis-nomachine-client
version           : 8.13.1-20
architecture      : x86
section           : base
priority          : optional
name              : NoMachine Client
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : NoMachine is a cross-platform remote desktop program developed by NoMachine S.à r.l. The software provides access to remote desktops and applications running on Linux, Windows, Mac and Linux ARM devices
depends           : 
conflicts         : tis-nomachine,tis-nomachine-server
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://www.nomachine.com/download
installed_size    : 201432744
impacted_process  : nxagent,nxauth,nxd,nxdisplay,nxdx32,nxdx64,nxexec,nxfs,nxfsserver,nxkb,nxkeygen,nxlocate,nxlpd,nxnode,nxplayer,nxpost,nxrunner,nxserver,nxservice32,nxservice64,nxsh,nxssh-add,nxssh-agent,nxssh-pkcs11,nxssh,nxupdatecli,nxcodec.bin,nxnode.bin,nxplayer.bin,nxrunner.bin,nxserver.bin
description_fr    : NoMachine est un programme de bureau à distance multiplateforme développé par NoMachine S.à r.l. Le logiciel permet d'accéder à des bureaux et des applications à distance fonctionnant sur des appareils Linux, Windows, Mac et Linux ARM
description_pl    : NoMachine to wieloplatformowy program zdalnego pulpitu stworzony przez NoMachine S.à r.l. Oprogramowanie zapewnia dostęp do zdalnych pulpitów i aplikacji działających na urządzeniach Linux, Windows, Mac i Linux ARM
description_de    : NoMachine ist ein plattformübergreifendes Remote-Desktop-Programm, das von NoMachine S.à r.l. entwickelt wurde. Die Software ermöglicht den Zugriff auf Remote-Desktops und Anwendungen, die auf Linux-, Windows-, Mac- und Linux ARM-Geräten laufen
description_es    : NoMachine es un programa de escritorio remoto multiplataforma desarrollado por NoMachine S.à r.l. El software proporciona acceso a escritorios y aplicaciones remotas que se ejecutan en dispositivos Linux, Windows, Mac y Linux ARM
description_pt    : NoMachine é um programa de desktop remoto multiplataforma desenvolvido pela NoMachine S.à r.l. O software fornece acesso a desktops remotos e aplicações que funcionam em dispositivos Linux, Windows, Mac e Linux ARM
description_it    : NoMachine è un programma di desktop remoto multipiattaforma sviluppato da NoMachine S.à r.l. Il software fornisce l'accesso a desktop remoti e ad applicazioni in esecuzione su dispositivi Linux, Windows, Mac e Linux ARM
description_nl    : NoMachine is een cross-platform remote desktop programma ontwikkeld door NoMachine S.à r.l. De software biedt toegang tot remote desktops en applicaties die draaien op Linux, Windows, Mac en Linux ARM apparaten
description_ru    : NoMachine - это кроссплатформенная программа удаленного рабочего стола, разработанная компанией NoMachine S.à r.l. Программа обеспечивает доступ к удаленным рабочим столам и приложениям, работающим на устройствах Linux, Windows, Mac и Linux ARM
audit_schedule    : 
editor            : NoMachine S.à r.l.
keywords          : 
licence           : proprietary_free,wapt_public
homepage          : https://www.nomachine.com/
package_uuid      : e5309367-27de-43d5-8666-567a9652f3fe
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://www.nomachine.com/softwareupdates
min_os_version    : 5.1
max_os_version    : 
icon_sha256sum    : f3d96ea16ef4efbfd6be94984d46d706001c18a3c5458fac257651825f89cc6e
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : MdQeHJci9ZacmavTwbylH7mvF3VGpTXrBgXg2o2PlNYJPmnK6QxIcNrKLVj1nKT4Uoh7IpJ6ttpniOhc5cZrMEAP1lhppRrIg1xSgxxJaVv8sCg1lNSKcTzoSkyiLWXStlZ5arxyxnuRQr7GIZ5XXUweFAIIyxezWAP3c+U+5sdulBJoXlpyrYWfcdFCqcpAa9bL+rS4DJuPB9gwo23ktE7ntkfnEYlBH1BHfH3IF8BASrBmNnfDaaTIkpeEuLbInyuNz5Hu0UZgCXofavI6k23GEvgwftILxvflTx1RXjyG49VNRvcHjcbNcYTehksi1FmkSAkoAgEZOm6D/cZpmA==
signature_date    : 2024-07-30T15:03:04.763347
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
from setuphelpers import *

r""" 
https://kb.nomachine.com/AR02N00877

The server.cfg and/or node.cfg files are placed in :

/usr/NX/etc/on Linux

C:\Program files\NoMachine\etc\server.cfg for 64bit packages on 64bit systems
and C:\Program files (x86)\NoMachine\etc\server.cfg for 32bit packages on Windows 64bit systems

/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg on macOS.

"""


def get_nomachine_dir():
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "NoMachine")
    elif get_os_name() == "Linux":
        app_dir = "/usr/NX"
    elif get_os_name() == "Darwin":
        app_dir = "/Applications/NoMachine.app/Contents/Frameworks"
    else:
        error("os not detected")
    return app_dir


server_cfg_path = makepath(get_nomachine_dir(), "etc", "server.cfg")
node_cfg_path = makepath(get_nomachine_dir(), "etc", "node.cfg")


def install():
    bin_name = glob.glob("nomachine_*.exe")[0]
    log_path = rf"C:\Windows\Temp\{bin_name}.log"
    run_notfatal("net stop nxservice")
    install_exe_if_needed(
        bin_name,
        silentflags=f'/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /LOG="{log_path}" /usbinstall=0 /printerinstall=0',
        key="NoMachine_is1",
        min_version=control.get_software_version(),
    )

    # Configuring server.cfg default preferences
    config_dict = {
        "#UpdateFrequency": "UpdateFrequency 0",
        "UpdateFrequency": "UpdateFrequency 0",
        "#StartNXDaemon": "StartNXDaemon 0",
        "StartNXDaemon": "StartNXDaemon 0",
        "#PhysicalDesktopSharing": "PhysicalDesktopSharing 0",
        "PhysicalDesktopSharing": "PhysicalDesktopSharing 0",
        "#PhysicalDesktopSharing": "PhysicalDesktopSharing 0",
        "#EnableNetworkBroadcast": "EnableNetworkBroadcast 0",
        "#VirtualDesktopAccess": "VirtualDesktopAccess none",
        "VirtualDesktopAccess": "VirtualDesktopAccess none",
        "#PhysicalDesktopAccess": "PhysicalDesktopAccess none",
        "PhysicalDesktopAccess": "PhysicalDesktopAccess none",
        "#PhysicalDesktopAccessNoAcceptance": "PhysicalDesktopAccessNoAcceptance none",
        "PhysicalDesktopAccessNoAcceptance": "PhysicalDesktopAccessNoAcceptance none",
        "#LoginScreenAccess": "LoginScreenAccess 0",
        "LoginScreenAccess": "LoginScreenAccess 0",
        "#PhysicalDesktopMode": "LoginScreenAccess 0",
        "LoginScreenAccess": "LoginScreenAccess 0",
    }
    edit_config_raw_file(server_cfg_path, config_dict)

    # Configuring node.cfg default preferences
    config_dict = {
        "#EnableDiskSharing": "EnableDiskSharing none",
        "EnableDiskSharing": "EnableDiskSharing none",
        "#EnablePrinterSharing": "EnablePrinterSharing none",
        "EnablePrinterSharing": "EnablePrinterSharing none",
        "#EnableUSBSharing": "EnableUSBSharing none",
        "EnableUSBSharing": "EnableUSBSharing none",
        "#EnableNetworkSharing": "EnableNetworkSharing none",
        "EnableNetworkSharing": "EnableNetworkSharing none",
        "#EnableSmartcardSharing": "EnableSmartcardSharing 0",
        "EnableSmartcardSharing": "EnableSmartcardSharing 0",
        "#AudioInterface": "AudioInterface disabled",
        "AudioInterface": "AudioInterface disabled",
        "#DisplayMonitorIcon": "DisplayMonitorIcon 0",
        "DisplayMonitorIcon": "DisplayMonitorIcon 0",
    }
    edit_config_raw_file(node_cfg_path, config_dict)

    # Changing default start mode of the application services
    set_service_start_mode("nxservice", "Disabled")

    # # Removing nx user
    # # run_notfatal("net user nx /delete")
    # try:
    #     delete_user("nx")
    # except:
    #     print("Unable to remove user: nx")

    # # Removing nx user folders # ownership must be taken
    # for nx_dir in glob.glob(r"C:\Users\**"):
    #     user_dir = nx_dir.split(os.sep)[-1]
    #     if user_dir == "nx" or user_dir == f"nx.{get_computername().upper()}":
    #         remove_tree(nx_dir)


def edit_config_raw_file(conf_path, config_dict, base_file=None, encoding=None):
    r"""
    Edits a configuration file at the given path.
    This function allows you to edit INI files with incorrect format, flat files, dirty JSON, etc.

    Args:
        conf_path (str): The path to the configuration file.
        config_dict (dict): A dictionary containing key-value pairs to be updated or added in the configuration file.
            The key is the string at the beginning of the line you are trying to edit.
            The value is the new replacing line.
            (Note: take care of spaces and tabs (\t), but line return (\n) will be added automatically.)
        base_file (str or None, optional): The base file content to be used if the configuration file doesn't exist.
            It can be either a string representing the base content or a file path. Defaults to None.
        encoding (str, optional): The encoding of the configuration file. If not specified, the function attempts to detect it. Defaults to None.

    Returns:
        (dict or list): The dictionary with the previous line as the key and the new line as the value for edited lines. The list of written lines.

    Example:
    >>> edit_config_raw_file(user_conf_path, config_dict, encoding="UTF-8-SIG")
    {'Language=en-US\n': 'Language=fr-FR\n', 'Destinations=Picker\n': 'Destinations=Editor\n',
    'CaptureMousepointer=True\n': 'CaptureMousepointer=False\n'}
    >>> edit_config_raw_file(server_cfg_path, config_dict))
    ['UpdateFrequency 0\n']

    """
    result_dict = {}
    new_lines = []

    if not encoding and os.path.isfile(conf_path):
        encoding = detect_file_encoding(conf_path)
    else:
        encoding = "UTF-8"

    if not os.path.isfile(conf_path):
        if base_file is None:
            print(f'"{conf_path}" file does not exist, and you did not provide a base_file. Writing values of config_dict line by line.')
            new_lines = set()
            for key, value in config_dict.items():
                new_line = value + "\n"
                new_lines.add(new_line)
            new_lines = list(new_lines)
        else:
            if isfile(base_file):
                # encoding = detect_file_encoding(base_file)
                with open(conf_path, "r", encoding=encoding) as f:
                    new_lines = f.readlines()
            else:
                new_lines = base_file.splitlines()
    else:
        with open(conf_path, "r", encoding=encoding) as f:
            for line in f:
                line_edited = False
                old_line = line
                line = line.rstrip("\n")
                for key, value in config_dict.items():
                    if line.startswith(key):
                        line = value
                        line_edited = True
                        break
                new_line = line + "\n"
                new_lines.append(new_line)
            if line_edited:
                result_dict[old_line] = new_line

    with open(conf_path, "w", encoding=encoding) as f:
        f.writelines(new_lines)

    if result_dict:
        return result_dict
    else:
        return new_lines


def detect_file_encoding(file_path):
    """Detect the encoding of a file."""
    import chardet

    with open(file_path, "rb") as file:
        raw_data = file.read()
        result = chardet.detect(raw_data)
        return result["encoding"]

# -*- coding: utf-8 -*-
from setuphelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

# Windows URL  
    url9 = "https://downloads.nomachine.com/download/?id=9"
    url8 = "https://downloads.nomachine.com/download/?id=8"

    urlx64=''
    for bs_search in bs_find_all(url9, "a", proxies=proxies):
        if "x64.exe" in bs_search.get("href",""):
            urlx64 = url9
            urlx32 = url8
            break
    if urlx64=='':
        urlx64=url8
        urlx32=url9

# All URL 
    download_dict = {
        "windows-x64": urlx64,
        "windows-x86": urlx32,
        "windows-all": urlx32,
        "redhat_based-x64": "https://downloads.nomachine.com/download/?id=6",
        "debian_based-x64": "https://downloads.nomachine.com/download/?id=5",
        "macos-all": "https://downloads.nomachine.com/download/?id=7",
    }
    url = download_dict[control.target_os + "-" + ensure_list(control.architecture)[0]]
    download_str = download_dict[control.target_os + "-" + ensure_list(control.architecture)[0]]

    # Getting latest version from official sources
    print("URL used is: %s" % url)
    for bs_search in bs_find_all(url, "a", proxies=proxies):
        if "nomachine_" in bs_search.get("href", ""):
            download_url = bs_search["href"]
            latest_bin = bs_search["href"].split("/")[-1]
            version = latest_bin.split("/")[-1].split("_")[1]
            break

    # Downloading latest binaries
    print("Latest %s version is: %s" % (control.name, version))
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    # Deleting outdated binaries
    remove_outdated_binaries(latest_bin)
    # arch_list = ensure_list(control.architecture)
    # remove_outdated_binaries(version, filename_contains=("x64" if "x64" in arch_list else "x86" if "x86" in arch_list else []))

    # Checking version from file
    if get_os_name() == "Windows" and "windows" in control.target_os.lower():
        version_from_file = get_version_from_binary(latest_bin)
        if Version(version_from_file, 4) == Version(version, 4):
            print(f"INFO: Binary file version ({version_from_file}) corresponds to online version ({version})")
        else:
            error(f"ERROR: Binary file version ({version_from_file}) do NOT corresponds to online version ({version})")

    # Changing version of the package
    if Version(version, 4) > Version(control.get_software_version(), 4):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        package_updated = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating or not update-package-sources
    return package_updated

    # # Changing version of the package and validating update-package-sources
    # return complete_control_version(control, version)

08982a8f14e9edc0d0eed941a5d06280c04e83286fd6474595d967c34819811e : setup.py
edc976dc676ce112d99ab6c010409849f9c04cdb776c167a05423c4c9718f327 : update_package.py
f3d96ea16ef4efbfd6be94984d46d706001c18a3c5458fac257651825f89cc6e : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
20e6cdf532976380caeb08a1ba26f6f2a4567f0737891147a1e8728a34d59ac2 : WAPT/changelog.txt
3c8132faeab3908660f6df986139d667b0a193daeca86fcc6c259ac109eea188 : luti.json
79ed0d3f35fee137cafac55bd27c31be4ad44dafb48de84a4e0cf062f1894143 : nomachine_8.13.1_1_x86.exe
fc028fe247be7a29ab2768a343c051a030572e4bb87a141b33aa70e7efa2ca3f : WAPT/control

https://www.nomachine.com/softwareupdates
20
===
using edit_config_raw_file
using get_nomachine_dir() for cfg_path
new silentflags: /usbinstall=0 /printerinstall=0


18
===
fix update_package


17
===
delete user nx instead of trying to remove it from local admins
disable AudioInterface