I was debugging a file uninstall problem today and I discovered some problem. Here are some tips to share.
(Background: in Windows you can't delete a file when the file is in use. So a common workaround is to move the file to a temporary location, and do something to get rid of the temporary file later.)
1. If you scheduled a MOVEFILE_DELAY_UNTIL_REBOOT, you better ask the user to reboot immediately. Otherwise when user installs the same product (to the same location), and rebooted afterwards, your pending delete will remove needed files.
2. If you want to move the file to a temporary location, you better make sure the temporary location is unique. Otherwise, when the user installs the same product, then uninstalls it, the uninstall will fail since the temporary file has already exists.
Bottom line, your logic has to survive multiple installs/uninstalls/reboots, and any combinations of those.