如何为Wix安装项目添加自定义动作我的解决方案中有两个项目:1)。自定义动作类(CustomAction)2)。Wix安装项目(TestSetup)CustomAction项目中的CustomAction.cs:usingSystem;使用System.Collections.Generic;使用System.IO;使用System.Linq;使用系统文本;使用Microsoft.Deployment.WindowsInstaller;namespaceCustomAction{publicclassCustomActions{[CustomAction]publicstaticActionResultCustomAction1(Sessionsession){File.Create(@"c:installed.txt");返回ActionResult.Success;Product.wxs:安装项目构建没有问题,但是当我尝试运行它时,我收到一条错误消息:“此Windows安装程序包存在问题。此安装所需的DLL无法运行。请联系您的支持或包装供应商”我认为这是因为二进制源文件值不正确。你能解释一下如何解决吗?问题是您的CustomAction方法名称“CustomAction1”与您提到的“DLLEntry”值不匹配(DllEntry='CustomAction')。你错过了“1”:)你应该这样写:-其中CustomAction1是你的CustomAction名称..以上是C#学习教程:Howtoaddcustomactiontowixinstallationproject分享全部内容,如果对大家有用的话和需要了解更多C#学习教程,希望大家多加关注-本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
