AddonInstall.cancel() is unaware of restartless installs. This is fine during the install, as they act the same as non-restartless installs. However, once the install reaches STATE_INSTALLED and has completed, the new addon has been completely installed - so it can't just delete the staged install. If we have a restartless install, and try to cancel it once it's reached STATE_INSTALLED (within the onInstallEnded event), we get the following exception: *** WARN addons.manager: InstallListener threw exception when calling onInstallEnded: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFile.directoryEntries]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/XPIProvider.jsm :: cleanStagingDir :: line 1211" data: no] There's two ways to fix this: * Disallow canceling restartless installs once they've completed. This is easy, and kinda makes sense given that the addon has been completely installed. * Uninstall the addon (or roll back to the previous version, if it was an upgrade). This is hard, mostly due to upgrades - we'd need to keep the old addon, restore that, and somehow deal with multiple upgrades during runtime. I'm leaning strongly towards the easy way.
Yeah, just make it throw a sane exception if the install already completed I think. I tend to think of AddonInstall as basically immutable at that point.
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.