Page 1 of 1

Software Uninstallation

Published: July 31, 2018 - 5:09 PM
by jjsoueix
Good morning,
First of all, a big thank you for your solution which is a great help to me in my daily life!
I have been using WAPT for a few months and I am stuck trying to uninstall a piece of software that is not in the WAPT repository that I deployed.
I've looked through the documentation and the forum, but I'm stuck on this point...
I would therefore like to remove the "McAfee Security Scan" software from certain workstations in my network
I created an "empty" package with the following code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
    print('Uninstalling Software McAfee Security Scan')
    for soft in installed_softwares('McAfee Security Scan Plus'):
        run(uninstall_cmd(soft['key']))
        print('MacAfee uninstalled')
    for soft in installed_softwares('McAfee Security Scan Plus'):
            error("Wapt find : %s" % soft)
When installing this package on one of the client machines, the uninstallation fails and I receive the following error message in my administration console:

Code: Select all

EWaptSetupException: Fatal error : Wapt find : {'install_location': '', 'version': u'3.11.717.1', 'name': u'McAfee Security Scan Plus', 'key': u'McAfee Security Scan', 'uninstall_string': u'"C:\\Program Files\\McAfee Security Scan\\uninstall.exe"', 'publisher': u'McAfee, Inc.', 'install_date': '', 'system_component': 0}
Thank you for your feedback :P

Re: Software Uninstallation

Published: July 31, 2018 - 10:57 PM
by sfonteneau
What does it yield?

Code: Select all

    for soft in installed_softwares('McAfee Security Scan Plus'):
        print(uninstall_cmd(soft['key']))

Re: Software Uninstallation

Published: August 1, 2018 - 2:32 PM
by jjsoueix
Thank you very much for the quick response ;)
This command returns the following output:

Code: Select all

Uninstalling Software McAfee Security Scan
[u'C:\\Program Files\\McAfee Security Scan\\uninstall.exe', '/S']
In the meantime, I managed to bypass this blockage with the following instructions in the setup.py file of my package:

Code: Select all

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

uninstallkey = []

def install():
print('Uninstalling Software McAfee Security Scan')
command = r'"C:\Program Files\McAfee Security Scan\uninstall.exe" -S /inner'
run(command)
The /inner argument is missing to truly uninstall this software completely silently... Is it possible to add this argument to the WAPT code?

Code: Select all

 for soft in installed_softwares('McAfee Security Scan Plus'):
        run(uninstall_cmd(soft['key']))

Re: Software Uninstallation

Published: August 21, 2018 - 4:25 PM
by Gorenda
Hello,

I just had the same problem as you.

I run the command, my software uninstalls itself, but I get an error message.

I put the uninstallation command in `def uninstall()`

and then it works.