Page 1 of 1
filecopyto in uninstall()
Published: Dec 11, 2017 - 3:42 PM
by beemoon
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?
Re: filecopyto in uninstall()
Published: Dec 12, 2017 - 09:01
by htouvet
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.
Re: filecopyto in uninstall()
Published: Dec 13, 2017 - 09:10
by beemoon
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.
Re: filecopyto in uninstall()
Published: Dec 13, 2017 - 12:29
by sfonteneau
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...
Re: filecopyto in uninstall()
Published: Dec 13, 2017 - 4:57 PM
by beemoon
because I don't like leaving files that aren't useful... just a matter of habit.