仅包含“欢迎”和“已完成”屏幕的WiX脚本

时间:2008-10-14 11:11:24

标签: wix installer windows-installer

我需要显示一个WiX 3脚本才能显示2个对话框:欢迎&已完成。这是不需要EULA,文件夹选择等所有帮助赞赏。

2 个答案:

答案 0 :(得分:48)

您需要做的就是在WIX脚本中添加它,它将在安装之前为您提供WelcomeDlg并显示安装进度,然后显示Exit对话框。不要忘记将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" />

答案 1 :(得分:5)

如果您使用的是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>