0

我正在尝试做的正是这里描述的内容Inserting a custom dialog into a built-in dialog sethttp ://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html

上面链接的文档说我应该将其中的所有内容复制到我自己的源文件中,包括<Fragment>from 。WixUI_InstallDir.wxs然后我可以调整Publish语句并插入我自己的 UI。但是,当我尝试这样做时,我得到以下信息:

错误 LGHT0091:找到重复的符号“WixUI:WixUI_InstallDir”。这通常意味着一个 Id 是重复的。检查以确保给定类型(文件、组件、功能)的所有标识符都是唯一的。

我想那是因为我的Product.wxs:

<UIRef Id="WixUI_InstallDir" />

但是如果我删除它,我应该如何引用 InstallDir UI?因为当我删除它时,它会编译,但 InstallDir UI 不再显示。

我确定我在做完全错误的事情,但这是我第一次弄乱 WiX,所以放轻松:)

作为参考,这是我的全部内容Product.wxs

... 是确切副本(从<Fragment>until </Fragment>WixUI_InstallDir.wxs所在的位置,我将其省略以防止这篇文章变得太长。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
  xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'
  xmlns:sql='http://schemas.microsoft.com/wix/SqlExtension'>
  <Product Id="*" Name="product" Language="1033" Version="1.0.0.0" Manufacturer="man" UpgradeCode="GUID">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="Shell.MACAM" Level="1">
      <ComponentRef Id="SqlComponent" />
    </Feature>

    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
    <UIRef Id="WixUI_InstallDir" />

    <util:User Id='SQLUser' Name='[SQLUSER]' Password='[SQLPASSWORD]' />

    <UI>
      <Dialog Id="AskUserForSQLServer" Width="370" Height="270">
        <Control Type="Text" Id="SQLServerNameLabel" Width="50" Height="15" X="4" Y="8">
          <Text>SQL Server:</Text>
        </Control>
        <Control Type="Edit" Id="SQLServerName" Width="181" Height="15" X="60" Y="4">
        </Control>
      </Dialog>
    </UI>
    <UIRef Id="WixUI_Minimal" />
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="INETPUB" Name="Inetpub">
        <Directory Id="INSTALLFOLDER" Name="Shell.MACAM">
          <Component Id='SqlComponent' Guid='GUID'>
            <CreateFolder/>
            <sql:SqlDatabase Id='SqlDatabase' Database='[SQLDATABASE]' User='SQLUser' Server='[SQLSERVER]'
              CreateOnInstall='yes' DropOnUninstall='yes' ContinueOnError='yes'>
            </sql:SqlDatabase>
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>
  ...
  </Wix>
4

2 回答 2

1

“插入”对话框通过向 MSI 中的 ControlEvent 表添加行来工作。此表有一个 Order 列,可用于让您的 NewDialog 控件事件以比现有事件更高的优先级运行。

我运行了一个名为IsWiX的开源项目,该项目具有加速设置开发的项目模板。此模板的功能之一就是您在此处尝试执行的操作。UI-CustomDialog.wxs 片段定义了一个自定义对话框并插入行以将其放置在循环中。UI.wxs 片段引用了 WixUI_FeatureTree 对话框集,并具有对 UI-CustomDialog 片段的注释掉引用。取消注释,对话框变为活动状态。

不同的对话框集具有不同的对话框,因此在引用不同的集时必须调整对话框名称之前和之后的名称。

<!-- Insert into dialog sequencing by inserting control events on previous and next dialogs-->

<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomDlg">1</Publish>

<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="CustomDlg" Order="3">NOT Installed</Publish>

http://iswix.codeplex.com/SourceControl/latest#main/Source/Application/IsWiXAddIn/SetupProjectTemplate/UI.wxs http://iswix.codeplex.com/SourceControl/latest#main/Source/Application/IsWiXAddIn/SetupProjectTemplate /UI-CustomDialog.wxs

于 2015-03-30T00:31:32.760 回答
0

您需要将对话框“Id”(和文件名?)更改为不同的内容,以免出现 Id 冲突。然后,您可以包含/引用修改后的对话框的个人副本。

于 2015-03-29T13:55:38.420 回答