Why are an applications files physically moved elsewhere in the first place? Simply leave everything in the app bundle, and put symlinks for anything the OS is expecting elsewhere. Cleaning up app deletion would then be pruning dead symlinks. Such a system could also potentially be enforced. Is it a symlink? If "yes" allow the write to ~/Library or wherever else. If not, deny it. Genuine question: is there some reaso…
There’s also the matter of permissions, some apps may be installed by the admin, but the app might not run with admin permissions for some users.