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

Показать файл Открыть проект

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

Метод Описание
AddAction ( this project ) : Project

Adds the action.

AddAssociation ( this file ) : File

Adds the file association.

AddBinary ( this project ) : Project

Adds the binary.

AddDir ( this dir ) : Dir

Adds the dir.

AddDir ( this project ) : Project

Adds the dir.

AddDirFileCollection ( this dir ) : Dir

Adds the dir file collection.

AddEnvironmentVariable ( this project ) : Project

Adds the environment variable.

AddFile ( this dir ) : Dir

Adds the file.

AddFileCollection ( this dir ) : Dir

Adds the file collection.

AddMergeModule ( this dir ) : Dir

Adds the merge module.

AddProperty ( this project ) : Project

Adds the property.

AddRefAssembly ( this action ) : ManagedAction

Adds the assembly reference.

AddRegValue ( this project ) : Project

Adds the registry value.

AddShortcut ( this dir ) : Dir

Adds the shortcut.

AddShortcut ( this file ) : File

Adds the shortcut.

BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue ) : string

Builds the bootstrapper.

BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue, bool doNotPostVerifyPrerequisite ) : string

Builds the bootstrapper.

BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue, bool doNotPostVerifyPrerequisite, string optionalArguments ) : string

Builds the bootstrapper.

DigitalySign ( string fileToSign, string pfxFile, string timeURL, string password ) : int

Applies digital signature to a file (e.g. msi, exe, dll) with MS SignTool.exe utility.

If you need to specify extra SignTool.exe parameters or the location of the tool use the overloaded DigitalySign signature

DigitalySign ( string fileToSign, string pfxFile, string timeURL, string password, string optionalArguments = null, string wellKnownLocations = null ) : int

Applies digital signature to a file (e.g. msi, exe, dll) with MS SignTool.exe utility.

GetFileVersion ( string file ) : System.Version

Gets the file version.

ImportRegFile ( this project, string regFile ) : Project

Imports the reg file. It is nothing else but an extension method version of the 'plain' T:WixSharp.CommonTasks.Tasks.ImportRegFile.

ImportRegFile ( string regFile ) : WixSharp.RegValue[]

Imports the reg file.

InjectClrDialog ( this project, string showDialogMethod, string prevDialog, string nextDialog ) : Project

Injects CLR dialog between MSI dialogs 'prevDialog' and 'nextDialog'. Passes custom action CLR method name (showDialogMethod) for instantiating and popping up the CLR dialog.

InstallService ( string serviceFile, bool isInstalling ) : string

Installs the windows service. It uses InstallUtil.exe to complete the actual installation/uninstallation. During the run for the InstallUtil.exe console window is hidden. /// If any error occurred the console output is captured and embedded into the raised Exception object.

RemoveDialogsBetween ( this project, string start, string end ) : Project

Removes the dialogs between specified two dialogs. It simply connects 'next' button of the start dialog with the 'NewDialog' action associated with the end dialog. And vise versa for the 'back' button.

SetConfigAttribute ( this config, string elementPath, string value ) : System.Xml.Linq.XElement

Sets the value of the attribute value in the .NET application configuration file according the specified XPath expression.

This simple routine is to be used for the customization of the installed config files (e.g. in the deferred custom actions).

SetConfigAttribute ( string configFile, string elementPath, string value ) : void

Sets the value of the attribute value in the .NET application configuration file according the specified XPath expression.

This simple routine is to be used for the customization of the installed config files (e.g. in the deferred custom actions).

SetNetFxPrerequisite ( this project, string versionCondition, string errorMessage = null ) : Project

Binds the LaunchCondition to the version condition based on WiXNetFxExtension properties.

The typical conditions are:

NETFRAMEWORK20="#1"

NETFRAMEWORK40FULL="#1"

NETFRAMEWORK35="#1"

NETFRAMEWORK30_SP_LEVEL and NOT NETFRAMEWORK30_SP_LEVEL='#0'

...

The full list of names and values can be found here http://wixtoolset.org/documentation/manual/v3/customactions/wixnetfxextension.html

SetVersionFrom ( this project, string fileId ) : Project

Sets the Project version from the file version of the file specified by it's ID.

This method sets project WixSourceGenerated event handler and injects "!(bind.FileVersion.<file ID>" into the XML Product's Version attribute.

StartService ( string service, bool throwOnError = true ) : string

Starts the windows service. It uses sc.exe to complete the action. During the action console window is hidden. If any error occurred the console output is captured and embedded into the raised Exception object.

StopService ( string service, bool throwOnError = true ) : string

Stops the windows service. It uses sc.exe to complete the action. During the action console window is hidden. If any error occurred the console output is captured and embedded into the raised Exception object.

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

Метод Описание
AddEnvironmentVariabl ( this project ) : Project
InjectClrDialogInFeatureTreeUI ( this project, string showDialogMethod, string prevDialog, string nextDialog ) : Project
ServiceDo ( string action, string service, bool throwOnError ) : string
SetClrPrerequisite ( this project, string version, string errorMessage = null ) : Project

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

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

Adds the action.
public static AddAction ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the file association.
public static AddAssociation ( this file ) : File
file this The file.
Результат File

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

Adds the binary.
public static AddBinary ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the dir.
public static AddDir ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the dir.
public static AddDir ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the dir file collection.
public static AddDirFileCollection ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the environment variable.
public static AddEnvironmentVariable ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the file.
public static AddFile ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the file collection.
public static AddFileCollection ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the merge module.
public static AddMergeModule ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the property.
public static AddProperty ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the assembly reference.
public static AddRefAssembly ( this action ) : ManagedAction
action this The action.
Результат WixSharp.ManagedAction

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

Adds the registry value.
public static AddRegValue ( this project ) : Project
project this The project.
Результат WixSharp.Project

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

Adds the shortcut.
public static AddShortcut ( this dir ) : Dir
dir this The dir.
Результат WixSharp.Dir

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

Adds the shortcut.
public static AddShortcut ( this file ) : File
file this The file.
Результат File

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

Builds the bootstrapper.
public static BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue ) : string
prerequisiteFile string The prerequisite file.
primaryFile string The primary setup file.
outputFile string The output (bootsrtapper) file.
prerequisiteRegKeyValue string The prerequisite registry key value. /// This value is used to determine if the PrerequisiteFile should be launched. /// This value must comply with the following pattern: <RegistryHive>:<KeyPath>:<ValueName>. /// PrerequisiteRegKeyValue = @"HKLM:Software\My Company\My Product:Installed"; /// Existence of the specified registry value at runtime is interpreted as an indication of the PrerequisiteFile has been already installed. /// Thus bootstrapper will execute PrimaryFile without launching PrerequisiteFile first.
Результат string

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

Builds the bootstrapper.
public static BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue, bool doNotPostVerifyPrerequisite ) : string
prerequisiteFile string The prerequisite file.
primaryFile string The primary setup file.
outputFile string The output (bootsrtapper) file.
prerequisiteRegKeyValue string The prerequisite registry key value. /// This value is used to determine if the PrerequisiteFile should be launched. /// This value must comply with the following pattern: <RegistryHive>:<KeyPath>:<ValueName>. /// PrerequisiteRegKeyValue = @"HKLM:Software\My Company\My Product:Installed"; /// Existence of the specified registry value at runtime is interpreted as an indication of the PrerequisiteFile has been already installed. /// Thus bootstrapper will execute PrimaryFile without launching PrerequisiteFile first.
doNotPostVerifyPrerequisite bool The flag which allows you to disable verification of PrerequisiteRegKeyValue after the prerequisite setup is completed. /// Normally if bootstrapper checkers if PrerequisiteRegKeyValue/> exists straight after the prerequisite installation and starts /// the primary setup only if it does. /// It is possible to instruct bootstrapper to continue with the primary setup regardless of the prerequisite installation outcome. This can be done /// by setting DoNotPostVerifyPrerequisite to true (default is false) ///
Результат string

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

Builds the bootstrapper.
public static BuildBootstrapper ( string prerequisiteFile, string primaryFile, string outputFile, string prerequisiteRegKeyValue, bool doNotPostVerifyPrerequisite, string optionalArguments ) : string
prerequisiteFile string The prerequisite file.
primaryFile string The primary setup file.
outputFile string The output (bootsrtapper) file.
prerequisiteRegKeyValue string The prerequisite registry key value. /// This value is used to determine if the PrerequisiteFile should be launched. /// This value must comply with the following pattern: <RegistryHive>:<KeyPath>:<ValueName>. /// PrerequisiteRegKeyValue = @"HKLM:Software\My Company\My Product:Installed"; /// Existence of the specified registry value at runtime is interpreted as an indication of the PrerequisiteFile has been alreday installed. /// Thus bootstrapper will execute PrimaryFile without launching PrerequisiteFile first.
doNotPostVerifyPrerequisite bool The flag which allows you to disable verification of PrerequisiteRegKeyValue after the prerequisite setup is completed. /// Normally if bootstrapper checks if PrerequisiteRegKeyValue/> exists straight after the prerequisite installation and starts /// the primary setup only if it does. /// It is possible to instruct bootstrapper to continue with the primary setup regardless of the prerequisite installation outcome. This can be done /// by setting DoNotPostVerifyPrerequisite to true (default is false) ///
optionalArguments string The optional arguments for the bootstrapper compiler.
Результат string

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

Applies digital signature to a file (e.g. msi, exe, dll) with MS SignTool.exe utility.

If you need to specify extra SignTool.exe parameters or the location of the tool use the overloaded DigitalySign signature

public static DigitalySign ( string fileToSign, string pfxFile, string timeURL, string password ) : int
fileToSign string The file to sign.
pfxFile string Specify the signing certificate in a file. If this file is a PFX with a password, the password may be supplied /// with the password parameter.
timeURL string The timestamp server's URL. If this option is not present, the signed file will not be timestamped. /// A warning is generated if timestamping fails.
password string The password to use when opening the PFX file.
Результат int

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

Applies digital signature to a file (e.g. msi, exe, dll) with MS SignTool.exe utility.
public static DigitalySign ( string fileToSign, string pfxFile, string timeURL, string password, string optionalArguments = null, string wellKnownLocations = null ) : int
fileToSign string The file to sign.
pfxFile string Specify the signing certificate in a file. If this file is a PFX with a password, the password may be supplied /// with the password parameter.
timeURL string The timestamp server's URL. If this option is not present (pass to null), the signed file will not be timestamped. /// A warning is generated if timestamping fails.
password string The password to use when opening the PFX file. Should be null if no password required.
optionalArguments string Extra arguments to pass to the SignTool.exe utility.
wellKnownLocations string The optional ';' separated list of directories where SignTool.exe can be located. /// If this parameter is not specified WixSharp will try to locate the SignTool in the built-in well-known locations (system PATH)
Результат int

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

Gets the file version.
public static GetFileVersion ( string file ) : System.Version
file string The path to the file.
Результат System.Version

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

Imports the reg file. It is nothing else but an extension method version of the 'plain' T:WixSharp.CommonTasks.Tasks.ImportRegFile.
public static ImportRegFile ( this project, string regFile ) : Project
project this The project object.
regFile string The reg file.
Результат WixSharp.Project

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

Imports the reg file.
public static ImportRegFile ( string regFile ) : WixSharp.RegValue[]
regFile string The reg file.
Результат WixSharp.RegValue[]

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

Injects CLR dialog between MSI dialogs 'prevDialog' and 'nextDialog'. Passes custom action CLR method name (showDialogMethod) for instantiating and popping up the CLR dialog.
public static InjectClrDialog ( this project, string showDialogMethod, string prevDialog, string nextDialog ) : Project
project this The project.
showDialogMethod string The show dialog method.
prevDialog string The previous dialog.
nextDialog string The next dialog.
Результат WixSharp.Project

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

Installs the windows service. It uses InstallUtil.exe to complete the actual installation/uninstallation. During the run for the InstallUtil.exe console window is hidden. /// If any error occurred the console output is captured and embedded into the raised Exception object.
public static InstallService ( string serviceFile, bool isInstalling ) : string
serviceFile string The service file.
isInstalling bool if set to true [is installing].
Результат string

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

Removes the dialogs between specified two dialogs. It simply connects 'next' button of the start dialog with the 'NewDialog' action associated with the end dialog. And vise versa for the 'back' button.
public static RemoveDialogsBetween ( this project, string start, string end ) : Project
project this The project.
start string The start.
end string The end.
Результат WixSharp.Project

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

Sets the value of the attribute value in the .NET application configuration file according the specified XPath expression.

This simple routine is to be used for the customization of the installed config files (e.g. in the deferred custom actions).

public static SetConfigAttribute ( this config, string elementPath, string value ) : System.Xml.Linq.XElement
config this The configuration file element.
elementPath string The element XPath value. It should include the attribute name.
value string The value to be set to the attribute.
Результат System.Xml.Linq.XElement

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

Sets the value of the attribute value in the .NET application configuration file according the specified XPath expression.

This simple routine is to be used for the customization of the installed config files (e.g. in the deferred custom actions).

public static SetConfigAttribute ( string configFile, string elementPath, string value ) : void
configFile string The configuration file.
elementPath string The element XPath value. It should include the attribute name.
value string The value to be set to the attribute.
Результат void

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

Binds the LaunchCondition to the version condition based on WiXNetFxExtension properties.

The typical conditions are:

NETFRAMEWORK20="#1"

NETFRAMEWORK40FULL="#1"

NETFRAMEWORK35="#1"

NETFRAMEWORK30_SP_LEVEL and NOT NETFRAMEWORK30_SP_LEVEL='#0'

...

The full list of names and values can be found here http://wixtoolset.org/documentation/manual/v3/customactions/wixnetfxextension.html
public static SetNetFxPrerequisite ( this project, string versionCondition, string errorMessage = null ) : Project
project this The project.
versionCondition string Condition expression. ///
errorMessage string The error message to be displayed if .NET version is not present.
Результат WixSharp.Project

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

Sets the Project version from the file version of the file specified by it's ID.

This method sets project WixSourceGenerated event handler and injects "!(bind.FileVersion.<file ID>" into the XML Product's Version attribute.

public static SetVersionFrom ( this project, string fileId ) : Project
project this The project.
fileId string The file identifier.
Результат WixSharp.Project

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

Starts the windows service. It uses sc.exe to complete the action. During the action console window is hidden. If any error occurred the console output is captured and embedded into the raised Exception object.
public static StartService ( string service, bool throwOnError = true ) : string
service string The service.
throwOnError bool if set to true [throw on error].
Результат string

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

Stops the windows service. It uses sc.exe to complete the action. During the action console window is hidden. If any error occurred the console output is captured and embedded into the raised Exception object.
public static StopService ( string service, bool throwOnError = true ) : string
service string The service.
throwOnError bool if set to true [throw on error].
Результат string