Last Comment Bug 732466 - Uninstalling a native app while the app is running leaves the executable in place
: Uninstalling a native app while the app is running leaves the executable in p...
Status: VERIFIED FIXED
:
Product: Firefox Graveyard
Classification: Graveyard
Component: Web Apps (show other bugs)
: Trunk
: All Windows 7
: -- normal
: ---
Assigned To: Tim Abraldes [:TimAbraldes] [:tabraldes]
: Jason Smith [:jsmith]
Mentors:
Depends on:
Blocks: 735518
  Show dependency treegraph
 
Reported: 2012-03-02 09:33 PST by Jason Smith [:jsmith]
Modified: 2016-02-04 15:00 PST (History)
5 users (show)
jsmith: in‑moztrap+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Error On Uninstall Through Uninstaller (226.34 KB, image/png)
2012-05-03 17:28 PDT, Jason Smith [:jsmith]
no flags Details

Description Jason Smith [:jsmith] 2012-03-02 09:33:32 PST
Steps:

1. Install the latest build of the extension (tested with 3/1)
2. Go to apps.mozillalabs.com/appdir
3. Install an app natively
4. Launch the app natively
5. Uninstall the native app

Expected:

An error should be reported indicating that the app cannot be uninstalled, as the app is currently running.

Actual:

The app is successfully uninstalled, even though the app is actively running. The app can be used natively after being uninstalled.

Seen so far on Win 7/XP.
Comment 1 Jason Smith [:jsmith] 2012-03-02 18:37:18 PST
This works on Mac OS X. Therefore, this is a Windows-specific issue. Assigning to Tim.
Comment 2 Tim Abraldes [:TimAbraldes] [:tabraldes] 2012-03-13 16:45:11 PDT
This should be fixed and verified in the mozilla-central implementation.
Comment 3 Tim Abraldes [:TimAbraldes] [:tabraldes] 2012-03-23 17:57:16 PDT
If you run the webapp uninstaller while the app is running, you should now notice that all the files you expect to disappear in fact disappear.  Under the hood, we're moving the file (which you can do even while the file is running).  Since we're not removing profile data during uninstall (bug 710790), the app can continue running for as long as the user wants it to.  When the app is closed, the uninstall is effectively complete.

Steps (same as above)

Expected:

The app should be uninstalled (all files that are typically removed during the uninstall process are removed)

Actual:

This should be working on builds from the github repo as of this commit: https://github.com/michaelrhanson/mozilla-central/commit/c681630a3c85d26577cfbfcf6f6058845551190c
Comment 4 Jason Smith [:jsmith] 2012-03-23 18:02:11 PDT
Why are we allowing an uninstall to occur in the first place with the app already running though? Typically with native applications, I believe this is not allowed (correct me if I'm mistaken). That's what this bug talks about. I believe the OS X implementation on the extension originally did implement this correctly, windows did not.
Comment 5 Tim Abraldes [:TimAbraldes] [:tabraldes] 2012-03-26 14:40:59 PDT
(In reply to Jason Smith from comment #4)
> Why are we allowing an uninstall to occur in the first place with the app
> already running though? Typically with native applications, I believe this
> is not allowed (correct me if I'm mistaken). That's what this bug talks
> about.

You're correct that this is typically not allowed, but that's probably because most native applications need the app to be closed before uninstallation can succeed.  We can uninstall successfully even while the app is running, which can be an advantage for us in certain situations.  If the executable is running but the user doesn't realize that it is running (e.g. the user doesn't know how to close the app, or the stub experiences something like bug 401301), we can still allow the user to uninstall the app.  When the machine is rebooted, the uninstallation is effectively completed.

Additionally, blocking the uninstallation if the EXE is in use adds complexity (and at least one localization string) to the uninstaller.  The mechanism that Firefox uses to determine if an instance is running is not available to us, and the uninstaller is incapable of telling the difference between "file could not be deleted because it is in use" and "file could not be deleted because of insufficient privileges"
Comment 6 Jason Smith [:jsmith] 2012-03-26 17:12:15 PDT
Okay, makes sense. Agreed. I'll update my test cases to reflect this.
Comment 7 Tim Abraldes [:TimAbraldes] [:tabraldes] 2012-04-20 13:44:40 PDT
This should no longer be an issue: If you uninstall an app while it is running, the executable should still go away.
Comment 8 Jason Smith [:jsmith] 2012-05-03 17:27:36 PDT
This works, but causes a regression in the process. See the screenshot. If I uninstall the application while it's running from the uninstaller in the %APPDATA%, then i will get an error reported saying that the program might not have been installed correctly. The uninstall ends up being successful still, but a false warning is sent to the user. Request to reopen, or should we track this in a separate bug?
Comment 9 Jason Smith [:jsmith] 2012-05-03 17:28:14 PDT
Created attachment 620914 [details]
Error On Uninstall Through Uninstaller
Comment 10 Tim Abraldes [:TimAbraldes] [:tabraldes] 2012-05-04 10:14:19 PDT
(In reply to Jason Smith [:jsmith] from comment #8)
> This works, but causes a regression in the process. See the screenshot. If I
> uninstall the application while it's running from the uninstaller in the
> %APPDATA%, then i will get an error reported saying that the program might
> not have been installed correctly. The uninstall ends up being successful
> still, but a false warning is sent to the user. Request to reopen, or should
> we track this in a separate bug?

Separate bug
Comment 11 Jason Smith [:jsmith] 2012-05-04 10:31:55 PDT
Filed a separate bug to track this issue. Marking as verified then.

Note You need to log in before you can comment on or make changes to this bug.