2011-04-20 108 views
0

我有一個應在卸載時運行的自定義操作。但由於未知原因msiexec說「這個Windows安裝程序包存在問題,無法運行此安裝所需的DLL,請聯繫您的支持人員或程序包供應商,」。代碼如下:無法在卸載時運行託管自定義操作

<Binary SourceFile="SetupWiX.CA.dll" Id="Binary1" />  
<CustomAction Id="DropDatabase" BinaryKey="Binary1" DllEntry="DropDatabase" Execute="deferred" Return="check"/> 
<Custom Action='DropDatabase' After="SetCustomActionDataValue_DropDatabase">Installed</Custom> 

我有幾個其他的自定義操作,安裝時運行,他們運行良好。除了條件,一切都是一樣的。 那麼如何才能使我的自定義操作在卸載時正常運行? 我創建了一個空白的wix安裝項目,以及一個顯示卸載時消息框的簡單自定義操作,並且它工作正常。我不知道我的第一個自定義操作有什麼問題。 我在安裝和卸載時使用相同的DLL。 錯誤日誌低於:

Action start 16:07:34: INSTALL. 
Action start 16:07:34: ValidateProductID. 
Action ended 16:07:34: ValidateProductID. Return value 1. 
Action start 16:07:34: CostInitialize. 
Action ended 16:07:34: CostInitialize. Return value 1. 
Action start 16:07:34: FileCost. 
Action ended 16:07:34: FileCost. Return value 1. 
Action start 16:07:34: CostFinalize. 
Action ended 16:07:34: CostFinalize. Return value 1. 
Action start 16:07:34: InstallValidate. 
Action ended 16:07:34: InstallValidate. Return value 1. 
Action start 16:07:34: InstallInitialize. 
Action ended 16:07:37: InstallInitialize. Return value 1. 
Action start 16:07:37: ProcessComponents. 
Action ended 16:07:37: ProcessComponents. Return value 1. 
Action start 16:07:37: UnpublishFeatures. 
Action ended 16:07:37: UnpublishFeatures. Return value 1. 
Action start 16:07:37: RemoveFiles. 
Action ended 16:07:37: RemoveFiles. Return value 0. 
Action start 16:07:37: InstallFiles. 
Action ended 16:07:37: InstallFiles. Return value 1. 
Action start 16:07:37: DropDatabase. 
Action ended 16:07:37: DropDatabase. Return value 1. 
Action start 16:07:37: RegisterUser. 
Action ended 16:07:37: RegisterUser. Return value 0. 
Action start 16:07:37: RegisterProduct. 
Action ended 16:07:37: RegisterProduct. Return value 1. 
Action start 16:07:37: PublishFeatures. 
Action ended 16:07:37: PublishFeatures. Return value 1. 
Action start 16:07:37: PublishProduct. 
Action ended 16:07:37: PublishProduct. Return value 1. 
Action start 16:07:37: InstallFinalize. 
CustomAction DropDatabase returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox) 
MSI (s) (D4:DC) [16:07:41:650]: Product: MyProduct -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 

Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action DropDatabase, entry: DropDatabase, library: C:\Windows\Installer\MSI4DEF.tmp 
Action ended 16:07:41: InstallFinalize. Return value 3. 
Action ended 16:07:42: INSTALL. Return value 3. 
+1

您是否查看過MSI日誌以查看究竟發生了什麼問題? – saschabeaumont 2011-04-21 02:36:30

+0

@saschabeaumont日誌中包含完全相同的錯誤,沒有詳細說明可用 – 2011-04-21 07:22:30

+1

而您的CA DLL肯定導出函數DropDatabase(MSIHANDLE h)?您是否曾嘗試將SetupWiX.CA.dll複製到目標系統並在其上運行depends.exe以確保它加載正常。 – 2011-04-21 12:15:14

回答

0

的問題是在我的自定義操作方法是私有的,不公開。

相關問題