2013-04-05 33 views
1

定义:问题与COM的去登记(高级安装)的问题

挂断了一段期间COM去登记,并说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。但实际上,我的扩展程序已成功卸载并卸载。环境

定义:

我创建某种虚拟外壳命名空间扩展测试。它实现IContextMenu和所有方法返回S_OK和别的什么也不做和RGS文件是

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.' 
      } 
      } 
     } 
     } 
    } 
    } 
} 

我选择Professional安装程序,只增加了我的dll文件。在文件属性Registration选项卡上,我选择Auto register file...Extract registration info...SynchronizationEnabled。在Product Information->Install Parameters->PackageType我选择64-bit package for x64...

现在我构建MSI并安装扩展。 启动资源管理器,然后在文件夹背景上的某处执行右键单击。根据我的日志,我的扩展程序被加载并且是DLL_PROCESS_ATTACH和几次DLL_THREAD_ATTACH。

我再次启动MSI并选择Remove。它说你必须关闭... applications are using files...,并且列表中只有Windows Explorer。我选择Automatically close ...并按OK。

所有资源管理器窗口已关闭,但似乎资源管理器未关闭。

状态是“关闭应用程序”,根据我的日志dll已经卸载。问题在这里。该DLL已经卸载,但MSI仍在等待,然后它说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。 我点击确定,这个过程继续进行,最终我的DLL被成功删除。

我使用Windows 8 64位。

这种等待的原因是什么以及应用程序无法关闭的消息。我怎么弄出来的?

回答

0

没错,这不起作用,外壳扩展很有可能被加载,MSI不会杀死Explorer.exe。你也不想要它,这对用户来说是相当可怕的景象。

您需要使用其他方式来取消/注册扩展名。目前尚不清楚“专业安装人员”的含义。但是,您可以通过自己修改注册表来始终取消/注册COM服务器,而不必将其留给DLL来完成。这实际上是推荐的方式。您已经知道.rgs文件中的注册表项。您也可以使用WiX工具箱中的Heat.exe收割机。需要通过延迟删除DLL,并在下次用户登录时将其删除,方法是将其添加到PendingFileRenameOperations注册表项中。检查您的安装程序创建者工具是否有正确的过程。

+0

“专业安装程序” - > http://advancedinstaller.com/user-guide/tutorial-professional.html。我可以使用WiX,但问题是关于高级安装程序。实际上也有相同的情况,根据重现问题的步骤,高级安装程序从DLL中提取rgs,我不使用自注册/注销。该DLL也可以立即被删除,无需重新登录。这是一个安装工具的问题,它要求用户使用打开的文件自动关闭应用程序或重新启动计算机。 – SergZ 2013-04-06 06:56:48