【问题标题】:WiX script with only Welcome and Completed screens只有欢迎屏幕和已完成屏幕的 WiX 脚本
【发布时间】:2010-09-17 01:49:57
【问题描述】:

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

【问题讨论】:

    标签: wix installation windows-installer


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      您需要做的就是在您的 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" />
      

      【讨论】:

      • 看起来它适用于某些旧版本的 wix。请参阅下面的 Wix 3.8 答案中的完整示例,该示例基于 CheGueVerra 同志的原始答案
      • @CheGueVerra 干得好!为我工作。你知道如何添加对话框,上面写着:“以前的版本已经存在,你想继续吗?”?我试过 [stackoverflow.com/questions/16014082/…
      • @CheGueVerra 非常感谢您!请看:stackoverflow.com/questions/33690724/…
      • 我找不到“WixUIExtension.dll”。供将来参考:C:\Program Files (x86)\WiX Toolset v3.7\bin\WixUIExtension.dll 我对 WiX 很陌生,如果这是常识,请原谅。
      猜你喜欢
      • 2015-08-18
      • 1970-01-01
      • 1970-01-01
      • 2020-05-19
      • 1970-01-01
      • 2020-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多