2013-04-05 36 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