Bug 1498044 - Don't ask to reboot when a directory we try to uninstall isn't empty. r=agashlin
authorMatt Howell <mhowell@mozilla.com>
Tue, 25 Jun 2019 00:59:13 +0000
changeset 480040 e8cc9c07e8b2574b95993619a8c3d6b90bb35f7a
parent 480039 ed52b3c886d415a601a0468b05257b1c618729b7
child 480041 fae033f2ab2dcdfb193d634c8d901ea7532bca3b
push id36200
push useraiakab@mozilla.com
push dateTue, 25 Jun 2019 21:58:14 +0000
treeherdermozilla-central@b23bd78e4d94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin
bugs1498044
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1498044 - Don't ask to reboot when a directory we try to uninstall isn't empty. r=agashlin 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. Differential Revision: https://phabricator.services.mozilla.com/D34938
browser/installer/windows/nsis/uninstaller.nsi
--- a/browser/installer/windows/nsis/uninstaller.nsi
+++ b/browser/installer/windows/nsis/uninstaller.nsi
@@ -423,22 +423,18 @@ Section "Uninstall"
   DeleteRegValue HKCU ${MOZ_LAUNCHER_SUBKEY} "$INSTDIR\${FileMainEXE}|Telemetry"
 !endif
 
   ${un.RemovePrecompleteEntries} "false"
 
   ${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
     Delete /REBOOTOK "$INSTDIR\defaults\pref\channel-prefs.js"
   ${EndIf}
-  ${If} ${FileExists} "$INSTDIR\defaults\pref"
-    RmDir /REBOOTOK "$INSTDIR\defaults\pref"
-  ${EndIf}
-  ${If} ${FileExists} "$INSTDIR\defaults"
-    RmDir /REBOOTOK "$INSTDIR\defaults"
-  ${EndIf}
+  RmDir "$INSTDIR\defaults\pref"
+  RmDir "$INSTDIR\defaults"
   ${If} ${FileExists} "$INSTDIR\uninstall"
     ; Remove the uninstall directory that we control
     RmDir /r /REBOOTOK "$INSTDIR\uninstall"
   ${EndIf}
   ${If} ${FileExists} "$INSTDIR\install.log"
     Delete /REBOOTOK "$INSTDIR\install.log"
   ${EndIf}
   ${If} ${FileExists} "$INSTDIR\update-settings.ini"