[SOLVED] Ivanti VPN Client pulse configfile

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
Locked
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

May 17, 2023 - 4:00 PM

Good morning,

WAPT version: 2.3
license: company
server: debian 11
test: Windows 2019

I'm creating a package to install an iVanti VPN client software (formerly Pulse)
It's an .msi file

I need to install the VPN client by reading the configuration file, which is located in the package directory

I need to send the complete directory or the configuration file as a parameter

example
msiexec /i PulseSecure.x64.msi CONFIGFILE="c:\temp\my configuration..pulsepreconfig "

How can I retrieve the full path of the VPN-TELETRAVAIL.pulsepreconfig file?


properties = {"CONFIGFILE":"?????VPN-TELETRAVAIL.pulsepreconfig"}

With this on pyscripter, it works.
properties = {"CONFIGFILE":"C:\waptdev\cd12-ivanti-secure-access-client_22.2.1295_x64_Windows_PROD\VPN-TELETRAVAIL.pulsepreconfig"}


Code: Select all

service_name = 'PulseSecureService'
bin_name = glob.glob("PulseSecure-*.msi")[0]
configuration_file = glob.glob("*.pulsepreconfig")[0]
properties = {"CONFIGFILE":"VPN-TELETRAVAIL.pulsepreconfig"}

def install():
    # Declaring local variables

    # Installing the software
    print("Installation de : PulseSecure-x64-%s avec le fichier de configuration %s pour les utilisateurs hors DSI " % (bin_name,configuration_file))
    install_msi_if_needed(bin_name,properties = properties)


def audit():

    if not service_installed(service_name):
        print("ERREUR : Le service %s n'est pas installé " % service_name)
        return "ERROR"
    if not service_is_running (service_name):
        print("ERREUR : Le service %s n'est pas lancé " % service_name)
        return "WARNING"
    if not service_get_start_mode(service_name) == 'Auto':
        print("ERREUR : le service %s n'est pas en demarrage automatique" % service_name)
        return "WARNING"
    else:
        print("Le service %s est lancé " % service_name)
        return "OK"

Last edited by skoizer on May 22, 2023 - 08:50, edited 2 times.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

May 19, 2023 - 10:52

Good morning

You have an implicit variable that can be used: basedir

However, basedir is only available in the install function, so properties will need to be moved

Code: Select all

def install():
    properties = {"CONFIGFILE": makepath(basedir,'VPN-TELETRAVAIL.pulsepreconfig')}
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

May 22, 2023 - 08:49

Thank you
But I ultimately couldn't use install_msi_if_needed because the MSI key and the actual key in the registry are different

here is my modified package

Code: Select all

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

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
service_name = 'PulseSecureService'
uninstallkey = '{5B342340-B6CE-4514-84B1-942BC36778FD}' # a trouver ici Ordinateur\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\


def install():
    # Declaring local variables
    #properties = {"CONFIGFILE": makepath(basedir,configuration_file)} #si cela fonctionne avec le MSI
    configuration_file = glob.glob("*.pulsepreconfig")[0]
    bin_name = glob.glob("PulseSecure-*.msi")[0]
    silentflags="/qn CONFIGFILE=" + makepath(basedir,configuration_file)
    # Installing the software
    print("Installation de : PulseSecure-x64-%s avec le fichier de configuration %s pour les utilisateurs hors DSI " % (bin_name,configuration_file))
    install_exe_if_needed(
        bin_name,
        key=uninstallkey,
        silentflags=silentflags,
        )
    """
        #si la clef du msi est la clef de registre correspondent, mettre plutot ceci
        install_msi_if_needed(
        bin_name,
        properties = properties,
        )
    """


def audit():

    if not service_installed(service_name):
        print("ERREUR : Le service %s n'est pas installé " % service_name)
        return "ERROR"
    if not service_is_running (service_name):
        print("WARNING : Le service %s n'est pas lancé " % service_name)
        return "WARNING"
    if not service_get_start_mode(service_name) == 'Auto':
        print("WARNING : le service %s n'est pas en demarrage automatique" % service_name)
        return "WARNING"
    else:
        print("Le service %s est lancé " % service_name)
        return "OK"

def uninstall():
    #sur la description du MSI le code du paquet  n'est pas le bon. il y a ceci {5BE12994-E946-4B9F-87EA-5930731ECB92}
    #donc je force l'autre code, a changer manuellement, lors d'une nouvelle version \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
    run("MsiExec.exe /X" + uninstallkey + " /qn")
    print("Desinstallation de ivanti OK")
Locked