Hello wapters,
I wonder if with wapt I can uninstall a software that was already on the computer before installing the client?
[RESOLVED] Uninstall legacy software from machine
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
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
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Yes, here is a sample code:
https://www.wapt.fr/en/doc/CreationPaqu ... -logiciels
https://www.wapt.fr/en/doc/CreationPaqu ... -logiciels
Code: Select all
for soft in installed_softwares('winscp3'):
run(WAPT.uninstall_cmd(soft['key']))Sorry for the question, but I run this code in some place or save this as a wapt package and link to the computer or none of this?sfonteneau wrote: ↑January 22, 2018 - 8:29 PM Yes, here is a sample code:
https://www.wapt.fr/en/doc/CreationPaqu ... -logiciels
Code: Select all
for soft in installed_softwares('winscp3'): run(WAPT.uninstall_cmd(soft['key']))
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
As you said, you need to create a wapt package that will uninstall the software.
Okay. Like this?sfonteneau wrote: ↑Jan 22, 2018 - 9:18 p.m. As you said, you need to create a wapt package that will uninstall the software.
setup.py
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey=[]
def install():
softname = 'firefox'
check_installed_soft = installed_softwares(softname)
if check_installed_soft:
for uninstall in check_installed_soft:
key=uninstall['1233A4A7-BA0B-4067-BE21-FB97AFABC0CF']
if installed_softwares(uninstallkey=key):
run(WAPT.uninstall_cmd(uninstall['key']))- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Your code works. I propose to simplify it:
Code: Select all
def install():
if uninstall_key_exists('1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'):
run(WAPT.uninstall_cmd('1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'))sfonteneau,sfonteneau wrote: ↑January 22, 2018 - 10:00 PM Your code works. I propose to simplify it:
Code: Select all
def install(): if uninstall_key_exists('1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'): run(WAPT.uninstall_cmd('1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'))
This "key" is the value found in the column "Uninstall key" from Software Inventory in wapt console, right?
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Yes!
you can also find the uninstallkey with this command: https://www.wapt.fr/en/doc/Utilisation/ ... t-registry
The second code I provided you can uninstall software that has the uninstall key "'1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'"
This code bellow allows you to uninstall all the software that uses the word "winscp" in the information of their uninstall key.
Code: Select all
for soft in installed_softwares('winscp3'):
run(WAPT.uninstall_cmd(soft['key']))Now works!!! Thanks for the help sfonteneau!!!sfonteneau wrote: ↑January 23, 2018 - 12:41Yes!
you can also find the uninstallkey with this command: https://www.wapt.fr/en/doc/Utilisation/ ... t-registry
The second code I provided you can uninstall software that has the uninstall key "'1233A4A7-BA0B-4067-BE21-FB97AFABC0CF'"
This code bellow allows you to uninstall all the software that uses the word "winscp" in the information of their uninstall key.
Code: Select all
for soft in installed_softwares('winscp3'): run(WAPT.uninstall_cmd(soft['key']))
The code for uninstalling only with the key, not worked, but with the code above, works like a charm!
In the end, the code is like:
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey=[]
def install():
for soft in installed_softwares('old_version_of_firefox'):
run(WAPT.uninstall_cmd(soft['key']))After that, you need to build the package with the below command:
Code: Select all
wapt-get build-package <path of the files>Code: Select all
wapt-get build-package c:\waptdev\test-remove-firefox