简体   繁体   中英

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). The first is a database feature that creates a db and runs some sql scripts. Another creates a web application in IIS. 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. If they're installing the web application, I'd like to make sure IIS is configured property (ie asp.net enabled).

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. 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.

-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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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