我的解决方案中目前有两个项目,一个是构建 msi 的部署项目,另一个是包含我的自定义操作的项目。我在引用我的自定义操作时遇到问题,相同的两个错误不断出现:
..WixSharp SetupbinDebugWixSharpSetup.exe" "/MSBUILD:WixSharp Setup" "/WIXBIN:"" exited with code -532462766. WixSharp Setup ..WixSharp SetuppackagesWixSharp.1.9.2buildWixSharp.targets 6
No CA or UI entry points found in module: ..WixSharp SetupWixSharp SetupWixSharpSetup.exe WixSharp Setup ..WixSharp SetupWixSharp SetupEXEC
部署项目
using System;
using System.Windows.Forms;
using Deploy.CustomAction;
using WixSharp;
using WixSharp.Forms;
namespace WixSharp_Setup
{
class Program
{
static void Main()
{
var project = new ManagedProject("MyProduct",
new Dir(@"%ProgramFiles%My CompanyMy Product",
new File("Program.cs")),
new ManagedAction(SearchAPIActions.SearchAPIInstall));
project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b");
project.ManagedUI = ManagedUI.Default; //all standard UI dialogs
project.BuildMsi();
}
自定义操作项目
public class SearchAPIActions
{
[CustomAction]
public static ActionResult SearchAPIInstall(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
如果有人感兴趣,我找到了我的问题的解决方案,因为自定义操作正在编译为.dll,因此您需要在声明 managedAction 时直接引用它。
new ManagedAction(CustomActions.IISReset, @"Your full PathCustoms.dll"));