我使用WiX安装程序为我的C#应用程序创建了一个安装程序。无法使用WiX安装程序进行设置
我使用类CustomAction安装SQL数据库并将权限设置为文件夹。
有我的课:
public class CustomActions
{
[CustomAction]
public static ActionResult AllowAppData(Session session){...}
[CustomAction]
public static ActionResult Install_SetupDataBase(Session session){...}
}
而且product.wxs:
<Binary Id="CASetup.dll" SourceFile="$(var.SetupCustomAction.TargetDir)$(var.SetupCustomAction.TargetName).CA.dll" />
<CustomAction Id="CustomActionSetupAllow" BinaryKey="CASetup.dll" DllEntry="AllowAppData" Execute="immediate" />
<CustomAction Id="CustomActionSetupBase" BinaryKey="CASetup.dll" DllEntry="Install_SetupDataBase" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action='CustomActionSetupAllow' After='InstallFinalize' />
<Custom Action='CustomActionSetupBase' After='InstallFinalize' />
</InstallExecuteSequence>
构建是好的,但是当安装完成我的消息:
我试过只有CustomActionSetupAllow
它的作品fin即但与CustomActionSetupBase
我收到了消息。
我怎么知道DLL丢失了?我应该在哪里添加参考?
我已将自定义操作标记为'After ='InstallFinalize''。这两个自定义操作都在同一个文件中。当我只调用'CustomActionSetupAllow'时它很好用,但只有'CustomActionSetupBase'有错误。我在第一行插入了一个断点,它不会中断。潜在缺少DLL是在安装项目还是在自定义操作项目中? –
该死的我很愚蠢......我没有看到我在CustomActionSetupBase之前移除了标志'[CustomAction]'。我为这个错误浪费了很多时间。但很高兴知道,如果该标志不存在,则可能发生此错误。谢谢你的帮助 –