filecopyto in uninstall()

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
Locked
beemoon
Messages: 24
Registration: December 8, 2017 - 2:04 PM

December 11, 2017 - 3:42 PM

Hello,
`filecopyto` works fine if I place it in the `install()` function, but not in the `uninstall()` function of my `setup.py`
. I would like to copy a file contained in my package before running a `run(...)` command to uninstall a program.

Any ideas?
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

December 12, 2017 - 09:01

When the uninstall function is executed, the package and its files are no longer present on the machine.
Only the contents of setup.py are kept in the wapt client's local database.

If you need certain package files during uninstallation, you must copy them to a non-temporary directory on the disk within the package's install function.
Tranquil IT
beemoon
Messages: 24
Registration: December 8, 2017 - 2:04 PM

December 13, 2017 - 09:10

I don't want to leave the file on the machine after the package is installed. Isn't it possible to simulate an installation in the uninstall section... just to access the package files?

For Python 3.6, the recommended installation method is to re-run the installer with the parameter `/quiet /uninstall

python-3.6.3-amd64.exe /quiet /uninstall`.

I would therefore need this functionality.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

December 13, 2017 - 12:29

beemoon wrote: Dec 13, 2017 - 09:10 I don't want to leave the file on the machine when the package is installed.
Why is that a problem?
beemoon wrote: Dec 13, 2017 - 9:10 AM Can't we simulate an install in the uninstall section... just to access the package files?

Also, for Python 3.6, the recommended installation method is to re-run the installer with the parameter /quiet /uninstall

python-3.6.3-amd64.exe /quiet /uninstall
If you really want to do it, in the uninstall command, you need to run `wget` on the package, then `unzip`... then you'll have access to the files, and finally, at the end of the uninstall, delete the downloaded file... Assuming the WAPT server is available at the time of the uninstallation...


The easiest way is to make a copy of the installation file in a folder on the machine during the installation process...
beemoon
Messages: 24
Registration: December 8, 2017 - 2:04 PM

December 13, 2017 - 4:57 PM

because I don't like leaving files that aren't useful... just a matter of habit.
Locked