I am writing a package manager in python for users to install programs we write at work.
When 'installing' a new tool (which is just a process of copying files/folders from locations on a server to the users' computer), it may fail before completion for whatever reason.
If this happens, I need a way to 'undo' all the changes made on the users' PC (I remove anything that was copied across).
What techniques are there to implement this sort of 'revert' functionality?
(Windows only solution)