Problem managing uninstall process of addin RRS feed

  • Question

  • If my addin is uninstalled, it prompts to restart the server, this is because I have an embeded browser in the main tab (MainTabUserControl) which is using three .jar files in the browsers program folder. (These files are installed as part of the MSI deployment)

    I'm using an uninstall Custom Action (Uninstall.vb with override) with a standard msi project in VS2008 to clean things up before the actual uninstall (stops a service plus a few other house keeing tasks)

    Any ideas of how I can kill\close\unload the usage of the files to allow the uninstall to complete?


    Monday, May 3, 2010 5:48 PM

All replies

  • Which process is holding the files open (try Process Monitor to find out)?
    Tentacle Blog: http://www.tentaclesoftware.com/blog/
    WHS Disk Management: http://www.tentaclesoftware.com/WHSDiskManagement/
    Tuesday, May 4, 2010 3:29 AM
  • Hey Sam,

    That’s the problem, the browser is embedded so is running as part of the Homeserverconsole.exe (So no processes I can kill)

    I don't think it's possible to close\disable the embedded browser without killing the console? (Plus the fact it's difficult to interact with the MainTab form from the settings\tab anyway)

    (If you're interested, the browser is Geckofx: http://code.google.com/p/geckofx/)


    Tuesday, May 4, 2010 11:34 AM
  • OK, so the browser doesn't run as its own process.

    You're using WiX, right? Can you post your XML file and custom action code?

    Tentacle Blog: http://www.tentaclesoftware.com/blog/
    WHS Disk Management: http://www.tentaclesoftware.com/WHSDiskManagement/
    Tuesday, May 4, 2010 6:31 PM
  • I started using Wix but I need to include a large amount of files for the embedded browser, currently using the VS msi wizard.

    I'm adding this to a class called Uninstall.vb (Then adding the output of the project to the uninstall custom action:


    Imports System
    Imports System.ComponentModel
    Imports System.Configuration.Install
    Imports System.IO
    Imports System.Text
    Imports System.Diagnostics
    Namespace Common.Containers
     <RunInstaller(True)> _
     Public Class UpdateCustomInstaller
      Inherits Installer
      Shared Sub New()
      End Sub
      Protected Overloads Overrides Sub OnBeforeUninstall(ByVal savedState As System.Collections.IDictionary)
      End Sub
      Public Sub StopService()
       'service stop code
      End Sub
     End Class
    End Namespace


    Works a treat, but I need it to some how release the embedded browsers lock on the files to allow the installer to remove the (in use) files.

    I've uploaded an example project plus the MSI: http://drop.io/swhmjvx
    (FYI - This will copy a dll plus a folder used by the browser in the WHS folder)

    To recreate, install the addin, open it (will load google) then remove the addin:

    Thanks for your help Sam.

    Tuesday, May 4, 2010 9:27 PM
  • I don't know much about the Visual Studio MSI builder, unfortunately. WiX has built-in actions to stop services on uninstall of a package, so what else are you doing in the StopService() method (you mentioned some house-keeping tasks above)? I'd want to try it with WiX just to get a second opinion.

    However, I don't think you're going to be able to unload those open file handles in any sort of elegant way using a custom action, without crashing the console and causing who-knows-what to happen to the RegisteredAdditions key for your Add-In.

    Traditionally, you'd make sure your program wasn't running before beginning the uninstall process (and maybe write a custom action to kill the process if it is running), but that will most likely cause problems for the WHS uninstall routine, as it wants to check for uninstall success at the end.

    I'd suggest asking the same question on the XULRunner (the platform GeckoFX is based on) dev forums to see if they have any ideas.

    Tentacle Blog: http://www.tentaclesoftware.com/blog/
    WHS Disk Management: http://www.tentaclesoftware.com/WHSDiskManagement/
    Wednesday, May 5, 2010 10:39 PM