Stormshield Pack

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
kokoss22
Messages: 7
Registration: January 2, 2024 - 10:23

January 2, 2024 - 10:26

Good morning,

I'm trying to create an uninstallation package for the Stormshield VPN Client SSL application. Our WAPT version (Enterprise version 2.4.0.14143)

The unique aspect of this VPN is that the application was deployed via Group Policy some time before WAPT was implemented. We have several versions of the Stormshield client in our network. The uninstallation script works correctly up to version 2.8.

I tried to set up a second uninstallation script for versions higher than 2.8, but I'm encountering a problem because the application was installed in the user's session (who doesn't have admin rights). Here is the script:

Code: Select all

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

uninstallkey = []

def install():
   pass

def session_setup():
for to_uninstall in installed_softwares(name=r"Stormshield SSL VPN Client"):
   if Version(to_uninstall["version"]) < Version('3.4') or force:
   print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
   killalltasks(control.impacted_process.split(","))
   run(r"MsiExec.exe /X{'clé'} /qn")
The script starts correctly, but a window appears asking for administrator rights.

I'm stuck on this step

Thank you for your help
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 2, 2024 - 10:40

Why launch the uninstallation in session_setup and not the install?
kokoss22
Messages: 7
Registration: January 2, 2024 - 10:23

January 2, 2024 - 10:56

Thank you for your quick reply.

I tried to do it directly from def_install() but the script doesn't work.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 2, 2024 - 11:15

A return code or something else?
kokoss22
Messages: 7
Registration: January 2, 2024 - 10:23

January 2, 2024 - 1:19 PM

Yes, here is the feedback I received:

Code: Select all

File "C:\\Program Files (x86)\\wapt\\common.py", line 4083, in install_wapt
    exitstatus = setup.install()
  File "C:\\WINDOWS\\TEMP\\waptpyvay117\\setup.py", line 11, in install
  File "C:\\Program Files (x86)\\wapt\\common.py", line 3860, in run
    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))
  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2118, in run
    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))
waptutils.CalledProcessErrorOutput: Command \'MsiExec.exe /X{D76AA950-B963-4FF9-A389-01861A32876A} /qn\' returned non-zero exit status 1605.
Output:C\x00e\x00t\x00t\x00e\x00 \x00a\x00c\x00t\x00i\x00o\x00n\x00 \x00e\x00s\x00t\x00 \x00v\x00a\x00l\x00i\x00d\x00e\x00 \x00u\x00n\x00i\x00q\x00u\x00e\x00m\x00e\x00n\x00t\x00 \x00p\x00o\x00u\x00r\x00 \x00l\x00e\x00s\x00 \x00p\x00r\x00o\x00d\x00u\x00i\x00t\x00s\x00 \x00d\x00Ú\x00j\x00Ó\x00 \x00i\x00n\x00s\x00t\x00a\x00l\x00l\x00Ú\x00s\x00.\x00
\x00\r\x00
']]
When I run msiexec from the workstation, it asks me for administrator rights to continue the uninstallation
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 2, 2024 - 2:13 PM

The error code is 1605

http://msdn.microsoft.com/fr-fr/library ... s.85).aspx

So ERROR_UNKNOWN_PRODUCT

In my opinion, the uninstallation process removes multiple entries at once, so you can correct your package by using `uninstall_key_exists`. If the key no longer exists, continue; this avoids uninstalling software that has already been uninstalled

Code: Select all

from setuphelpers import *

uninstallkey = []

def install():
    for to_uninstall in installed_softwares(name=r"Stormshield SSL VPN Client"):
        if not uninstall_key_exists(to_uninstall['key']):
            continue
        if Version(to_uninstall["version"]) < Version('3.4') or force:
            print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
            killalltasks(control.impacted_process.split(","))
            run(uninstall_cmd(to_uninstall['key']))

kokoss22
Messages: 7
Registration: January 2, 2024 - 10:23

January 2, 2024 - 2:28 PM

I keep getting the same error

Code: Select all

Installing paquet(=0-19)
Removing: Stormshield SSL VPN Client (3.2.3)
Erreur lors de l'installation de ['paquet']: erreurs dans les paquets [[PackageRequest(package='paquet',architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows-10', 'win-10', 'w-10', 'windows10', 'win10', 'w10', 'windows', 'win', 'w'],min_os_version=Version('10.0.22621'),max_os_version=Version('10.0.22621')), PackageEntry('paquet','0-19'), 'Traceback (most recent call last):
 File "C:\\Program Files (x86)\\wapt\\common.py", line 5192, in install
 result = self.install_wapt(p.localpath,
 File "C:\\Program Files (x86)\\wapt\\common.py", line 4176, in install_wapt
 raise e
 File "C:\\Program Files (x86)\\wapt\\common.py", line 4083, in install_wapt
 exitstatus = setup.install()
 File "C:\\WINDOWS\\TEMP\\waptai4rekuu\\setup.py", line 13, in install
 File "C:\\Program Files (x86)\\wapt\\common.py", line 3860, in run
 return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))
 File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2118, in run
 raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))
waptutils.CalledProcessErrorOutput: Command [\'MsiExec.exe\', \'/X{D76AA950-B963-4FF9-A389-01861A32876A}\', \'/q\', \'/norestart\'] returned non-zero exit status 1605.
Output:C\x00e\x00t\x00t\x00e\x00 \x00a\x00c\x00t\x00i\x00o\x00n\x00 \x00e\x00s\x00t\x00 \x00v\x00a\x00l\x00i\x00d\x00e\x00 \x00u\x00n\x00i\x00q\x00u\x00e\x00m\x00e\x00n\x00t\x00 \x00p\x00o\x00u\x00r\x00 \x00l\x00e\x00s\x00 \x00p\x00r\x00o\x00d\x00u\x00i\x00t\x00s\x00 \x00d\x00Ú\x00j\x00Ó\x00 \x00i\x00n\x00s\x00t\x00a\x00l\x00l\x00Ú\x00s\x00.\x00
\x00\r\x00
']]
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1910, in run
self.running_task.run()
File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 716, in run
self._run()
File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 1288, in _run
raise Exception(_('Error during install of {}: errors in packages {}').format(
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 2, 2024 - 5:51 PM

Microsoft correctly returns:

Code: Select all

ERROR_UNKNOWN_PRODUCT

    1605 (0x645)

    Cette action est valide uniquement pour les produits déjà installés.
So, a strange scenario.

If you run the command:

Code: Select all

MsiExec.exe /X{D76AA950-B963-4FF9-A389-01861A32876A}
Does it work on the machine if you go all the way?
kokoss22
Messages: 7
Registration: January 2, 2024 - 10:23

January 2, 2024 - 7:59 PM

Yes,

I had already tested it beforehand; I have to enter admin credentials, but once that's done, the command works.

Thank you.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

January 3, 2024 - 3:25 PM

You should try running the command in psexec:

Code: Select all

psexec -s -i cmd
and in the command prompt, under system account, execute the command
Answer