mirror of
https://github.com/ckaczor/WixBalExtensionExt.git
synced 2026-01-23 17:26:16 -05:00
Initial commit
This commit is contained in:
373
wixext/BalCompiler.cs
Normal file
373
wixext/BalCompiler.cs
Normal file
@@ -0,0 +1,373 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="BalCompiler.cs" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// The compiler for the Windows Installer XML Toolset Bal Extension.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using Microsoft.Tools.WindowsInstallerXml;
|
||||
|
||||
/// <summary>
|
||||
/// The compiler for the Windows Installer XML Toolset Bal Extension.
|
||||
/// </summary>
|
||||
public sealed class BalCompiler : CompilerExtension
|
||||
{
|
||||
private SourceLineNumberCollection addedConditionLineNumber;
|
||||
private XmlSchema schema;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiate a new BalCompiler.
|
||||
/// </summary>
|
||||
public BalCompiler()
|
||||
{
|
||||
this.addedConditionLineNumber = null;
|
||||
this.schema = LoadXmlSchemaHelper(Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Xsd.bal.xsd");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the schema for this extension.
|
||||
/// </summary>
|
||||
/// <value>Schema for this extension.</value>
|
||||
public override XmlSchema Schema
|
||||
{
|
||||
get { return this.schema; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes an element for the Compiler.
|
||||
/// </summary>
|
||||
/// <param name="sourceLineNumbers">Source line number for the parent element.</param>
|
||||
/// <param name="parentElement">Parent element of element to process.</param>
|
||||
/// <param name="element">Element to process.</param>
|
||||
/// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
|
||||
public override void ParseElement(SourceLineNumberCollection sourceLineNumbers, XmlElement parentElement, XmlElement element, params string[] contextValues)
|
||||
{
|
||||
switch (parentElement.LocalName)
|
||||
{
|
||||
case "Bundle":
|
||||
case "Fragment":
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "Condition":
|
||||
this.ParseConditionElement(element);
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedElement(parentElement, element);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "BootstrapperApplicationRef":
|
||||
switch (element.LocalName)
|
||||
{
|
||||
case "WixExtendedBootstrapperApplication":
|
||||
this.ParseWixExtendedBootstrapperApplicationElement(element);
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedElement(parentElement, element);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedElement(parentElement, element);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes an attribute for the Compiler.
|
||||
/// </summary>
|
||||
/// <param name="sourceLineNumbers">Source line number for the parent element.</param>
|
||||
/// <param name="parentElement">Parent element of element to process.</param>
|
||||
/// <param name="attribute">Attribute to process.</param>
|
||||
/// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
|
||||
public override void ParseAttribute(SourceLineNumberCollection sourceLineNumbers, XmlElement parentElement, XmlAttribute attribute, Dictionary<string, string> contextValues)
|
||||
{
|
||||
switch (parentElement.LocalName)
|
||||
{
|
||||
case "Variable":
|
||||
// at the time the extension attribute is parsed, the compiler might not yet have
|
||||
// parsed the Name attribute, so we need to get it directly from the parent element.
|
||||
string variableName = parentElement.GetAttribute("Name");
|
||||
if (String.IsNullOrEmpty(variableName))
|
||||
{
|
||||
this.Core.OnMessage(WixErrors.ExpectedParentWithAttribute(sourceLineNumbers, "Variable", "Overridable", "Name"));
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (attribute.LocalName)
|
||||
{
|
||||
case "Overridable":
|
||||
if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute))
|
||||
{
|
||||
Row row = this.Core.CreateRow(sourceLineNumbers, "WixStdbaOverridableVariable");
|
||||
row[0] = variableName;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedAttribute(sourceLineNumbers, attribute);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedAttribute(sourceLineNumbers, attribute);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a Condition element for Bundles.
|
||||
/// </summary>
|
||||
/// <param name="node">The element to parse.</param>
|
||||
private void ParseConditionElement(XmlNode node)
|
||||
{
|
||||
SourceLineNumberCollection sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
|
||||
string condition = CompilerCore.GetConditionInnerText(node); // condition is the inner text of the element.
|
||||
string message = null;
|
||||
|
||||
foreach (XmlAttribute attrib in node.Attributes)
|
||||
{
|
||||
if (0 == attrib.NamespaceURI.Length || attrib.NamespaceURI == this.schema.TargetNamespace)
|
||||
{
|
||||
switch (attrib.LocalName)
|
||||
{
|
||||
case "Message":
|
||||
message = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedAttribute(sourceLineNumbers, attrib);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Core.UnsupportedExtensionAttribute(sourceLineNumbers, attrib);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (XmlNode child in node.ChildNodes)
|
||||
{
|
||||
if (XmlNodeType.Element == child.NodeType)
|
||||
{
|
||||
if (child.NamespaceURI == this.schema.TargetNamespace)
|
||||
{
|
||||
this.Core.UnexpectedElement(node, child);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Core.UnsupportedExtensionElement(node, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Error check the values.
|
||||
if (String.IsNullOrEmpty(condition))
|
||||
{
|
||||
this.Core.OnMessage(WixErrors.ConditionExpected(sourceLineNumbers, node.Name));
|
||||
}
|
||||
|
||||
if (null == message)
|
||||
{
|
||||
this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "Message"));
|
||||
}
|
||||
|
||||
if (!this.Core.EncounteredError)
|
||||
{
|
||||
Row row = this.Core.CreateRow(sourceLineNumbers, "WixBalCondition");
|
||||
row[0] = condition;
|
||||
row[1] = message;
|
||||
|
||||
if (null == this.addedConditionLineNumber)
|
||||
{
|
||||
this.addedConditionLineNumber = sourceLineNumbers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a WixExtendedBootstrapperApplication element for Bundles.
|
||||
/// </summary>
|
||||
/// <param name="node">The element to parse.</param>
|
||||
private void ParseWixExtendedBootstrapperApplicationElement(XmlNode node)
|
||||
{
|
||||
SourceLineNumberCollection sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
|
||||
string launchTarget = null;
|
||||
string licenseFile = null;
|
||||
string licenseUrl = null;
|
||||
string logoFile = null;
|
||||
string logoSideFile = null;
|
||||
string themeFile = null;
|
||||
string localizationFile = null;
|
||||
YesNoType suppressOptionsUI = YesNoType.NotSet;
|
||||
YesNoType suppressDowngradeFailure = YesNoType.NotSet;
|
||||
YesNoType suppressRepair = YesNoType.NotSet;
|
||||
YesNoType showVersion = YesNoType.NotSet;
|
||||
YesNoType launchPassive = YesNoType.NotSet;
|
||||
YesNoType launchQuiet = YesNoType.NotSet;
|
||||
|
||||
foreach (XmlAttribute attrib in node.Attributes)
|
||||
{
|
||||
if (0 == attrib.NamespaceURI.Length || attrib.NamespaceURI == this.schema.TargetNamespace)
|
||||
{
|
||||
switch (attrib.LocalName)
|
||||
{
|
||||
case "LaunchTarget":
|
||||
launchTarget = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "LicenseFile":
|
||||
licenseFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "LicenseUrl":
|
||||
licenseUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib, true);
|
||||
break;
|
||||
case "LogoFile":
|
||||
logoFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "LogoSideFile":
|
||||
logoSideFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "ThemeFile":
|
||||
themeFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "LocalizationFile":
|
||||
localizationFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib, false);
|
||||
break;
|
||||
case "SuppressOptionsUI":
|
||||
suppressOptionsUI = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
case "LaunchPassive":
|
||||
launchPassive = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
case "LaunchQuiet":
|
||||
launchQuiet = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
case "SuppressDowngradeFailure":
|
||||
suppressDowngradeFailure = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
case "SuppressRepair":
|
||||
suppressRepair = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
case "ShowVersion":
|
||||
showVersion = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedAttribute(sourceLineNumbers, attrib);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Core.UnsupportedExtensionAttribute(sourceLineNumbers, attrib);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (XmlNode child in node.ChildNodes)
|
||||
{
|
||||
if (XmlNodeType.Element == child.NodeType)
|
||||
{
|
||||
if (child.NamespaceURI == this.schema.TargetNamespace)
|
||||
{
|
||||
this.Core.UnexpectedElement(node, child);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Core.UnsupportedExtensionElement(node, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(licenseFile) && null == licenseUrl)
|
||||
{
|
||||
this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "LicenseFile", "LicenseUrl", true));
|
||||
}
|
||||
|
||||
if (!this.Core.EncounteredError)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(launchTarget))
|
||||
{
|
||||
this.Core.CreateVariableRow(sourceLineNumbers, "LaunchTarget", launchTarget, "string", false, false);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(licenseFile))
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaLicenseRtf", licenseFile, false);
|
||||
}
|
||||
|
||||
if (null != licenseUrl)
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaLicenseUrl", licenseUrl, false);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(logoFile))
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaLogo", logoFile, false);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(logoSideFile))
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaLogoSide", logoSideFile, false);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(themeFile))
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaThemeXml", themeFile, false);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(localizationFile))
|
||||
{
|
||||
this.Core.CreateWixVariableRow(sourceLineNumbers, "WixExtbaThemeWxl", localizationFile, false);
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == suppressOptionsUI || YesNoType.Yes == suppressDowngradeFailure || YesNoType.Yes == suppressRepair)
|
||||
{
|
||||
Row row = this.Core.CreateRow(sourceLineNumbers, "WixExtbaOptions");
|
||||
if (YesNoType.Yes == suppressOptionsUI)
|
||||
{
|
||||
row[0] = 1;
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == suppressDowngradeFailure)
|
||||
{
|
||||
row[1] = 1;
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == suppressRepair)
|
||||
{
|
||||
row[2] = 1;
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == showVersion)
|
||||
{
|
||||
row[3] = 1;
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == launchPassive)
|
||||
{
|
||||
row[4] = 1;
|
||||
}
|
||||
|
||||
if (YesNoType.Yes == launchQuiet)
|
||||
{
|
||||
row[5] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
96
wixext/BalExtension.cs
Normal file
96
wixext/BalExtension.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="BalExtension.cs" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// The Windows Installer XML Toolset Bal extension.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
||||
{
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
/// <summary>
|
||||
/// The Windows Installer XML Toolset Bal Extension.
|
||||
/// </summary>
|
||||
public sealed class BalExtension : WixExtension
|
||||
{
|
||||
private BalCompiler compilerExtension;
|
||||
private Library library;
|
||||
private TableDefinitionCollection tableDefinitions;
|
||||
|
||||
private BalPreprocessorExtension preprocessorExtension;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional compiler extension.
|
||||
/// </summary>
|
||||
/// <value>The optional compiler extension.</value>
|
||||
public override CompilerExtension CompilerExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == this.compilerExtension)
|
||||
{
|
||||
this.compilerExtension = new BalCompiler();
|
||||
}
|
||||
|
||||
return this.compilerExtension;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional table definitions for this extension.
|
||||
/// </summary>
|
||||
/// <value>The optional table definitions for this extension.</value>
|
||||
public override TableDefinitionCollection TableDefinitions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == this.tableDefinitions)
|
||||
{
|
||||
this.tableDefinitions = LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Data.tables.xml");
|
||||
}
|
||||
|
||||
return this.tableDefinitions;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the library associated with this extension.
|
||||
/// </summary>
|
||||
/// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
|
||||
/// <returns>The loaded library.</returns>
|
||||
public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
|
||||
{
|
||||
if (null == this.library)
|
||||
{
|
||||
this.library = LoadLibraryHelper(Assembly.GetExecutingAssembly(), "Microsoft.Tools.WindowsInstallerXml.Extensions.Data.balExt.wixlib", tableDefinitions);
|
||||
}
|
||||
|
||||
return this.library;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional preprocessor extension.
|
||||
/// </summary>
|
||||
/// <value>The optional preprocessor extension.</value>
|
||||
public override PreprocessorExtension PreprocessorExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == this.preprocessorExtension)
|
||||
{
|
||||
this.preprocessorExtension = new BalPreprocessorExtension();
|
||||
}
|
||||
|
||||
return this.preprocessorExtension;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
wixext/BalPreprocessorExtension.cs
Normal file
63
wixext/BalPreprocessorExtension.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ValuePreprocessorExtension.cs" company="">
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// A WiX preprocessor extension.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
||||
{
|
||||
using System;
|
||||
using Microsoft.Tools.WindowsInstallerXml;
|
||||
|
||||
/// <summary>
|
||||
/// The preprocessor extension.
|
||||
/// </summary>
|
||||
public sealed class BalPreprocessorExtension : PreprocessorExtension
|
||||
{
|
||||
private static readonly string[] prefixes = {"bal"};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the variable prefixes for this extension.
|
||||
/// </summary>
|
||||
/// <value>The variable prefixes for this extension.</value>
|
||||
public override string[] Prefixes
|
||||
{
|
||||
get { return prefixes; }
|
||||
}
|
||||
|
||||
public override string EvaluateFunction(string prefix, string function, string[] args)
|
||||
{
|
||||
string result = null;
|
||||
|
||||
switch (prefix)
|
||||
{
|
||||
case "bal":
|
||||
switch (function)
|
||||
{
|
||||
case "Version":
|
||||
// Make sure the base version is specified
|
||||
if (args.Length == 0 || args[0].Length == 0)
|
||||
{
|
||||
throw new ArgumentException("Version template not specified");
|
||||
}
|
||||
|
||||
// Build = days since 1/1/2000; Revision = seconds since midnight / 2
|
||||
DateTime now = DateTime.Now.ToUniversalTime();
|
||||
double build = (now - new DateTime(2000, 1, 1)).TotalDays;
|
||||
double revision = now.TimeOfDay.TotalSeconds / 2;
|
||||
|
||||
result = String.Format("{0}.{1}.{2}", args[0], (int)build, (int)revision);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
wixext/Properties/AssemblyInfo.cs
Normal file
27
wixext/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="AssemblyInfo.cs" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file LICENSE.TXT
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// The assembly information for the Windows Installer XML Toolset Bootstrapper Application Layer Extension.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Microsoft.Tools.WindowsInstallerXml;
|
||||
using Microsoft.Tools.WindowsInstallerXml.Extensions;
|
||||
|
||||
[assembly: AssemblyTitle("WiX Toolset Bootstrapper Application Layer Extension")]
|
||||
[assembly: AssemblyDescription("Windows Installer XML Toolset Bootstrapper Application Layer Extension")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyDefaultWixExtension(typeof(BalExtension))]
|
||||
88
wixext/WixBalExtensionExt.csproj
Normal file
88
wixext/WixBalExtensionExt.csproj
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="WixBalExtension.csproj" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{6F9B6AFD-538B-4DF6-A1E8-6C224CBD7B05}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Tools.WindowsInstallerXml.Extensions</RootNamespace>
|
||||
<AssemblyName>WixBalExtensionExt</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="wix, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(WIX)bin\wix.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\inc\WixDistribution.cs">
|
||||
<Link>Properties\WixDistribution.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\inc\wixver.cs">
|
||||
<Link>Properties\wixver.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="BalCompiler.cs" />
|
||||
<Compile Include="BalExtension.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="BalPreprocessorExtension.cs" />
|
||||
<MsgGenSource Include="Data\messages.xml">
|
||||
<ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName>
|
||||
</MsgGenSource>
|
||||
<EmbeddedResource Include="Data\tables.xml">
|
||||
<LogicalName>$(RootNamespace).Data.tables.xml</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Xsd\bal.xsd">
|
||||
<LogicalName>$(RootNamespace).Xsd.bal.xsd</LogicalName>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<XsdGenSource Include="Xsd\bal.xsd">
|
||||
<CommonNamespace>Microsoft.Tools.WindowsInstallerXml.Serialize</CommonNamespace>
|
||||
<Namespace>Microsoft.Tools.WindowsInstallerXml.Extensions.Serialize.Bal</Namespace>
|
||||
</XsdGenSource>
|
||||
<EmbeddedResource Include="..\build\balExt.wixlib">
|
||||
<Link>Data\balExt.wixlib</Link>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
154
wixext/Xsd/bal.xsd
Normal file
154
wixext/Xsd/bal.xsd
Normal file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="bal.xsd" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xse="http://schemas.microsoft.com/wix/2005/XmlSchemaExtension"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
targetNamespace="http://schemas.microsoft.com/wix/BalExtension"
|
||||
xmlns="http://schemas.microsoft.com/wix/BalExtension">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
The source code schema for the Windows Installer XML Toolset Burn User Experience Extension.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
|
||||
<xs:import namespace="http://schemas.microsoft.com/wix/2006/wi" />
|
||||
|
||||
<xs:element name="Condition">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Conditions for a bundle. The condition is specified in the inner text of the element.
|
||||
</xs:documentation>
|
||||
<xs:appinfo>
|
||||
<xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Bundle" />
|
||||
<xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Fragment" />
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
The condition that must evaluate to true for the installation to continue.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:attribute name="Message" type="xs:string" use="required">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Set the value to the text to display when the condition fails and the installation must be terminated.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="WixExtendedBootstrapperApplication">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Configures WixExtendedBootstrapperApplication for a Bundle.
|
||||
</xs:documentation>
|
||||
<xs:appinfo>
|
||||
<xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="BootstrapperApplicationRef" />
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:attribute name="LaunchTarget" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set, the success page will show a Launch button the user can use to launch the application being installed. The string value can be formatted using Burn variables enclosed in brackets, to refer to installation directories and so forth.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LicenseFile" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Source file of the RTF license file. Cannot be used simultaneously with LicenseUrl.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LicenseUrl" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>URL target of the license link. Cannot be used simultaneously with LicenseFile. This attribute can be empty to hide the license link completely.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LogoFile" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Source file of the logo graphic.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LogoSideFile" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Source file of the side logo graphic.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ThemeFile" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Source file of the theme XML.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LocalizationFile" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Source file of the theme localization .wxl file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="SuppressOptionsUI" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", the Options button will not be shown and the user will not be able to choose an installation directory.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LaunchPassive" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", the LaunchTarget option will be executed automatically at the end of a passive install.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LaunchQuiet" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", the LaunchTarget option will be executed automatically at the end of a quiet install.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="SuppressDowngradeFailure" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", attempting to installer a downgraded version of a bundle will be treated as a successful do-nothing operation.
|
||||
The default behavior (or when explicitly set to "no") is to treat downgrade attempts as failures. </xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="SuppressRepair" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", the Repair button will not be shown in the maintenance-mode UI.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ShowVersion" type="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>If set to "yes", the application version will be displayed on the UI.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:attribute name="Overridable">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
When set to "yes", lets the user override the variable's default value by specifying another value on the command line,
|
||||
in the form Variable=Value. Otherwise, WixStdBA won't overwrite the default value and will log
|
||||
"Ignoring attempt to set non-overridable variable: 'BAR'."
|
||||
</xs:documentation>
|
||||
<xs:appinfo>
|
||||
<xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Variable" />
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
|
||||
<xs:simpleType name="YesNoType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:restriction base="xs:NMTOKEN">
|
||||
<xs:enumeration value="no"/>
|
||||
<xs:enumeration value="yes"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
16
wixext/data/messages.xml
Normal file
16
wixext/data/messages.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="messages.xml" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<!--
|
||||
The messages for the Windows Installer XML Toolset Bal Extension.
|
||||
-->
|
||||
<Messages Namespace="Microsoft.Tools.WindowsInstallerXml.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages">
|
||||
<Class Name="BalErrors" ContainerName="BalErrorEventArgs" BaseContainerName="WixErrorEventArgs">
|
||||
</Class>
|
||||
</Messages>
|
||||
40
wixext/data/tables.xml
Normal file
40
wixext/data/tables.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="tables.xml" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<!--
|
||||
The table definitions for the Windows Installer XML Toolset Bal Extension.
|
||||
-->
|
||||
<tableDefinitions xmlns="http://schemas.microsoft.com/wix/2006/tables">
|
||||
<tableDefinition name="WixBalCondition" bootstrapperApplicationData="yes">
|
||||
<columnDefinition name="Condition" type="string" length="255" primaryKey="yes" localizable="yes"
|
||||
category="condition" description="Expression which must evaluate to TRUE in order for install to commence."/>
|
||||
<columnDefinition name="Message" type="localized" length="255" escapeIdtCharacters="yes"
|
||||
category="formatted" description="Localizable text to display when condition fails and install must abort."/>
|
||||
</tableDefinition>
|
||||
|
||||
<tableDefinition name="WixExtbaOptions" bootstrapperApplicationData="yes">
|
||||
<columnDefinition name="SuppressOptionsUI" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, don't show Options button during install."/>
|
||||
<columnDefinition name="SuppressDowngradeFailure" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, attempts to downgrade are treated as a successful no-op."/>
|
||||
<columnDefinition name="SuppressRepair" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, don't show Repair button during maintenance."/>
|
||||
<columnDefinition name="ShowVersion" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, show the version number on the UI."/>
|
||||
<columnDefinition name="LaunchPassive" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, execute LaunchTarget automatically during passive install."/>
|
||||
<columnDefinition name="LaunchQuiet" type="number" length="2" nullable="yes"
|
||||
maxValue="1" description="If 1, execute LaunchTarget automatically during quiet install."/>
|
||||
</tableDefinition>
|
||||
|
||||
<tableDefinition name="WixStdbaOverridableVariable" bootstrapperApplicationData="yes">
|
||||
<columnDefinition name="Name" type="string" length="255" primaryKey="yes"
|
||||
category="identifier" description="Variable name user can override."/>
|
||||
</tableDefinition>
|
||||
</tableDefinitions>
|
||||
Reference in New Issue
Block a user