tis-nomachine-client icon

NoMachine Client

Silent install package for NoMachine Client

8.16.1-25

  • package: tis-nomachine-client
  • name: NoMachine Client
  • version: 8.16.1-25
  • 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: x64
  • signature_date:
  • size: 48.18 Mo
  • installed_size: 201.43 Mo
  • homepage : https://www.nomachine.com/
  • conflicts :

package           : tis-nomachine-client
version           : 8.16.1-25
architecture      : x64
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      : 53582e46-f0ec-4a8b-b25c-4f6f73dd9594
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_date    : 2025-03-01T15:34:10.000000
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
signature         : gHFZl9HfjWfmQOdCGIsuIsh+vvZySK4g1UpO942kDWW1YPPMe6Pwwh0aPyeiZBl19g3KEkynes6GPMp+DHzVTatUk7EzcgCdVPxh78mfPH42hOVS7HmH7rzbmqKI+QFw1l1O441t/rl45viB8E75LFW69XdY/gKzzel6qs/KiV299crWxsB6q4HHOIS1LWGfrlAnGq9m5VINCdedSSdJAFkTPzunWFgOb78RuYN+TmiM82JDz7yHH1x1k/lDfFgfxPYw8NC9ZBsTNzTxvY0bfYFqvla7dXYKmErl/TLFUt83+azHUpbtTjfvRrK6HNvhA8pnfceiVWKnCZ0biGArvw==

# -*- 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 *
from setupdevhelpers import *


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

    # All URL 
    download_dict = {
        "windows-x64": "https://downloads.nomachine.com/download/?id=9",
        "windows-x86": "https://downloads.nomachine.com/download/?id=8",
        "redhat_based-x64": "https://downloads.nomachine.com/download/?id=2",
        "debian_based-x64": "https://downloads.nomachine.com/download/?id=1",
        "macos-all": "https://downloads.nomachine.com/download/?id=7",
    }

    url = 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", "id", "link_download", proxies=proxies):
        if "nomachine_" in bs_search.get("href", ""):
            download_url = bs_search["href"]
            latest_bin = bs_search["href"].rsplit("/", 1)[-1]
            latest_bin_extension = latest_bin.rsplit(".", 1)[-1]
            version = latest_bin.split("_")[1]
            break

    # Downloading latest binaries
    print("Latest %s version is: %s" % (app_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)
        package_updated = True
    else:
        print("Binary is present: %s" % latest_bin)

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        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()

    for f in glob.glob(f'*.{latest_bin_extension}'):
        if f != latest_bin:
            remove_file(f)

    # Validating or not update-package-sources
    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
20e6cdf532976380caeb08a1ba26f6f2a4567f0737891147a1e8728a34d59ac2 : WAPT/changelog.txt
8ed617fef637d53e10365e8379cedadc6eaa470124f80073a47eecb91dcb8c8e : WAPT/control
f3d96ea16ef4efbfd6be94984d46d706001c18a3c5458fac257651825f89cc6e : WAPT/icon.png
7acdc64fc26092f44bec68bdb832f1a38900a3da41be28d42f61c6c2c0387f59 : luti.json
9d17c3a013eefd90ce58bb0f4467ef8fc9d95af77fe87e9013e2798bbd9c74e9 : nomachine_8.16.1_1_x64.exe
08982a8f14e9edc0d0eed941a5d06280c04e83286fd6474595d967c34819811e : setup.py
14dc55ca47e3a2b12ee11e8d72009a683d0ad6d27187ba97737c63ab546c2026 : update_package.py

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