Page 1 of 1

[SOLVED] Ivanti VPN Client pulse configfile

Published: May 17, 2023 - 4:00 PM
by skoizer
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"


Re: Ivanti VPN Client pulse configfile

Published: May 19, 2023 - 10:52
by sfonteneau
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')}

[REOLUT] Ivanti Pulse VPN Client with configfile

Published: May 22, 2023 - 08:49
by skoizer
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")