3

我有一个Product.wxs在 Visual Studio 2010 Professional 中正确构建的 WiX 3.8 安装程序。
我只是想修改安装程序的步骤工作流程,所以我在 Wix/Product/Package XML 元素之后添加了这个:

<UI>
  <Publish Dialog="WelcomeDlg"
           Control="Next"
           Event="NewDialog"
           Value="InstallDirDlg"
           Order="2">1</Publish>
  <Publish Dialog="InstallDirDlg"
           Control="Back"
           Event="NewDialog"
           Value="WelcomeDlg"
           Order="2">1</Publish>
</UI>

问题:WiX 现在失败并显示以下消息:

错误 13 ICE17:按钮:对话框的“下一步”:“InstallDirDlg”没有在 ControlEvent 表中定义的事件。这是一个“什么都不做”按钮。C:\src\wix38\src\ext\UIExtension\wixlib\InstallDirDlg.wxs 14 1 安装程序

我究竟做错了什么?

4

3 回答 3

4

我认为您需要参考您正在修改的 WiX UI。尝试这个:

<UI>
  <UIRef Id="WixUI_InstallDir" />        <!-- Added line -->

  <Publish Dialog="WelcomeDlg"
           Control="Next"
           Event="NewDialog"
           Value="InstallDirDlg"
           Order="2">1</Publish>
  <Publish Dialog="InstallDirDlg"
           Control="Back"
           Event="NewDialog"
           Value="WelcomeDlg"
           Order="2">1</Publish>
</UI>
于 2014-07-08T09:22:50.040 回答
0

我想将 InstallDirDlg 集成到自定义 UI,因此我从WixUI_InstallDir.wxs源代码中复制并修改了Publish语句。

于 2018-03-21T11:56:13.790 回答
0

这适用于所有遇到相同错误但使用“WixSharp”库的人。您可以使用以下示例代码。希望能帮助到你!

public void GenerateMSI()
{
    //generic setup code
    Project project =
        new Project("myinstaller.msi",
            new Dir(@"d:\deployhere\", new Files(@"c:\mybuildfilesarehere\")),
            new Dir(@"d:\deployheretoo\", new Files(@"c:\mybuildfilesarehere\")));
    project.ProductId = new Guid();
    project.GUID = new Guid();

    //#1
    project.UI = WUI.WixUI_InstallDir; 

    //#2 - this will error without #1 (Exepected Error: @3, see below.)
    project.CustomUI =
new DialogSequence()
   .On(NativeDialogs.WelcomeDlg, Buttons.Next,
       new ShowDialog(NativeDialogs.InstallDirDlg))
   .On(NativeDialogs.InstallDirDlg, Buttons.Back,
       new ShowDialog(NativeDialogs.WelcomeDlg));

    Compiler.BuildMsi(project);
}

@3 - ErrorMessage:错误 LGHT0204:ICE17:PushButton:对话框的“Next”:“InstallDirDlg”没有在 ControlEvent 表中定义的事件。这是一个“什么都不做”按钮。//ICE17: PushButton: 'ChangeFolder' of Dialog: 'InstallDirDlg' 没有在 ControlEvent 表中定义的事件。这是一个“什么都不做”按钮。

于 2018-11-28T18:20:51.387 回答