MsiFunctions.

IsInstalled(string) Method

Summary

Returns a value indicating whether a product with the specified product code is installed.
Assembly
NAnt.Contrib.dll
Namespace
NAnt.Contrib.Functions
Containing Type
MsiFunctions

Syntax

[Function("is-installed")]
public static bool IsInstalled(string productCode)

Examples

Retrieves the product code of a given installer database, and fails the build if the product is not installed.

    <property name="office.productcode" value=${msi::get-product-code('Office.msi')}" />
<fail unless="${msi::is-installed(office.productcode)}">Please install Office first.</fail>

Attributes

Type Description
Function

Parameters

Name Type Description
productCode string The product code of the product to check.

Return Value

Type Description
bool true if a product with the specified product code is installed; otherwise, false.