WIX c# CustomAction,我做错了什么?
我正在使用 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" />
那不起作用。我做错了什么?请帮我。
I'm using VS2010 and WIX 3.5.
1) I created WIX Setup Project.
2) Then I added to the solution C# custom action project and called it '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) Then I compiled CustomActions project and added reference to it from my setup project.
4) And finally put into .wxs file:
<Binary Id="CustomActions" SourceFile="$(var.CustomActions.TargetDir)$(var.CustomActions.TargetName).CA.dll"/>
<CustomAction Id="CustomAction1" BinaryKey="CustomActions" DllEntry="CustomAction1" Execute="immediate" />
That doesn't work. What am I doing wrong? Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要安排要运行的自定义操作
此外,您还必须意识到在 MSI 沙箱中运行会限制很多事情。我不相信您对 MessageBox.Show 的调用会起作用。您将不得不依赖会话日志记录。
You also need to schedule the custom action to run
Also you have to be aware that running in the MSI sandbox limits alot of things. I don't believe your call to MessageBox.Show will work. You'll have to rely on the session logging instead.