C# Class WixSharp.Project

Represents Wix# project. This class defines the WiX/MSI entities and their relationships.

Project instance can be compiled into complete MSI or WiX source file with one of the Compiler "Build" methods.

Use Project non-default constructor or C# initializers to specify required installation components.

Inheritance: WixSharp.WixProject
Afficher le fichier Open project: Eun/WixSharp Class Usage Examples

Méthodes publiques

Свойство Type Description
Actions Action[]
AutoAssignedInstallDirPath string
BackgroundImage string
BannerImage string
Binaries WixSharp.Binary[]
Certificates WixSharp.Certificate[]
ControlPanelInfo ProductInfo
CustomUI WixSharp.Controls.CustomUI
DefaultRefAssemblies List
Description string
Dirs WixSharp.Dir[]
EmbeddedUI Binary
EmitConsistentPackageId bool
Encoding System.Text.Encoding
EnvironmentVariables WixSharp.EnvironmentVariable[]
InstallScope InstallScope?
InstallerVersion int
LaunchConditions List
LicenceFile string
LocalizationFile string
MajorUpgrade MajorUpgrade
MajorUpgradeStrategy MajorUpgradeStrategy
Media Media
Package Package
Platform Platform?
ProductId Guid?
Properties Property[]
RegValues WixSharp.RegValue[]
SqlDatabases SqlDatabase[]
UI WUI
UpgradeCode Guid?
Users WixSharp.User[]
Version System.Version

Private Properties

Свойство Type Description
Preprocess void

Méthodes publiques

Méthode Description
BuildMsi ( string path = null ) : string

Builds the MSI file from the specified Project instance.

BuildMsiCmd ( string path = null ) : string

Builds the WiX source file and generates batch file capable of building MSI with WiX toolset.

BuildMsm ( string path = null ) : string

Builds the MSM file from the specified Project instance.

BuildMsmCmd ( string path = null ) : string

Builds the WiX source file and generates batch file capable of building MSM with WiX toolset.

BuildWxs ( Compiler type = Compiler.OutputType.MSI, string path = null ) : string

Builds the WiX source file (*.wxs) from the specified Project instance.

CalculateProductId ( System.Guid productGuid, System.Version version ) : System.Guid

Calculates the product id.

FindDir ( string path ) : Dir

Finds T:WixSharp.Dir corresponding to the specified path. new Project("MyProduct", new Dir("%ProgramFiles%", new Dir("My Company", new Dir("My Product", ... In the sample above the call FindDir(@"%ProgramFiles%\My Company\My Product") returns the last declared T:WixSharp.Dir.

FindFile ( Predicate match ) : WixSharp.File[]

Returns all Files of the Project matching the match pattern.

GenerateProductGuids ( ) : void

Generates all missing product Guids (e.g. UpgradeCode and ProductId).

Wix# compiler call this method just before building the MSI. However you can call it any time if you want to preview auto-generated Guids.

Project ( ) : System

Initializes a new instance of the Project class.

Project ( string name ) : System

Initializes a new instance of the Project class.

ResolveWildCards ( bool ignoreEmptyDirectories = false ) : Project

Resolves all wild card specifications if any.

This method is called by Compiler during the compilation. However it might be convenient to call it before the compilation if any files matching the wild card mask need to be handled in special way (e.g. shortcuts created). See WildCard Files example.

ResolveWildCards should be called only after T:WixSharp.WixProject.SourceBaseDir is set. Otherwise wild card paths may not be resolved correctly.

Private Methods

Méthode Description
Preprocess ( ) : void

Method Details

BuildMsi() public méthode

Builds the MSI file from the specified Project instance.
public BuildMsi ( string path = null ) : string
path string The path to the MSI file to be build.
Résultat string

BuildMsiCmd() public méthode

Builds the WiX source file and generates batch file capable of building MSI with WiX toolset.
public BuildMsiCmd ( string path = null ) : string
path string The path to the batch file to be build.
Résultat string

BuildMsm() public méthode

Builds the MSM file from the specified Project instance.
public BuildMsm ( string path = null ) : string
path string The path to the MSM file to be build.
Résultat string

BuildMsmCmd() public méthode

Builds the WiX source file and generates batch file capable of building MSM with WiX toolset.
public BuildMsmCmd ( string path = null ) : string
path string The path to the batch file to be build.
Résultat string

BuildWxs() public méthode

Builds the WiX source file (*.wxs) from the specified Project instance.
public BuildWxs ( Compiler type = Compiler.OutputType.MSI, string path = null ) : string
type Compiler The type () of the setup file to be defined in the source file (MSI vs. MSM).
path string The path to the WXS file to be build.
Résultat string

CalculateProductId() public static méthode

Calculates the product id.
public static CalculateProductId ( System.Guid productGuid, System.Version version ) : System.Guid
productGuid System.Guid The product GUID.
version System.Version The version.
Résultat System.Guid

FindDir() public méthode

Finds T:WixSharp.Dir corresponding to the specified path. new Project("MyProduct", new Dir("%ProgramFiles%", new Dir("My Company", new Dir("My Product", ... In the sample above the call FindDir(@"%ProgramFiles%\My Company\My Product") returns the last declared T:WixSharp.Dir.
public FindDir ( string path ) : Dir
path string The path string.
Résultat Dir

FindFile() public méthode

Returns all Files of the Project matching the match pattern.
public FindFile ( Predicate match ) : WixSharp.File[]
match Predicate The match pattern.
Résultat WixSharp.File[]

GenerateProductGuids() public méthode

Generates all missing product Guids (e.g. UpgradeCode and ProductId).

Wix# compiler call this method just before building the MSI. However you can call it any time if you want to preview auto-generated Guids.

public GenerateProductGuids ( ) : void
Résultat void

Project() public méthode

Initializes a new instance of the Project class.
public Project ( ) : System
Résultat System

Project() public méthode

Initializes a new instance of the Project class.
public Project ( string name ) : System
name string The name of the project. Typically it is the name of the product to be installed.
Résultat System

ResolveWildCards() public méthode

Resolves all wild card specifications if any.

This method is called by Compiler during the compilation. However it might be convenient to call it before the compilation if any files matching the wild card mask need to be handled in special way (e.g. shortcuts created). See WildCard Files example.

ResolveWildCards should be called only after T:WixSharp.WixProject.SourceBaseDir is set. Otherwise wild card paths may not be resolved correctly.
public ResolveWildCards ( bool ignoreEmptyDirectories = false ) : Project
ignoreEmptyDirectories bool if set to true empty directories are ignored and not added to the project.
Résultat Project

Property Details

Actions public_oe property

Collection of Actionss to be performed during the installation.
public Action[] Actions
Résultat Action[]

AutoAssignedInstallDirPath public_oe property

Name (path) of the directory which was assigned T:WixSharp.Compiler.AutoGeneration.InstallDirDefaultId ID as part of XML auto-generation (see T:WixSharp.AutoGenerationOptions).
public string AutoAssignedInstallDirPath
Résultat string

BackgroundImage public_oe property

Path to the file containing the image (e.g. bmp) setup dialogs background. If not specified default image will be used.
public string BackgroundImage
Résultat string

BannerImage public_oe property

Path to the file containing the image (e.g. bmp) setup dialogs banner. If not specified default image will be used.
public string BannerImage
Résultat string

Binaries public_oe property

Collection of WiX/MSI Binary objects to be embedded into MSI database. Normally you doe not need to deal with this property as Compiler will populate it automatically.
public Binary[],WixSharp Binaries
Résultat WixSharp.Binary[]

Certificates public_oe property

Collection of Certificate to be installed.
public Certificate[],WixSharp Certificates
Résultat WixSharp.Certificate[]

ControlPanelInfo public_oe property

Set of values in 'Add/Remove Programs' of Control Panel.
public ProductInfo ControlPanelInfo
Résultat ProductInfo

CustomUI public_oe property

The custom UI definition. Use CustomUIBuilder to generate the WiX UI definition or compose WixSharp.Controls.CustomUI manually.
public CustomUI,WixSharp.Controls CustomUI
Résultat WixSharp.Controls.CustomUI

DefaultRefAssemblies public_oe property

Collection of paths to the assemblies referenced by ManagedActions.
public List DefaultRefAssemblies
Résultat List

Description public_oe property

The product full name or description.
public string Description
Résultat string

Dirs public_oe property

Collection of Dirs to be installed.
public Dir[],WixSharp Dirs
Résultat WixSharp.Dir[]

EmbeddedUI public_oe property

The Binary (assembly) implemening WiX embedded UI
public Binary,WixSharp EmbeddedUI
Résultat Binary

EmitConsistentPackageId public_oe property

Indicates whether compiler should emit consistent package Id (package code). Set EmitConsistentPackageId to 'false' (default value) if you want the WiX compilers automatically generate a new package code for each new .msi file built. Or set it to 'true' if you want Wix# to auto generate a unique consistent package code for a given combination of the product code, product version and product upgrade code.

WiX package code generation policy discourages the use of this attribute as it is a primary MSI identifier used to distinguish packages in ARP. Thus WiX tools always auto-generate the code for each build. This in turn makes it impossible to rebuild a truly identical MSIs from the same WiX code even with the same set of product code, version and upgrade code.

This very artificial limitation has severe practical impact. For example if a specific MSI file is lost it cannot be recreated even if the original source code that was used to built the lost MSI is available.

From another hand Wix# encourages using a singe GUID (Project.GUID) as a primary identifier of the product. Thus all other MSI identifiers can be derived by the compiler from the unique combination of this GUID and the product version. This also included generation of the package Id attribute controlled by the EmitConsistentPackageId.

Wix# does not changes the WiX default package code generation it just gives the opportunity to control it when required.

public bool EmitConsistentPackageId
Résultat bool

Encoding public_oe property

The Encoding to be used for MSI UI dialogs. If not specified the System.Text.Encoding.Default will be used.
public Encoding,System.Text Encoding
Résultat System.Text.Encoding

EnvironmentVariables public_oe property

Collection of EnvironmentVariables to be set during the installation.
public EnvironmentVariable[],WixSharp EnvironmentVariables
Résultat WixSharp.EnvironmentVariable[]

InstallScope public_oe property

Use this attribute if you need to specify the installation scope of this package: per-machine or per-user.
public InstallScope? InstallScope
Résultat InstallScope?

InstallerVersion public_oe property

The installer version
public int InstallerVersion
Résultat int

LaunchConditions public_oe property

Collection of the T:WixSharp.LaunchConditions associated with the setup.
public List LaunchConditions
Résultat List

LicenceFile public_oe property

Relative path to RTF file with the custom licence agreement to be displayed in the Licence dialog. If this value is not specified the default WiX licence agreement will be used.
public string LicenceFile
Résultat string

LocalizationFile public_oe property

Path to the Localization file.
public string LocalizationFile
Résultat string

MajorUpgrade public_oe property

Simplifies authoring for major upgrades, including support for preventing downgrades.
public MajorUpgrade,WixSharp MajorUpgrade
Résultat MajorUpgrade

MajorUpgradeStrategy public_oe property

Defines Major Upgrade behavior. By default it is null thus upgrade is not supported.

If you need to implement Major Upgrade define this member to appropriate MajorUpgradeStrategy instance.

public MajorUpgradeStrategy,WixSharp MajorUpgradeStrategy
Résultat MajorUpgradeStrategy

Media public_oe property

Generic T:WixSharp.WixEntity container for defining WiX Media element attributes.

These attributes describe a disk that makes up the source media for the installation.

The following is an example of defining the Package attributes. var project = new Project("My Product", new Dir(@"%ProgramFiles%\My Company\My Product", ... project.Media.AttributesDefinition = @"Id=2; CompressionLevel=mszip"; Compiler.BuildMsi(project);
public Media Media
Résultat Media

Package public_oe property

Generic T:WixSharp.WixEntity container for defining WiX Package element attributes.

These attributes are the properties about the package to be placed in the Summary Information Stream. These are visible from COM through the IStream interface, and these properties can be seen on the package in Explorer.

The following is an example of defining the Package attributes. var project = new Project("My Product", new Dir(@"%ProgramFiles%\My Company\My Product", ... project.Package.AttributesDefinition = @"AdminImage=Yes; Comments=Release Candidate; Description=Fantastic product..."; Compiler.BuildMsi(project);
public Package Package
Résultat Package

Platform public_oe property

The target platform type.
public Platform? Platform
Résultat Platform?

ProductId public_oe property

This is the value of the Id attribute of the Wix Product element. This value is unique for any given version of a product being installed.

If user doesn't specify this value Wix# engine will derive it from project Project.GUID and the product Project.Version.
public Guid? ProductId
Résultat Guid?

Properties public_oe property

Collection of WiX/MSI Property objects to be created during the installed.
public Property[] Properties
Résultat Property[]

RegValues public_oe property

Collection of RegValues to be set during the installation.
public RegValue[],WixSharp RegValues
Résultat WixSharp.RegValue[]

SqlDatabases public_oe property

Collection of WiX:SqlExtension SqlDatabase objects representing databases to be created, modifed, or interacted with during MSI execution.
public SqlDatabase[] SqlDatabases
Résultat SqlDatabase[]

UI public_oe property

Type of the MSI User Interface. This value is assigned to the UIRef WiX element during the compilation. If specified WUI.WixUI_Minimal will used.
public WUI UI
Résultat WUI

UpgradeCode public_oe property

This is the value of the UpgradeCode attribute of the Wix Product element.

Both WiX and MSI consider this element as optional even it is the only available identifier for defining relationship between different versions of the same product. Wix# in contrary enforces that value to allow any future updates of the product being installed.

If user doesn't specify this value Wix# engine will use Project.GUID as UpgradeCode.

public Guid? UpgradeCode
Résultat Guid?

Users public_oe property

Collection of Wix:UtilExtension User objects representings users 'for all kinds of things'
public User[],WixSharp Users
Résultat WixSharp.User[]

Version public_oe property

Version of the product to be installed.
public Version,System Version
Résultat System.Version