Closed Bug 1498044 Opened 2 years ago Closed 2 years ago

Uninstaller requires a reboot if unknown files exist in subdirectories


(Firefox :: Installer, enhancement, P1)




Firefox 69
Tracking Status
firefox64 --- wontfix
firefox69 --- fixed


(Reporter: mhowell, Assigned: mhowell)




(1 file)

In the Windows uninstaller, if any files exist in known subdirectories of the root installation directory (such as defaults/pref/) which are not listed in the precomplete file and are not explicitly removed by the uninstaller, then the uninstaller will force a reboot to remove them. This specifically affects defaults/pref/autoconfig.js, but there doesn't seem to be anything special about that particular file except that it's not in the root directory.

The uninstaller should either leave these files alone and continue on its way (as we do with unknown files in the root of the installation directory) or try to remove them without a reboot.

This was first reported in bug 1497907, but I limited its scope and broke this issue out into its own bug.

Our uninstaller currently calls the NSIS RMDir instruction on the defaults
directory with the /REBOOTOK flag set, which means that NSIS will register
the directory for deletion during the next reboot if it can't be removed
immediately for any reason. The problem here is that "any reason" includes
"the directory wasn't empty", and setting the reboot flag is not at all
the right thing to do in that situation. It won't help resolve the problem,
and those directories are expected to be empty at that point in the uninstall,
because we've already removed all the files that we know we put there, so
anything left is something we don't know about and shouldn't try to delete.
So the right thing to do here is just to remove the /REBOOTOK and allow the
RMDir to fail, so that any user files are never touched and we don't show
an unnecessary reboot prompt at the end of the wizard.

I also removed the FileExists checks, because the RMDir instruction does that.

Assignee: nobody → mhowell
Priority: P3 → P1
Pushed by
Don't ask to reboot when a directory we try to uninstall isn't empty. r=agashlin
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.