Skip to main content

IBackendHelper Interface

Interface provided to help backend extensions.

Methods

MethodDescription
CreateGuid()Creates a MSI compatible GUID.
CreateGuid(namespaceGuid, value)Creates a version 3 name-based UUID.
CreateResolvedDirectory(directoryParent, name)Creates a resolved directory.
GenerateIdentifier(prefix, args)Generate an identifier by hashing data from the row.
GetMsiFileName(value, source, longName)Get a source/target and short/long file name from an MSI Filename column.
GetValidCodePage(value, allowNoChange, onlyAnsi, sourceLineNumbers)Gets a valid code page from the given web name or integer value.
IsValidBinderVariable(variable)Verifies if an identifier is a valid binder variable name.
IsValidFourPartVersion(version)Verifies the given string is a valid 4-part version.
IsValidIdentifier(id)Determines if value is a valid identifier.
IsValidLongFilename(filename, allowWildcards, allowRelative)Verifies the given string is a valid long filename.
IsValidMsiProductVersion(version)Verifies the given string is a valid MSI product version.
IsValidShortFilename(filename, allowWildcards)Verifies the given string is a valid short filename.
IsValidWixVersion(version)Verifies the given string is a valid WiX version.
SplitMsiFileName(value)Get the source/target and short/long file names from an MSI Filename column.

WixToolset.Extensibility.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

CreateGuid() Method

Creates a MSI compatible GUID.

Declaration

public string CreateGuid()

Return value

string Creates an uppercase GUID with braces.

CreateGuid(namespaceGuid, value) Method

Creates a version 3 name-based UUID.

Declaration

public string CreateGuid(
System.Guid namespaceGuid,
string value
)

Parameters

ParameterTypeDescription
namespaceGuidSystem.GuidThe namespace UUID.
valuestringThe value.

Return value

string The generated GUID for the given namespace and value.

CreateResolvedDirectory(directoryParent, name) Method

Creates a resolved directory.

Declaration

public WixToolset.Extensibility.Data.IResolvedDirectory CreateResolvedDirectory(
string directoryParent,
string name
)

Parameters

ParameterTypeDescription
directoryParentstringDirectory parent identifier.
namestringName of directory.

Return value

WixToolset.Extensibility.Data.IResolvedDirectory Resolved directory.

GenerateIdentifier(prefix, args) Method

Generate an identifier by hashing data from the row.

Declaration

public string GenerateIdentifier(
string prefix,
System.String[] args
)

Parameters

ParameterTypeDescription
prefixstringThree letter or less prefix for generated row identifier.
argsSystem.String[]Information to hash.

Return value

string The generated identifier.

GetMsiFileName(value, source, longName) Method

Get a source/target and short/long file name from an MSI Filename column.

Declaration

public string GetMsiFileName(
string value,
bool source,
bool longName
)

Parameters

ParameterTypeDescription
valuestringThe Filename value.
sourcebooltrue to get a source name; false to get a target name
longNamebooltrue to get a long name; false to get a short name

Return value

string The requesed file name.

GetValidCodePage(value, allowNoChange, onlyAnsi, sourceLineNumbers) Method

Gets a valid code page from the given web name or integer value.

Declaration

public int GetValidCodePage(
string value,
bool allowNoChange,
bool onlyAnsi,
WixToolset.Data.SourceLineNumber sourceLineNumbers
)

Parameters

ParameterTypeDescription
valuestringA code page web name or integer value as a string.
allowNoChangeboolWhether to allow -1 which does not change the database code pages. This may be the case with wxl files.
onlyAnsiboolWhether to allow Unicode (UCS) or UTF code pages.
sourceLineNumbersWixToolset.Data.SourceLineNumberSource line information for the current authoring.

Return value

int A valid code page number.

Exceptions

ExceptionDescription
T:System.ArgumentOutOfRangeExceptionThe value is an integer less than 0 or greater than 65535.
T:System.ArgumentNullExceptionis null.
T:System.NotSupportedExceptionThe value doesn't not represent a valid code page name or integer value.
T:WixToolset.Data.WixExceptionThe code page is invalid for summary information.

IsValidBinderVariable(variable) Method

Verifies if an identifier is a valid binder variable name.

Declaration

public bool IsValidBinderVariable(
string variable
)

Parameters

ParameterTypeDescription
variablestringBinder variable name to verify.

Return value

bool True if the identifier is a valid binder variable name.

IsValidFourPartVersion(version) Method

Verifies the given string is a valid 4-part version.

Declaration

public bool IsValidFourPartVersion(
string version
)

Parameters

ParameterTypeDescription
versionstringThe version to verify.

Return value

bool True if version is a valid 4-part version.

IsValidIdentifier(id) Method

Determines if value is a valid identifier.

Declaration

public bool IsValidIdentifier(
string id
)

Parameters

ParameterTypeDescription
idstringIdentifier to validate.

Return value

bool True if valid identifier, otherwise false.

IsValidLongFilename(filename, allowWildcards, allowRelative) Method

Verifies the given string is a valid long filename.

Declaration

public bool IsValidLongFilename(
string filename,
bool allowWildcards,
bool allowRelative
)

Parameters

ParameterTypeDescription
filenamestringThe filename to verify.
allowWildcardsboolAllow wildcards in the filename.
allowRelativeboolAllow long file name to be a relative path.

Return value

bool True if filename is a valid long filename.

IsValidMsiProductVersion(version) Method

Verifies the given string is a valid MSI product version.

Declaration

public bool IsValidMsiProductVersion(
string version
)

Parameters

ParameterTypeDescription
versionstringThe MSI product version to verify.

Return value

bool True if version is a valid MSI product version

IsValidShortFilename(filename, allowWildcards) Method

Verifies the given string is a valid short filename.

Declaration

public bool IsValidShortFilename(
string filename,
bool allowWildcards
)

Parameters

ParameterTypeDescription
filenamestringThe filename to verify.
allowWildcardsboolAllow wildcards in the filename.

Return value

bool True if filename is a valid short filename.

IsValidWixVersion(version) Method

Verifies the given string is a valid WiX version.

Declaration

public bool IsValidWixVersion(
string version
)

Parameters

ParameterTypeDescription
versionstringThe version to verify.

Return value

bool True if version is a valid WiX version.

SplitMsiFileName(value) Method

Get the source/target and short/long file names from an MSI Filename column.

Declaration

public System.String[] SplitMsiFileName(
string value
)

Parameters

ParameterTypeDescription
valuestringThe Filename value.

Return value

System.String[] An array of strings of length 4. The contents are: short target, long target, short source, and long source.

Remarks

If any particular file name part is not parsed, its set to null in the appropriate location of the returned array of strings. Thus the returned array will always be of length 4.