A few things about uninstall files

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.

Comments (4)

  1. Rose says:

    what should i do if i have a windows 98 system running on pentium II , i wanted to install windows xp on it but after reboot i just quit the installation bcoz of low memory disk space.

    now i want to reboot the system with default as win 98 wat shd i do bcoz every time i reboot the system goes into the windows xp installation setup instead of booting the win98 help plssssssssss

  2. Sorry Rose. I know nothing about Windows Setup. Maybe you can ask in microsoft newsgroup.

Skip to main content