WIX安装程序工具集-SQL Server和IIS Express安装 [英] WIX installer toolset - SQL Server and IIS express installation

查看:82
本文介绍了WIX安装程序工具集-SQL Server和IIS Express安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带有一些自定义UI屏幕的WIX安装程序,其中有一个带有两个单选按钮的自定义UI屏幕.我只想根据单选按钮的选择安装SQL Server Express和IIS Express.我如何实现此功能. 我在我的项目中使用WIX 3.11.2和Visual Studio 2019. 任何人都可以提供参考链接或代码片段,这将帮助我进一步发展,因为我是WIX安装程序的新手吗?

I have WIX installer with some custom UI screens out of which I have one custom UI screen with two radio buttons on it.i just want to install SQL Server Express and IIS Express depending radio button selection.How can i implement this functionality. I am using WIX 3.11.2 and Visual Studio 2019 in my project. Can anyone provide the reference links or code snippet which will help me to proceed further as i am totally new to WIX installer?

推荐答案

您可以使用InstallCondition尝试

You can try that by using InstallCondition

您的bundle.wxs将具有类似的内容

your bundle.wxs will have something like this

   <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
      <Bundle Name="YourProductName" Version="1.0.0.0" Manufacturer="" UpgradeCode="aa89733d-62f6-44e9-80c7-04a69cb7c077">
        <Variable Name="InstallIISEXPRESS" Value="0" bal:Overridable="yes" Type="string" />
        <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
        <Chain>
          <!-- TODO: Define the list of chained packages. -->
          <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
          <PackageGroupRef Id ='DatabaseGrp'/>
        </Chain>
      </Bundle>
      <Fragment>
        <PackageGroup Id ='DatabaseGrp'>
          <MsiPackage Id="SQLServerExpress_x86_msi"
                      Cache="yes"
                      InstallCondition= "NOT(InstallIISEXPRESS = 1)"
                      Visible ="yes"
                      Permanent="yes"
                      SourceFile="Path\To\Your\SQLServerExpressMSI">
            <MsiProperty Name="IACCEPTQLServerExpressLICENSETERMS"
                         Value="YES"/>
          </MsiPackage>

          <MsiPackage Id="IISExpress_x86_msi"
                      Cache="yes"
                      Visible ="yes"
                      InstallCondition= "InstallIISEXPRESS = 1"
                      Permanent="yes"
                      SourceFile="Path\To\Your\IISExpressMSI">
            <MsiProperty Name="IACCEPTIISExpressLICENSETERMS"
                         Value="YES"/>
          </MsiPackage>
        </PackageGroup>
      </Fragment>
    </Wix>

您需要在捆绑项目中添加对BalExtension的引用

You need to add a reference to the BalExtension in your Bundle Project

您需要从Bootstrapper(Custom UI)项目中设置变量InstallIISExpress的值,该值将确定要安装哪个数据库MSI. 您可以像这样在Bootstrapper项目中设置该值

You need to set the value of the variable InstallIISExpress from your Bootstrapper(Custom UI) project, which will decide which database MSI will get install. You can set that value from Bootstrapper project like this

Bootstrapper.Engine.StringVariables["InstallIISExpress"] = "0";
// If you want to install SQLEXPRESSSERVER then set it to "0"
// If you want to install IISEXPRESS then set it to "1"
// You can decide this value from radio button selected by user

InstallCondition指示是否应该安装软件包.如果条件评估为true,则可以安装该软件包.如果条件评估为false,则不应安装该软件包.如果该软件包存在并且条件评估为false,则该软件包将被卸载.

InstallCondition indicates whether the package should be installed or not. If the condition evaluates to true, then the package may be installed. If the condition evaluates to false, then the package should not be installed. If the package is present and the condition evaluates to false the package will be uninstalled.

这篇关于WIX安装程序工具集-SQL Server和IIS Express安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆