如何使用 WIX 2.0 创建自定义操作项目

发布于 2024-08-26 11:12:43 字数 1009 浏览 3 评论 0原文

我已经安装了 WIX 2.0(和 Votive)。我需要使用自定义操作项目创建用户定义的自定义操作。当安装WIX 3.0时,我在VS2008中找到了自定义操作项目模板。现在,我在带有WIX 2.0的VS2005中找不到任何模板。

任何人都可以让我知道如何创建自定义操作项目(具有一些自定义操作的类)..像这样

[CustomAction]
public static ActionResult InstallItem1(Session session)

我认为 Microsoft.WindowsInstaller 和 Microsoft.Deployment.WindowsInstaller 是创建此类方法所需的参考(不确定),但我在我的机器中找不到它们。


我设法通过引用“Microsoft.WindowsInstaller”dll 创建了一个自定义操作项目(只是一个包含一个类和自定义操作方法的类库)。但是在执行该 dll 时遇到问题..

<Custom Action='_InstallItem2' After='_InstallItem1'/>

<CustomAction Id='_InstallItem2'
  BinaryKey='CustomActionLibrary.dll'   
  DllEntry='InstallItem2'
  Impersonate='yes'
  Execute='immediate'
  Return='check' />

<Binary Id='CustomActionLibrary.dll'
  SourceFile='C:\WIX\CustomActionLibrary.dll' />

在该 dll 中有一个名为“InstallItem2”的方法标记为 [CustomAction].. 但面临错误:

此 Windows Installer 程序包有问题。无法运行完成此安装所需的 DLL(...)

知道为什么会出现此错误吗?

I have installed WIX 2.0 (and Votive). I need to create user defined custom actions using the Custom action project. I found the custom action project template in VS2008 when WIX 3.0 is installed. Now, I couldn't find any template in VS2005 with WIX 2.0.

Can anyone please let me know how can I create a custom action project (class with some custom action).. like this

[CustomAction]
public static ActionResult InstallItem1(Session session)

I think Microsoft.WindowsInstaller and Microsoft.Deployment.WindowsInstaller are the references required (not sure) to create such methods but i couldnt find them in my machine.


I managed to create a Custom Action project (just a Class Library with one class and the Custom Action methods) by referring 'Microsoft.WindowsInstaller' dll. But facing problem in executing that dll..

<Custom Action='_InstallItem2' After='_InstallItem1'/>

<CustomAction Id='_InstallItem2'
  BinaryKey='CustomActionLibrary.dll'   
  DllEntry='InstallItem2'
  Impersonate='yes'
  Execute='immediate'
  Return='check' />

<Binary Id='CustomActionLibrary.dll'
  SourceFile='C:\WIX\CustomActionLibrary.dll' />

There is a method called 'InstallItem2' marked as [CustomAction] in that dll.. But facing the error:

There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run(...)

Any idea why this error is coming?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城°AllureLove 2024-09-02 11:12:43

你要找的实际上是一个DTF(部署工具基础)项目,但DTF首先是随WiX 3.0一起发布的。

What you're looking for is actually a DTF (deployment tools foundation) project, but DTF was first released with WiX 3.0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文