Problems with de-registering of COM - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

sergz
Posts: 1
Joined: Thu Apr 04, 2013 5:27 pm

Problems with de-registering of COM

Definition of problem:
Hangs up for sometime during COM de-registering and says
The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.
. But actually my extension is successfully unloaded and uninstalled.

Definition of environment:
I created some kind of dummy shell namespace extension for tests. It implements `IContextMenu` and all methods return`S_OK` and do nothing else and rgs file is

Code: Select all

HKCR
{
    xxx.sergz.dummyShellExt.1 = s 'DummyNSE Class'
    {
        CLSID = s '{6C0FBE00-9898-4BB0-806F-3ED7D2F1170D}'
    }
    xxx.sergz.dummyShellExt = s 'DummyNSE Class'
    {
        CurVer = s 'xxx.sergz.dummyShellExt.1'
    }
    NoRemove CLSID
    {
        ForceRemove {6C0FBE00-9898-4BB0-806F-3ED7D2F1170D} = s 'DummyNSE Class'
        {
            ProgID = s 'xxx.sergz.dummyShellExt.1'
            VersionIndependentProgID = s 'xxx.sergz.dummyShellExt'
            ForceRemove Programmable
            InprocServer32 = s '%MODULE%'
            {
                val ThreadingModel = s 'Apartment'
            }
            TypeLib = s '{3DC947F0-6691-4043-B414-29F749209905}'
            Version = s '1.0'
        }
    }
    NoRemove Directory
    {
        NoRemove Background
        {
            NoRemove ShellEx
            {
                NoRemove ContextMenuHandlers
                {
                   ForceRemove DummyShellExt = s '{6C0FBE00-9898-4BB0-806F-3ED7D2F1170D}'
                }
            }
        }
    }
}


HKLM
{
  NoRemove Software
  {
    NoRemove Microsoft
    {
      NoRemove Windows
      {
        NoRemove CurrentVersion
        {
          NoRemove Shell Extensions
          {
            NoRemove Approved
            {
              val '{6C0FBE00-9898-4BB0-806F-3ED7D2F1170D}' = s 'xxx.sergz Dummy shell extension.'
            }
          }
        }
      }
    }
  }
}
I choose `Professional` installer and added only my dll file. On file properties `Registration` tab I choose `Auto register file...`, `Extract registration info...` and `Synchronization` is `Enabled`. In `Product Information->Install Parameters->PackageType` I choose `64-bit package for x64...`.

Now I build the MSI and install the extension.
Launch explorer and do right click somewhere on folder background. According to my log my extension is loaded and is DLL_PROCESS_ATTACH and a few times DLL_THREAD_ATTACH.

I launch the MSI again and choose `Remove`. It says that you have to close ` ... applications are using files... ` and there is only `Windows Explorer` in the list. I choose `Automatically close ...` and press OK.

All Explorer windows are closed but it seems that Explorer was not shutdown.

The status is "Shutting down applications", according to my log the dll is already unloaded. The problem is here. The dll is already unloaded but the MSI is still waiting for something and then it says
The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.
.
I click OK and the process continues and my DLL is successfully removed in the end.

What are the reasons of this waiting and the message that applications can not be closed. How can I figure it out?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Problems with de-registering of COM

Hello,

This may happen if your shell extension DLL is still referenced by the Explorer.exe process during uninstall. As a workaround your can try to create a custom action which will unload the related DLL file from Explorer during uninstall. The custom action should be scheduled on uninstall before "Install Execution Stage -> Preparing" action group.

Also, as another solution you can try to restart the Explorer.exe on uninstall before "Install Execution Stage -> Preparing" action group.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”