C# Класс 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.

Наследование: WixSharp.WixProject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Свойство Тип Описание
Preprocess void

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

Метод Описание
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.

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

Метод Описание
Preprocess ( ) : void

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

BuildMsi() публичный Метод

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.
Результат string

BuildMsiCmd() публичный Метод

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.
Результат string

BuildMsm() публичный Метод

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.
Результат string

BuildMsmCmd() публичный Метод

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.
Результат string

BuildWxs() публичный Метод

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.
Результат string

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

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.
Результат System.Guid

FindDir() публичный Метод

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.
Результат Dir

FindFile() публичный Метод

Returns all Files of the Project matching the match pattern.
public FindFile ( Predicate match ) : WixSharp.File[]
match Predicate The match pattern.
Результат WixSharp.File[]

GenerateProductGuids() публичный Метод

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
Результат void

Project() публичный Метод

Initializes a new instance of the Project class.
public Project ( ) : System
Результат System

Project() публичный Метод

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.
Результат System

ResolveWildCards() публичный Метод

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.
Результат Project

Описание свойств

Actions публичное свойство

Collection of Actionss to be performed during the installation.
public Action[] Actions
Результат Action[]

AutoAssignedInstallDirPath публичное свойство

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
Результат string

BackgroundImage публичное свойство

Path to the file containing the image (e.g. bmp) setup dialogs background. If not specified default image will be used.
public string BackgroundImage
Результат string

BannerImage публичное свойство

Path to the file containing the image (e.g. bmp) setup dialogs banner. If not specified default image will be used.
public string BannerImage
Результат string

Binaries публичное свойство

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
Результат WixSharp.Binary[]

Certificates публичное свойство

Collection of Certificate to be installed.
public Certificate[],WixSharp Certificates
Результат WixSharp.Certificate[]

ControlPanelInfo публичное свойство

Set of values in 'Add/Remove Programs' of Control Panel.
public ProductInfo ControlPanelInfo
Результат ProductInfo

CustomUI публичное свойство

The custom UI definition. Use CustomUIBuilder to generate the WiX UI definition or compose WixSharp.Controls.CustomUI manually.
public CustomUI,WixSharp.Controls CustomUI
Результат WixSharp.Controls.CustomUI

DefaultRefAssemblies публичное свойство

Collection of paths to the assemblies referenced by ManagedActions.
public List DefaultRefAssemblies
Результат List

Description публичное свойство

The product full name or description.
public string Description
Результат string

Dirs публичное свойство

Collection of Dirs to be installed.
public Dir[],WixSharp Dirs
Результат WixSharp.Dir[]

EmbeddedUI публичное свойство

The Binary (assembly) implemening WiX embedded UI
public Binary,WixSharp EmbeddedUI
Результат Binary

EmitConsistentPackageId публичное свойство

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
Результат bool

Encoding публичное свойство

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
Результат System.Text.Encoding

EnvironmentVariables публичное свойство

Collection of EnvironmentVariables to be set during the installation.
public EnvironmentVariable[],WixSharp EnvironmentVariables
Результат WixSharp.EnvironmentVariable[]

InstallScope публичное свойство

Use this attribute if you need to specify the installation scope of this package: per-machine or per-user.
public InstallScope? InstallScope
Результат InstallScope?

InstallerVersion публичное свойство

The installer version
public int InstallerVersion
Результат int

LaunchConditions публичное свойство

Collection of the T:WixSharp.LaunchConditions associated with the setup.
public List LaunchConditions
Результат List

LicenceFile публичное свойство

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
Результат string

LocalizationFile публичное свойство

Path to the Localization file.
public string LocalizationFile
Результат string

MajorUpgrade публичное свойство

Simplifies authoring for major upgrades, including support for preventing downgrades.
public MajorUpgrade,WixSharp MajorUpgrade
Результат MajorUpgrade

MajorUpgradeStrategy публичное свойство

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
Результат MajorUpgradeStrategy

Media публичное свойство

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
Результат Media

Package публичное свойство

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
Результат Package

Platform публичное свойство

The target platform type.
public Platform? Platform
Результат Platform?

ProductId публичное свойство

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
Результат Guid?

Properties публичное свойство

Collection of WiX/MSI Property objects to be created during the installed.
public Property[] Properties
Результат Property[]

RegValues публичное свойство

Collection of RegValues to be set during the installation.
public RegValue[],WixSharp RegValues
Результат WixSharp.RegValue[]

SqlDatabases публичное свойство

Collection of WiX:SqlExtension SqlDatabase objects representing databases to be created, modifed, or interacted with during MSI execution.
public SqlDatabase[] SqlDatabases
Результат SqlDatabase[]

UI публичное свойство

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
Результат WUI

UpgradeCode публичное свойство

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
Результат Guid?

Users публичное свойство

Collection of Wix:UtilExtension User objects representings users 'for all kinds of things'
public User[],WixSharp Users
Результат WixSharp.User[]

Version публичное свойство

Version of the product to be installed.
public Version,System Version
Результат System.Version