Skip to content

IBackendHelper Interface

Interface provided to help backend extensions.

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

Creates a MSI compatible GUID.

public string CreateGuid()

string Creates an uppercase GUID with braces.

Creates a version 3 name-based UUID.

public string CreateGuid(
System.Guid namespaceGuid,
string value
)
ParameterTypeDescription
namespaceGuidSystem.GuidThe namespace UUID.
valuestringThe value.

string The generated GUID for the given namespace and value.

CreateResolvedDirectory(directoryParent, name) Method

Section titled “CreateResolvedDirectory(directoryParent, name) Method”

Creates a resolved directory.

public WixToolset.Extensibility.Data.IResolvedDirectory CreateResolvedDirectory(
string directoryParent,
string name
)
ParameterTypeDescription
directoryParentstringDirectory parent identifier.
namestringName of directory.

WixToolset.Extensibility.Data.IResolvedDirectory Resolved directory.

Generate an identifier by hashing data from the row.

public string GenerateIdentifier(
string prefix,
System.String[] args
)
ParameterTypeDescription
prefixstringThree letter or less prefix for generated row identifier.
argsSystem.String[]Information to hash.

string The generated identifier.

GetMsiFileName(value, source, longName) Method

Section titled “GetMsiFileName(value, source, longName) Method”

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

public string GetMsiFileName(
string value,
bool source,
bool longName
)
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

string The requesed file name.

GetValidCodePage(value, allowNoChange, onlyAnsi, sourceLineNumbers) Method

Section titled “GetValidCodePage(value, allowNoChange, onlyAnsi, sourceLineNumbers) Method”

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

public int GetValidCodePage(
string value,
bool allowNoChange,
bool onlyAnsi,
WixToolset.Data.SourceLineNumber sourceLineNumbers
)
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.

int A valid code page number.

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.

Verifies if an identifier is a valid binder variable name.

public bool IsValidBinderVariable(
string variable
)
ParameterTypeDescription
variablestringBinder variable name to verify.

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

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

public bool IsValidFourPartVersion(
string version
)
ParameterTypeDescription
versionstringThe version to verify.

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

Determines if value is a valid identifier.

public bool IsValidIdentifier(
string id
)
ParameterTypeDescription
idstringIdentifier to validate.

bool True if valid identifier, otherwise false.

IsValidLongFilename(filename, allowWildcards, allowRelative) Method

Section titled “IsValidLongFilename(filename, allowWildcards, allowRelative) Method”

Verifies the given string is a valid long filename.

public bool IsValidLongFilename(
string filename,
bool allowWildcards,
bool allowRelative
)
ParameterTypeDescription
filenamestringThe filename to verify.
allowWildcardsboolAllow wildcards in the filename.
allowRelativeboolAllow long file name to be a relative path.

bool True if filename is a valid long filename.

Verifies the given string is a valid MSI product version.

public bool IsValidMsiProductVersion(
string version
)
ParameterTypeDescription
versionstringThe MSI product version to verify.

bool True if version is a valid MSI product version

IsValidShortFilename(filename, allowWildcards) Method

Section titled “IsValidShortFilename(filename, allowWildcards) Method”

Verifies the given string is a valid short filename.

public bool IsValidShortFilename(
string filename,
bool allowWildcards
)
ParameterTypeDescription
filenamestringThe filename to verify.
allowWildcardsboolAllow wildcards in the filename.

bool True if filename is a valid short filename.

Verifies the given string is a valid WiX version.

public bool IsValidWixVersion(
string version
)
ParameterTypeDescription
versionstringThe version to verify.

bool True if version is a valid WiX version.

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

public System.String[] SplitMsiFileName(
string value
)
ParameterTypeDescription
valuestringThe Filename value.

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

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.