我正在使用 VS2010 和 WIX 3.5。
1)我创建了 WIX 设置项目。
2)然后我添加到解决方案 C# 自定义操作项目并将其命名为“CustomActions”
namespace CustomActions
{
public static class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
Debugger.Break();
MessageBox.Show("It works");
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
}
}
3) 然后我编译了 CustomActions 项目并从我的安装项目中添加了对它的引用。
4)最后放入 .wxs 文件:
<Binary Id="CustomActions" SourceFile="$(var.CustomActions.TargetDir)$(var.CustomActions.TargetName).CA.dll"/>
<CustomAction Id="CustomAction1" BinaryKey="CustomActions" DllEntry="CustomAction1" Execute="immediate" />
那是行不通的。我究竟做错了什么?请帮我。