27

我需要一个 WiX 3 脚本来显示以仅显示 2 个对话框:欢迎和已完成。那就是不需要 EULA、文件夹选择等。所有帮助表示赞赏。

4

2 回答 2

55

您需要做的就是在您的 WIX 脚本中添加它,它会在安装前为您提供 WelcomeDlg 并显示安装进度,然后是退出对话框。不要忘记将 WixUIExtension.dll 添加到您的引用中。

<UI Id="UserInterface">
  <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
  <Property Id="WixUI_Mode" Value="Custom" />

  <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
  <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
  <TextStyle Id="WixUI_Font_Title"  FaceName="Tahoma" Size="9" Bold="yes" />

  <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />

  <DialogRef Id="ProgressDlg" />
  <DialogRef Id="ErrorDlg" />
  <DialogRef Id="FilesInUse" />
  <DialogRef Id="FatalError" />
  <DialogRef Id="UserExit" />

  <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
  <Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish>

</UI>
<UIRef Id="WixUI_Common" />
于 2008-11-03T19:39:55.613 回答
7

如果您使用的是 Visual Studio 和 Wix 3.8,那么您可以创建 Wix 安装项目并使用下面的文本作为 Product.wxs 的内容。在我的情况下,我需要将 python 和文本文件复制到目标目录中。再次感谢CheGueVerra同志的原创杰作:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product Id="*" Name="testwixsetup" Language="1033" Version="2.1.3.0" Manufacturer="ttt" UpgradeCode="PUT-GUID-HERE">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

        <Feature Id="ProductFeature" Title="testwixsetup" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>

    <UI Id="UserInterface">
      <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
      <Property Id="WixUI_Mode" Value="Custom" />

      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
      <TextStyle Id="WixUI_Font_Title"  FaceName="Tahoma" Size="9" Bold="yes" />

      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />

      <DialogRef Id="ProgressDlg" />
      <DialogRef Id="ErrorDlg" />
      <DialogRef Id="FilesInUse" />
      <DialogRef Id="FatalError" />
      <DialogRef Id="UserExit" />

      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
      <Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish>

    </UI>
    <UIRef Id="WixUI_Common" />
  </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
        <Directory Id="COMPANYFOLDER" Name="test-wixinstall">
          <Directory Id="INSTALLFOLDER" Name="testwixsetup" />
        </Directory>
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
                <Component Id="ProductComponent" Guid="*">
          <File Name="test.py"/>
          <File Name="test.txt"/>
             </Component>
        </ComponentGroup>
    </Fragment>

</Wix>
于 2014-07-28T21:13:06.277 回答