Page 1 of 1
[SOLVED] uninstall function def
Published: October 10, 2023 - 3:21 PM
by JPBUTT
Hello,
I'm trying to understand how the `uninstall` function works.
How does the package retrieve the script defined in `uninstall`
if an executable or registry key is defined in the function where it's stored? Because when uninstalling from a package using the console, it doesn't redownload the package.
I tried using the WAPT self-service without logging in, and the package uninstalls correctly.
If you have any information to share,
thank you
Re: uninstall function def
Published: October 12, 2023 - 09:09
by Benoit
Good morning,
There are no specific functions for uninstallation in all packages.
Depending on what you want to uninstall, the method will be different.
For example, to uninstall an executable, you will find an uninstallation key in the wapt console after installing your software.
This uninstallation key corresponds to a registry key that you can find in regedit.
Within this registry key, you will find an 'uninstallstring' line which will point to the uninstallation command. There is a function called 'uninstall_cmd()' in the setuphelpers module that allows you to use this uninstallation key.
But this doesn't always work. Sometimes it's necessary to run the uninstallation command directly within the script using a subprocess.
Code: Select all
command = 'MsiExec.exe /X{00000022-9040-3CA8-8868-36F59DEFD14D} /qn'
def uninstall():
# Exécute la commande de désinstallation
subprocess.run(command, shell=True)
print(name_software+" a été désinstallé")
To uninstall a portable application, you will need to delete the entire folder and desktop shortcuts.
I hope this has helped you.
Regards,
Re: uninstall function def
Published: October 12, 2023 - 4:27 PM
by JPBUTT
Hello,
thank you for your feedback, but my question was:
How and when is the scrypt uninstall def executed?
For example, if it's in an uninstallation script with an uninstall file, then registry keys, and a folder deletion
? Where is this stored?
Re: uninstall function def
Published: October 12, 2023 - 5:38 PM
by dcardon
Hello Jean-Philippe,
the setup.py script is stored in the local SQLite database of the WAPT service (c:\program files (x86)\wapt\db\waptdb.sqlite).
The installation package is not retained after installation (otherwise it would consume too much space).
Therefore, if you have resources needed for uninstallation, you need to store them somewhere where they can be retrieved during uninstallation (either a "persistent" directory or the application's own directory).
Regards,
Denis
Re: uninstall function def
Published: October 13, 2023 - 11:13 AM
by JPBUTT
Hello,
thank you for your feedback.
I understand better now how it works.