Seite 1 von 1

[GELÖST] Ivanti VPN Client Pulse-Konfigurationsdatei

Veröffentlicht: 17. Mai 2023 - 16:00 Uhr
von skoizer
Guten Morgen,

WAPT-Version: 2.3
Lizenz: Unternehmen
Server: Debian 11
Test: Windows 2019

Ich erstelle ein Paket zur Installation einer iVanti VPN-Client-Software (ehemals Pulse)
Es handelt sich um eine .msi-Datei

Ich muss den VPN-Client installieren, indem ich die Konfigurationsdatei lese, die sich im Paketverzeichnis befindet

Ich muss entweder das komplette Verzeichnis oder die Konfigurationsdatei als Parameter senden

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

Wie kann ich den vollständigen Pfad der Datei VPN-TELETRAVAIL.pulsepreconfig abrufen?


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

Damit funktioniert es auf pyscripter.
properties = {"CONFIGFILE":"C:\waptdev\cd12-ivanti-secure-access-client_22.2.1295_x64_Windows_PROD\VPN-TELETRAVAIL.pulsepreconfig"}


Code: Alle auswählen

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"


Betreff: Ivanti VPN Client Pulse-Konfigurationsdatei

Veröffentlicht: 19. Mai 2023 - 10:52 Uhr
von Sfonteneau
Guten Morgen

Sie verfügen über eine implizite Variable, die verwendet werden kann: basedir

Das Basisverzeichnis ist jedoch nur in der Installationsfunktion verfügbar, daher müssen die Eigenschaften verschoben werden

Code: Alle auswählen

def install():
    properties = {"CONFIGFILE": makepath(basedir,'VPN-TELETRAVAIL.pulsepreconfig')}

[REOLUT] Ivanti Pulse VPN-Client mit Konfigurationsdatei

Veröffentlicht: 22. Mai 2023 - 08:49 Uhr
von skoizer
Danke
Letztendlich konnte ich install_msi_if_needed jedoch nicht verwenden, da der MSI-Schlüssel und der tatsächliche Schlüssel in der Registrierung unterschiedlich sind

Hier ist mein modifiziertes Paket

Code: Alle auswählen

# -*- 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")