c#via wix 3.7中的CustomAction失败,错误代码为1154
我已经创建了一个自定义操作,以便在Wix安装程序上选择“删除”时卸载VS软件包c#via wix 3.7中的CustomAction失败,错误代码为1154,c#,wix,custom-action,C#,Wix,Custom Action,我已经创建了一个自定义操作,以便在Wix安装程序上选择“删除”时卸载VS软件包 public class CustomActions { [CustomAction] public static ActionResult CustomAction1(Session session) { ActionResult result = ActionResult.Failure; try { sessi
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
ActionResult result = ActionResult.Failure;
try
{
session.Log("Begin CustomAction1");
string VSIXInstallerPath = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config", "VSIXInstallerLocation", null);
Process UninstallVSPackage = new Process();
UninstallVSPackage = Process.Start(VSIXInstallerPath, "/u:GUID /quiet");
result = ActionResult.Success;
}
catch (Exception ex)
{
session.Log("ERROR in custom action {0}",
ex.ToString());
return ActionResult.Failure;
}
return result;
}
}
}
这是相关的WIX标记:
<Binary Id="UninstallVSPackageAction"
src="$(var.TargetDir)\SELA.TFS.MBWI.CustomAction1.CA.dll" />
<CustomAction Id="RemoveVsPackage" BinaryKey="UninstallVSPackageAction"
DllEntry="DeleteVSPackage" Execute="deferred" Return="check" />
<Custom Action="RemoveVsPackage" After="InstallInitialize">
Installed AND NOT UPGRADINGPRODUCTCODE
</Custom>
不,事实并非如此。在本文中,作者引用的是自定义操作程序集,而不是实际的自定义操作dll。你确定
src=“$(var.TargetDir)
是正确的吗?好吧。我已经为这篇文章编辑了源代码。它实际上是src=“$(var.SELA.TFS.MBWI.CustomAction1.TargetDir)\SELA.TFS.MBWI.CustomAction1.CA.dll”dll位于发布目录中。当记录时,session.Log(“Begin CustomAction1”)
正确记录日志,还是在此之前就结束了?我还要检查$(var.SELA.TFS.MBWI.CustomAction1.TargetDir)是否实际提供了您期望的目录(我个人只使用相对路径)APPEND:As of::$(var.MyProject.TargetDir)
指向:`C:\users\myusername\Documents\Visual Studio 2010\Projects\MyProject\bin\Debug`您可能还需要检查项目引用。
CustomAction RemoveVsPackage returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (F8:60) [06:43:39:304]: Note: 1: 1723 2: RemoveVsPackage 3: DeleteVSPackage 4: C:\Windows\Installer\MSI1663.tmp
MSI (s) (F8:60) [06:43:39:304]: Note: 1: 2205 2: 3: Error
MSI (s) (F8:60) [06:43:39:304]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1723
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 RemoveVsPackage, entry: DeleteVSPackage, library: C:\Windows\Installer\MSI1663.tmp
MSI (s) (F8:60) [06:43:41:476]: Note: 1: 2205 2: 3: Error
MSI (s) (F8:60) [06:43:41:476]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (F8:60) [06:43:41:476]: 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 RemoveVsPackage, entry: DeleteVSPackage, library: C:\Windows\Installer\MSI1663.tmp