Page 1 of 2

Stormshield Pack

Published: January 2, 2024 - 10:26 AM
by kokoss22
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

Re: Stormshield Package

Published: January 2, 2024 - 10:40 AM
by sfonteneau
Why launch the uninstallation in session_setup and not the install?

Re: Stormshield Package

Published: January 2, 2024 - 10:56 AM
by kokoss22
Thank you for your quick reply.

I tried to do it directly from def_install() but the script doesn't work.

Re: Stormshield Package

Published: January 2, 2024 - 11:15 AM
by sfonteneau
A return code or something else?

Re: Stormshield Package

Published: January 2, 2024 - 1:19 PM
by kokoss22
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

Re: Stormshield Package

Published: January 2, 2024 - 2:13 PM
by sfonteneau
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']))


Re: Stormshield Package

Published: January 2, 2024 - 2:28 PM
by kokoss22
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(

Re: Stormshield Package

Published: January 2, 2024 - 5:51 PM
by sfonteneau
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?

Re: Stormshield Package

Published: January 2, 2024 - 7:59 PM
by kokoss22
Yes,

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

Thank you.

Re: Stormshield Package

Published: January 3, 2024 - 3:25 PM
by sfonteneau
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