C# Class WixSharp.CommonTasks.AppSearch

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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

FileExists() public static méthode

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

GetProductCode() public static méthode

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

GetProductName() public static méthode

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

GetProducts() public static méthode

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

GetRegValue() public static méthode

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.
Résultat object

IniFileToDictionary() public static méthode

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.
Résultat Dictionary>

IniFileValue() public static méthode

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.
Résultat string

IsProductInstalled() public static méthode

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

RegKeyExists() public static méthode

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.
Résultat bool