tis-meshagent

0.2.1.3-24
Mesh Agent Service
187 downloads
Download

  Description 

  • package : tis-meshagent
  • version : 0.2.1.3-24
  • architecture : all
  • categories : System and network
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Mesh Agent Service
  • locale : all
  • target_os : windows
  • min_os_version :
  • max_os_version :
  • min_wapt_version : 1.7
  • sources :
  • installed_size :
  • impacted_process : MeshAgent
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2021-02-17T09:33:17.867422

  Setup.py 

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

uninstallkey = []

# Place your Mesh Agent binaries in the package and adapt bin_name variables, edit 

# Defining variables
mesh_server = 'local'   # By default Mesh will only see agent in the same subnet than the server, you may need to change "local" with the server IP or hostname
mesh_server_port = '443'
bin_name_x86 = 'meshagent32-computers.exe'
bin_name_x64 = 'meshagent64-computers.exe'

silent_args = '-fullinstall'
silent_uninst_args = '-fulluninstall'
app_uninstallkey = 'Mesh Agent'
app_name = 'Mesh Agent'
app_bin = 'MeshAgent.exe'
app_dir = makepath(programfiles, 'Mesh Agent')
app_path = makepath(app_dir, app_bin)
conf_file_path = makepath(app_dir, 'MeshAgent.msh')
processes_to_kill = [app_bin]


def install():
    # Initializing variables
    package_version = control.version.split('-', 1)[0]
    if mesh_server != 'local':
        mesh_server_url = 'wss://%s:%s/agent.ashx' % (mesh_server, mesh_server_port)
    else:
        mesh_server_url = 'local'

    # Installing the package
    if need_install(app_uninstallkey, package_version):
        if iswin64():
            print('Installing: %s' % bin_name_x64)
            run_notfatal('"%s" %s' % (bin_name_x64, silent_args))
            #run((bin_name_x64, silent_args), accept_returncodes=[0,1,3010])
        else:
            print('Installing: %s' % bin_name_x86)
            run_notfatal('"%s" %s' % (bin_name_x86, silent_args))
            #run((bin_name_x86, silent_args), accept_returncodes=[0,1,3010])
    else:
        print("%s is already installed in correct version" % app_name)

    # Waiting install to complete
    time.sleep(15)

    # Configuring server DN
    with open(conf_file_path, 'r+') as open_data:
        new_data = [aline if not aline.startswith('MeshServer') else 'MeshServer=%s\n' % mesh_server_url for aline in open_data.readlines()]
        open_data.seek(0)       # Return to the top of the file
        open_data.truncate(0)   # Erase next content of the file
        open_data.writelines(new_data)  # Writing new data to the file

    # Restarting service if needed
    if mesh_server != 'local':
        run_notfatal('net stop "Mesh Agent"')
        run_notfatal('net start "Mesh Agent"')


def uninstall():
    # Uninstalling the package
    killalltasks(processes_to_kill)
    run_notfatal(app_path, silent_uninst_args)
    #run((app_path, silent_uninst_args), accept_returncodes=[0,1,3010])


def update_package():
    # Initializing variables
    package_version = control.version.split('-', 1)[0]
    version = get_version_from_binary(bin_name_x86, parameter='FileVersion')
    if not version:
        version = package_version

    # Changing version of the package
    control.version = '%s-%s' % (version, control.version.split('-', 1)[-1])
    control.save_control_to_wapt()
    print('Changing package version to: %s in WAPT\\control' % control.version)




def get_version_from_binary(filename, parameter='ProductVersion'):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)[parameter]
    else:
        return get_file_properties(filename)[parameter]


										

  Changelog 


No changelog
  manifest.sha256 
[["setup.py","202466e606e7a8e4cc98e35359110a633ed247671771daf881983ee95adec643"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/icon.png","75919930641ca94d1e743ff8f41ac4f2f853ca4a4582c9bac1e8aa749fd735c1"],["WAPT/control","f1ededa344e107ecb5ed6f5fb4ccd4d372b0cb744b1c599144e746e6eac21c9a"]]