2011-04-20 104 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

的问题是在我的自定义操作方法是私有的,不公开。

相关问题