简体   繁体   English

WIX-如果选择了功能,则有条件地安装SQL Server和/或IIS(数据库+ WebSite)

[英]WIX - Conditionally install SQL Server and / or IIS if features chosen (Database + WebSite)

I've created a WIX MSI that has 2 features (well actually more, but lets keep it simple for discussion). 我创建了一个具有2个功能的WIX MSI(实际上还有更多功能,但是让我们简单地进行讨论)。 The first is a database feature that creates a db and runs some sql scripts. 第一个是数据库功能,可创建数据库并运行一些sql脚本。 Another creates a web application in IIS. 另一个在IIS中创建一个Web应用程序。 If the user is installing the db locally (local instance name), then I'd like to allow them to install SQL Server Advanced Services (need full text indexing) beforehand. 如果用户正在本地安装数据库(本地实例名称),那么我希望允许他们事先安装SQL Server Advanced Services(需要全文索引)。 If they're installing the web application, I'd like to make sure IIS is configured property (ie asp.net enabled). 如果他们正在安装Web应用程序,则要确保已将IIS配置为属性(即,启用了asp.net)。

I've been looking into bootstrapper, but I'm not sure how I marry this up with the feature selection, as the prerequisites appear to run before. 我一直在研究引导程序,但是我不确定如何将其与功能选择结合使用,因为先决条件似乎已经在之前运行。 I'd like the user to choose if they want to install the db, or the web application, or both. 我希望用户选择是否要安装数据库或Web应用程序,或两者都安装。 Because in some scenarios they would want them on different machines. 因为在某些情况下,他们希望将它们放在不同的计算机上。

If they're only installing the db, then I don't want to enable IIS on the db machine. 如果他们只是安装数据库,那么我不想在数据库计算机上启用IIS。

-Lars -Lars

IMHO you don't need a bootstrapper at all. 恕我直言,您根本不需要引导程序。 Use the two features that you already have and use conditions for the installation of your files / prerequisites, using the feature state / user selection in the feature tree. 使用功能树中的功能状态/用户选择,使用已经拥有的两个功能以及安装文件的条件/先决条件。
According to Conditional Statement Syntax you can use the &feature-action in your conditions: 根据条件语句语法,您可以在条件中使用&feature-action

For example, the conditional expression "&MyFeature=3" evaluates to True only if MyFeature is changing from its current state to the state of being installed on the local computer, INSTALLSTATE_LOCAL.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM