C# Class WixSharp.CommonTasks.AppSearch

The utility class implementing the common 'MSI AppSearch' tasks (Directory, File, Registry and Product searches).
Datei anzeigen Open project: Eun/WixSharp Class Usage Examples

Public Methods

Method Description
DirExists ( string dir ) : bool

Determines whether the dir exists.

FileExists ( string file ) : bool

Determines whether the file exists.

GetProductCode ( string name ) : string[]

Gets the 'product code' of the installed product.

GetProductName ( string productCode ) : string

Gets the 'product name' of the installed product.

GetProducts ( ) : string[]

Gets array of 'product codes' (GUIDs) of all installed products.

GetRegValue ( RegistryKey root, string keyPath, string valueName ) : object

Gets the registry value.

IniFileToDictionary ( string iniFile, Encoding encoding = null ) : Dictionary>

Converts INI file content into dictionary.

IniFileValue ( string file, string section, string field, Encoding encoding = null ) : string

Returns INI file the field value.

It returns null if file or the field not found.

IsProductInstalled ( string productCode ) : bool

Determines whether the product is installed.

RegKeyExists ( RegistryKey root, string keyPath ) : bool

Determines whether the registry key exists.

Private Methods

Method Description
IniToDictionary ( string iniFileContent ) : Dictionary>
MsiEnumProducts ( int iProductIndex, StringBuilder lpProductBuf ) : int
MsiGetProductInfo ( string product, string property, [ valueBuf, Int32 &len ) : Int32

Method Details

DirExists() public static method

Determines whether the dir exists.
public static DirExists ( string dir ) : bool
dir string The directory path.
return bool

FileExists() public static method

Determines whether the file exists.
public static FileExists ( string file ) : bool
file string The file path.
return bool

GetProductCode() public static method

Gets the 'product code' of the installed product.
public static GetProductCode ( string name ) : string[]
name string The product name.
return string[]

GetProductName() public static method

Gets the 'product name' of the installed product.
public static GetProductName ( string productCode ) : string
productCode string The product code.
return string

GetProducts() public static method

Gets array of 'product codes' (GUIDs) of all installed products.
public static GetProducts ( ) : string[]
return string[]

GetRegValue() public static method

Gets the registry value.
public static GetRegValue ( RegistryKey root, string keyPath, string valueName ) : object
root Microsoft.Win32.RegistryKey The root.
keyPath string The key path.
valueName string Name of the value.
return object

IniFileToDictionary() public static method

Converts INI file content into dictionary.
public static IniFileToDictionary ( string iniFile, Encoding encoding = null ) : Dictionary>
iniFile string The INI file.
encoding System.Text.Encoding The encoding.
return Dictionary>

IniFileValue() public static method

Returns INI file the field value.

It returns null if file or the field not found.

public static IniFileValue ( string file, string section, string field, Encoding encoding = null ) : string
file string The INI file path.
section string The section.
field string The field.
encoding System.Text.Encoding The encoding.
return string

IsProductInstalled() public static method

Determines whether the product is installed.
public static IsProductInstalled ( string productCode ) : bool
productCode string The product code.
return bool

RegKeyExists() public static method

Determines whether the registry key exists.
public static RegKeyExists ( RegistryKey root, string keyPath ) : bool
root Microsoft.Win32.RegistryKey The root.
keyPath string The key path.
return bool