Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-971

Uninstallation fails sometimes in Windows OS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.5.6
    • Component/s: Packaging / Build

      Description

      1. If we uninstall the client in windows OS, sometimes the MSI installer window displays an error and uninstallation fails.
      2. Another attempt at uninstallation will succeed.
      3. Customer investigated the issue and found that the issue is inherited from nuxeo-drive. Their customer client is built using the same build script (setup.py, cx_freeze, esky) as nuxeo-drive. Initially the uninstallation error was more frequent as they were using an older copy of setup.py from nuxeo-drive. After customer updated the setup.py and associated files to latest version (same as latest nuxeo-drive) the frequency of errors of uninstallation reduced, but not completely gone.
      4. The issue was not reproductible using nuxeo-drive yet, but he was able to trace the root cause of the the problem inside nuxeo-drive source code.
      5. The root cause of the problem is the parallel execution of two separate actions during uinstallation: (RemoveFiles, RemoveFolders) and NuxeoDriveFolderCleanUp.
      6. The InstallExecuteSequence of the msi installer has the following items:
        • NuxeoDriveFolderCleanUp: sequence 1560 (used to clean up binaries installed by auto-update, but also cleans up binaries installed by regular installation)
        • RemoveFiles: sequence 3500 (cleanup files installed by regular installation)
        • RemoveFolders: sequence 3600 (cleanup folders installed by regular instalation)
      7. The NuxeoDriveFolderCleanUp is a customAction and is launched with launch type 3234. (this launch type value is a flag and one of the flag is 0x80 which means asynchronous lauunch). Since the NuxeoDriveFolderCleanUp is launched as asynchronous launch, the next items in sequence RemoveFiles, RemoveFolders are launched before NuxeoDriveFolderCleanUp completes. This causes parallel execution. Unfortuanately both actions are deleting binaries installed during regular installation and due to this sometimes the RemoveFiles action reports inconsistent results back to MSI installer (like unable to delete a resource file because it is not found). After this error, uninstallation will abort.

      Solution: Instead of launching NuxeoDriveFolderCleanUp action with type 3234, we can launch with 3170. This will avoid parallel execution and hence uninstallation will be error free.

      Here are some articles from MSDN related to CustomAction in MSI:
      https://msdn.microsoft.com/en-us/library/windows/desktop/aa368062(v=vs.85).aspx
      https://msdn.microsoft.com/en-us/library/windows/desktop/aa368071(v=vs.85).aspx

      To reproduce this issue one needs to install and uninstall the product more than 10 times. Even then only some testers observe the issue.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m