C# Class WixSharp.CommonTasks.Tasks

Datei anzeigen Open project: Eun/WixSharp

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

AddAction() public static method

Adds the action.
public static AddAction ( this project ) : Project
project this The project.
return WixSharp.Project

AddAssociation() public static method

Adds the file association.
public static AddAssociation ( this file ) : File
file this The file.
return File

AddBinary() public static method

Adds the binary.
public static AddBinary ( this project ) : Project
project this The project.
return WixSharp.Project

AddDir() public static method

Adds the dir.
public static AddDir ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddDir() public static method

Adds the dir.
public static AddDir ( this project ) : Project
project this The project.
return WixSharp.Project

AddDirFileCollection() public static method

Adds the dir file collection.
public static AddDirFileCollection ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddEnvironmentVariable() public static method

Adds the environment variable.
public static AddEnvironmentVariable ( this project ) : Project
project this The project.
return WixSharp.Project

AddFile() public static method

Adds the file.
public static AddFile ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddFileCollection() public static method

Adds the file collection.
public static AddFileCollection ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddMergeModule() public static method

Adds the merge module.
public static AddMergeModule ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddProperty() public static method

Adds the property.
public static AddProperty ( this project ) : Project
project this The project.
return WixSharp.Project

AddRefAssembly() public static method

Adds the assembly reference.
public static AddRefAssembly ( this action ) : ManagedAction
action this The action.
return WixSharp.ManagedAction

AddRegValue() public static method

Adds the registry value.
public static AddRegValue ( this project ) : Project
project this The project.
return WixSharp.Project

AddShortcut() public static method

Adds the shortcut.
public static AddShortcut ( this dir ) : Dir
dir this The dir.
return WixSharp.Dir

AddShortcut() public static method

Adds the shortcut.
public static AddShortcut ( this file ) : File
file this The file.
return File

BuildBootstrapper() public static method

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.
return string

BuildBootstrapper() public static method

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) ///
return string

BuildBootstrapper() public static method

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.
return string

DigitalySign() public static method

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.
return int

DigitalySign() public static method

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)
return int

GetFileVersion() public static method

Gets the file version.
public static GetFileVersion ( string file ) : System.Version
file string The path to the file.
return System.Version

ImportRegFile() public static method

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.
return WixSharp.Project

ImportRegFile() public static method

Imports the reg file.
public static ImportRegFile ( string regFile ) : WixSharp.RegValue[]
regFile string The reg file.
return WixSharp.RegValue[]

InjectClrDialog() public static method

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.
return WixSharp.Project

InstallService() public static method

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].
return string

RemoveDialogsBetween() public static method

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.
return WixSharp.Project

SetConfigAttribute() public static method

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.
return System.Xml.Linq.XElement

SetConfigAttribute() public static method

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.
return void

SetNetFxPrerequisite() public static method

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.
return WixSharp.Project

SetVersionFrom() public static method

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.
return WixSharp.Project

StartService() public static method

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].
return string

StopService() public static method

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].
return string