【发布时间】:2014-04-02 15:06:26
【问题描述】:
我是 WIX 新手,请多多包涵。
我的安装过程中有两个自定义操作,一个在安装 .msi 期间调用,另一个在卸载 .msi 期间调用。
<Binary Id="ClassExtension.RegisterAssemblies.CA.dll" src="..\ClassExtension.RegisterAssemblies\bin\$(var.Configuration)\ClassExtension.RegisterAssemblies.CA.dll" />
<CustomAction Id="CustomActionInstall"
Return="check"
Execute="immediate"
BinaryKey="ClassExtension.RegisterAssemblies.CA.dll"
DllEntry="OnInstall" />
<CustomAction Id="CustomActionUninstall"
Return="check"
Execute="immediate"
BinaryKey="ClassExtension.RegisterAssemblies.CA.dll"
DllEntry="OnUninstall" />
<InstallExecuteSequence>
<Custom Action="CustomActionInstall" After="InstallFinalize" />
<Custom Action='CustomActionUninstall' After="InstallInitialize">REMOVE="ALL"</Custom>
</InstallExecuteSequence>
自定义操作方法如下:
[CustomAction]
public static ActionResult OnInstall(Session session)
{
//Code
}
[CustomAction]
public static ActionResult OnUninstall(Session session)
{
//Code
}
自定义操作驻留在单独的 C# 自定义操作类中,安装时调用的自定义操作可以正常工作。当我尝试卸载应用程序时,出现以下错误:
此 Windows 安装程序包有问题。需要 DLL 无法运行此安装完成。联系您的支持 人员或包裹供应商。
所以在我看来,某些 DLL 在初始化之前就被调用了,而且错误可能在执行序列中的某个地方。
任何帮助将不胜感激。
问候
【问题讨论】:
-
如果这是注册程序集的自定义操作,wix 中有本地方式来执行此操作。我不确定自定义操作到底做了什么,但只是想我会提到它。我已经用原生 wix 功能替换了 regasm 和 regsvr32 命令。