C# Класс WixSharp.CommonTasks.AppSearch

The utility class implementing the common 'MSI AppSearch' tasks (Directory, File, Registry and Product searches).
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
IniToDictionary ( string iniFileContent ) : Dictionary>
MsiEnumProducts ( int iProductIndex, StringBuilder lpProductBuf ) : int
MsiGetProductInfo ( string product, string property, [ valueBuf, Int32 &len ) : Int32

Описание методов

DirExists() публичный статический Метод

Determines whether the dir exists.
public static DirExists ( string dir ) : bool
dir string The directory path.
Результат bool

FileExists() публичный статический Метод

Determines whether the file exists.
public static FileExists ( string file ) : bool
file string The file path.
Результат bool

GetProductCode() публичный статический Метод

Gets the 'product code' of the installed product.
public static GetProductCode ( string name ) : string[]
name string The product name.
Результат string[]

GetProductName() публичный статический Метод

Gets the 'product name' of the installed product.
public static GetProductName ( string productCode ) : string
productCode string The product code.
Результат string

GetProducts() публичный статический Метод

Gets array of 'product codes' (GUIDs) of all installed products.
public static GetProducts ( ) : string[]
Результат string[]

GetRegValue() публичный статический Метод

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.
Результат object

IniFileToDictionary() публичный статический Метод

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.
Результат Dictionary>

IniFileValue() публичный статический Метод

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.
Результат string

IsProductInstalled() публичный статический Метод

Determines whether the product is installed.
public static IsProductInstalled ( string productCode ) : bool
productCode string The product code.
Результат bool

RegKeyExists() публичный статический Метод

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.
Результат bool