示例#1
0
 public ODBCDriverTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ODBCDriver, sourceLineNumber, id)
 {
 }
 public WixDeltaPatchSymbolPathsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixDeltaPatchSymbolPaths, sourceLineNumber, id)
 {
 }
示例#3
0
 public ModuleInstallUISequenceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ModuleInstallUISequence, sourceLineNumber, id)
 {
 }
示例#4
0
 public PropertiesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Properties, sourceLineNumber, id)
 {
 }
示例#5
0
 /// <summary>
 /// Creates a WixBundleMsiPackageRow row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
 public WixBundleMsiPackageRow(SourceLineNumber sourceLineNumbers, Table table) :
     base(sourceLineNumbers, table)
 {
 }
示例#6
0
 public WixBundleMsiFeatureTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixBundleMsiFeature, sourceLineNumber, id)
 {
 }
        /// <summary>
        /// Parses a Tag element for Software Id Tag registration under a Bundle element.
        /// </summary>
        /// <param name="node">The element to parse.</param>
        private void ParseBundleTagElement(XElement node)
        {
            SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
            string           name     = null;
            string           regid    = null;
            YesNoType        licensed = YesNoType.NotSet;
            string           type     = null;

            foreach (XAttribute attrib in node.Attributes())
            {
                if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
                {
                    switch (attrib.Name.LocalName)
                    {
                    case "Name":
                        name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
                        break;

                    case "Regid":
                        regid = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
                        break;

                    case "Licensed":
                        licensed = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
                        break;

                    case "Type":
                        type = this.ParseTagTypeAttribute(sourceLineNumbers, node, attrib);
                        break;

                    default:
                        this.Core.UnexpectedAttribute(node, attrib);
                        break;
                    }
                }
                else
                {
                    this.Core.ParseExtensionAttribute(node, attrib);
                }
            }

            this.Core.ParseForExtensionElements(node);

            if (String.IsNullOrEmpty(name))
            {
                XAttribute productNameAttribute = node.Parent.Attribute("Name");
                if (null != productNameAttribute)
                {
                    name = productNameAttribute.Value;
                }
                else
                {
                    this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name"));
                }
            }

            if (!String.IsNullOrEmpty(name) && !this.Core.IsValidLongFilename(name, false))
            {
                this.Core.OnMessage(TagErrors.IllegalName(sourceLineNumbers, node.Parent.Name.LocalName, name));
            }

            if (String.IsNullOrEmpty(regid))
            {
                this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Regid"));
            }

            if (!this.Core.EncounteredError)
            {
                string fileName = String.Concat(regid, " ", name, ".swidtag");

                Row tagRow = this.Core.CreateRow(sourceLineNumbers, "WixBundleTag");
                tagRow[0] = fileName;
                tagRow[1] = regid;
                tagRow[2] = name;
                if (YesNoType.Yes == licensed)
                {
                    tagRow[3] = 1;
                }
                // field 4 is the TagXml set by the binder.
                tagRow[5] = type;
            }
        }
 public WixComplexReferenceSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixComplexReference, sourceLineNumber, id)
 {
 }
示例#9
0
 /// <summary>
 /// Creates a PayloadRow row that does not belong to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="tableDef">TableDefinition this Media row belongs to and should get its column definitions from.</param>
 public WixBundlePayloadRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) :
     base(sourceLineNumbers, tableDef)
 {
 }
示例#10
0
 public MsiEmbeddedChainerTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.MsiEmbeddedChainer, sourceLineNumber, id)
 {
 }
示例#11
0
 public WixFileSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixFileSearch, sourceLineNumber, id)
 {
 }
示例#12
0
文件: WixFileRow.cs 项目: 2dave/Data
 /// <summary>
 /// Creates a WixFile row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
 public WixFileRow(SourceLineNumber sourceLineNumbers, Table table) :
     base(sourceLineNumbers, table)
 {
 }
示例#13
0
 public PatchSequenceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.PatchSequence, sourceLineNumber, id)
 {
 }
 public IniLocatorSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.IniLocator, sourceLineNumber, id)
 {
 }
        /// <summary>
        /// Parses the WixLocalization element.
        /// </summary>
        /// <param name="messaging"></param>
        /// <param name="node">Element to parse.</param>
        private static Localization ParseWixLocalizationElement(IMessaging messaging, XElement node)
        {
            int              codepage          = -1;
            string           culture           = null;
            SourceLineNumber sourceLineNumbers = SourceLineNumber.CreateFromXObject(node);

            foreach (XAttribute attrib in node.Attributes())
            {
                if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || LocalizationParser.WxlNamespace == attrib.Name.Namespace)
                {
                    switch (attrib.Name.LocalName)
                    {
                    case "Codepage":
                        codepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers);
                        break;

                    case "Culture":
                        culture = attrib.Value;
                        break;

                    case "Language":
                        // do nothing; @Language is used for locutil which can't convert Culture to lcid
                        break;

                    default:
                        Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib);
                        break;
                    }
                }
                else
                {
                    Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib);
                }
            }

            Dictionary <string, BindVariable>     variables         = new Dictionary <string, BindVariable>();
            Dictionary <string, LocalizedControl> localizedControls = new Dictionary <string, LocalizedControl>();

            foreach (XElement child in node.Elements())
            {
                if (LocalizationParser.WxlNamespace == child.Name.Namespace)
                {
                    switch (child.Name.LocalName)
                    {
                    case "String":
                        LocalizationParser.ParseString(messaging, child, variables);
                        break;

                    case "UI":
                        LocalizationParser.ParseUI(messaging, child, localizedControls);
                        break;

                    default:
                        messaging.Write(ErrorMessages.UnexpectedElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString()));
                        break;
                    }
                }
                else
                {
                    messaging.Write(ErrorMessages.UnsupportedExtensionElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString()));
                }
            }

            return(messaging.EncounteredError ? null : new Localization(codepage, culture, variables, localizedControls));
        }
示例#16
0
 /// <summary>
 /// Creates a PayloadRow row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this Media row belongs to and should get its column definitions from.</param>
 public WixBundlePayloadRow(SourceLineNumber sourceLineNumbers, Table table) :
     base(sourceLineNumbers, table)
 {
 }
示例#17
0
 public IIsWebErrorTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisTupleDefinitions.IIsWebError, sourceLineNumber, id)
 {
 }
示例#18
0
 public MsiLockPermissionsExTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.MsiLockPermissionsEx, sourceLineNumber, id)
 {
 }
        /// <summary>
        /// Parses a Tag element for Software Id Tag registration under a Product element.
        /// </summary>
        /// <param name="node">The element to parse.</param>
        private void ParseProductTagElement(XElement node)
        {
            SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
            string           name     = null;
            string           regid    = null;
            string           feature  = "WixSwidTag";
            YesNoType        licensed = YesNoType.NotSet;
            string           type     = null;

            foreach (XAttribute attrib in node.Attributes())
            {
                if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
                {
                    switch (attrib.Name.LocalName)
                    {
                    case "Name":
                        name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false);
                        break;

                    case "Regid":
                        regid = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
                        break;

                    case "Feature":
                        feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
                        break;

                    case "Licensed":
                        licensed = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
                        break;

                    case "Type":
                        type = this.ParseTagTypeAttribute(sourceLineNumbers, node, attrib);
                        break;

                    default:
                        this.Core.UnexpectedAttribute(node, attrib);
                        break;
                    }
                }
                else
                {
                    this.Core.ParseExtensionAttribute(node, attrib);
                }
            }

            this.Core.ParseForExtensionElements(node);

            if (String.IsNullOrEmpty(name))
            {
                XAttribute productNameAttribute = node.Parent.Attribute("Name");
                if (null != productNameAttribute)
                {
                    name = productNameAttribute.Value;
                }
                else
                {
                    this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name"));
                }
            }

            if (!String.IsNullOrEmpty(name) && !this.Core.IsValidLongFilename(name, false))
            {
                this.Core.OnMessage(TagErrors.IllegalName(sourceLineNumbers, node.Parent.Name.LocalName, name));
            }

            if (String.IsNullOrEmpty(regid))
            {
                this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Regid"));
            }

            if (!this.Core.EncounteredError)
            {
                string     directoryId = "WixTagRegidFolder";
                Identifier fileId      = this.Core.CreateIdentifier("tag", regid, ".product.tag");
                string     fileName    = String.Concat(regid, " ", name, ".swidtag");
                string     shortName   = this.Core.CreateShortName(fileName, false, false);

                this.Core.CreateSimpleReference(sourceLineNumbers, "Directory", directoryId);

                ComponentRow componentRow = (ComponentRow)this.Core.CreateRow(sourceLineNumbers, "Component", fileId);
                componentRow.Guid        = "*";
                componentRow[3]          = 0;
                componentRow.Directory   = directoryId;
                componentRow.IsLocalOnly = true;
                componentRow.KeyPath     = fileId.Id;

                this.Core.CreateSimpleReference(sourceLineNumbers, "Feature", feature);
                this.Core.CreateComplexReference(sourceLineNumbers, ComplexReferenceParentType.Feature, feature, null, ComplexReferenceChildType.Component, fileId.Id, true);

                FileRow fileRow = (FileRow)this.Core.CreateRow(sourceLineNumbers, "File", fileId);
                fileRow.Component = fileId.Id;
                fileRow.FileName  = String.Concat(shortName, "|", fileName);

                WixFileRow wixFileRow = (WixFileRow)this.Core.CreateRow(sourceLineNumbers, "WixFile");
                wixFileRow.Directory  = directoryId;
                wixFileRow.File       = fileId.Id;
                wixFileRow.DiskId     = 1;
                wixFileRow.Attributes = 1;
                wixFileRow.Source     = String.Concat("%TEMP%\\", fileName);

                this.Core.EnsureTable(sourceLineNumbers, "SoftwareIdentificationTag");
                Row row = this.Core.CreateRow(sourceLineNumbers, "WixProductTag");
                row[0] = fileId.Id;
                row[1] = regid;
                row[2] = name;
                if (YesNoType.Yes == licensed)
                {
                    row[3] = 1;
                }
                row[4] = type;

                this.Core.CreateSimpleReference(sourceLineNumbers, "File", fileId.Id);
            }
        }
示例#20
0
 public ModuleSubstitutionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ModuleSubstitution, sourceLineNumber, id)
 {
 }
示例#21
0
 public WixDependencySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependency, sourceLineNumber, id)
 {
 }
示例#22
0
 /// <summary>
 /// Creates a WixDeltaPatchFile row that does not belong to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="tableDef">TableDefinition this Media row belongs to and should get its column definitions from.</param>
 public WixDeltaPatchFileRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) :
     base(sourceLineNumbers, tableDef)
 {
 }
示例#23
0
 /// <summary>
 /// Creates a WixBundleMsiPackage row that does not belong to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="tableDef">TableDefinition this row belongs to and should get its column definitions from.</param>
 public WixBundleMsiPackageRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) :
     base(sourceLineNumbers, tableDef)
 {
 }
示例#24
0
 /// <summary>
 /// Creates a WixDeltaPatchFile row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this File row belongs to and should get its column definitions from.</param>
 public WixDeltaPatchFileRow(SourceLineNumber sourceLineNumbers, Table table) :
     base(sourceLineNumbers, table)
 {
 }
 public ListViewSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ListView, sourceLineNumber, id)
 {
 }
示例#26
0
 public WixBundleUpdateSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleUpdate, sourceLineNumber, id)
 {
 }
示例#27
0
 public WixRegistrySearchTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixRegistrySearch, sourceLineNumber, id)
 {
 }
        /// <summary>
        /// Parse a localized control.
        /// </summary>
        /// <param name="messaging"></param>
        /// <param name="node">Element to parse.</param>
        /// <param name="localizedControls">Dictionary of localized controls.</param>
        private static void ParseUI(IMessaging messaging, XElement node, IDictionary <string, LocalizedControl> localizedControls)
        {
            string dialog            = null;
            string control           = null;
            var    x                 = CompilerConstants.IntegerNotSet;
            var    y                 = CompilerConstants.IntegerNotSet;
            var    width             = CompilerConstants.IntegerNotSet;
            var    height            = CompilerConstants.IntegerNotSet;
            var    sourceLineNumbers = SourceLineNumber.CreateFromXObject(node);
            var    rightToLeft       = false;
            var    rightAligned      = false;
            var    leftScroll        = false;

            foreach (XAttribute attrib in node.Attributes())
            {
                if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || LocalizationParser.WxlNamespace == attrib.Name.Namespace)
                {
                    switch (attrib.Name.LocalName)
                    {
                    case "Dialog":
                        dialog = Common.GetAttributeIdentifierValue(messaging, sourceLineNumbers, attrib);
                        break;

                    case "Control":
                        control = Common.GetAttributeIdentifierValue(messaging, sourceLineNumbers, attrib);
                        break;

                    case "X":
                        x = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, Int16.MaxValue);
                        break;

                    case "Y":
                        y = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, Int16.MaxValue);
                        break;

                    case "Width":
                        width = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, Int16.MaxValue);
                        break;

                    case "Height":
                        height = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, Int16.MaxValue);
                        break;

                    case "RightToLeft":
                        rightToLeft = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib);
                        //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib))
                        //{
                        //    attribs |= MsiInterop.MsidbControlAttributesRTLRO;
                        //}
                        break;

                    case "RightAligned":
                        rightAligned = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib);
                        //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib))
                        //{
                        //    attribs |= MsiInterop.MsidbControlAttributesRightAligned;
                        //}
                        break;

                    case "LeftScroll":
                        leftScroll = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib);
                        //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib))
                        //{
                        //    attribs |= MsiInterop.MsidbControlAttributesLeftScroll;
                        //}
                        break;

                    default:
                        Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib);
                        break;
                    }
                }
                else
                {
                    Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib);
                }
            }

            var text = Common.GetInnerText(node);

            if (String.IsNullOrEmpty(control) && (rightToLeft || rightAligned || leftScroll))
            {
                if (rightToLeft)
                {
                    messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightToLeft", "Control"));
                }

                if (rightAligned)
                {
                    messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightAligned", "Control"));
                }

                if (leftScroll)
                {
                    messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "LeftScroll", "Control"));
                }
            }

            if (String.IsNullOrEmpty(control) && String.IsNullOrEmpty(dialog))
            {
                messaging.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.ToString(), "Dialog", "Control"));
            }

            if (!messaging.EncounteredError)
            {
                var localizedControl = new LocalizedControl(dialog, control, x, y, width, height, rightToLeft, rightAligned, leftScroll, text);
                var key = localizedControl.GetKey();
                if (localizedControls.ContainsKey(key))
                {
                    if (String.IsNullOrEmpty(localizedControl.Control))
                    {
                        messaging.Write(ErrorMessages.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog));
                    }
                    else
                    {
                        messaging.Write(ErrorMessages.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog, localizedControl.Control));
                    }
                }
                else
                {
                    localizedControls.Add(key, localizedControl);
                }
            }
        }
示例#29
0
 public WixBundlePackageCommandLineSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundlePackageCommandLine, sourceLineNumber, id)
 {
 }
 public static Message BAContainerPayloadCollision(SourceLineNumber sourceLineNumbers, string payloadId, string payloadName)
 {
     return(Message(sourceLineNumbers, Ids.BAContainerPayloadCollision, "The Payload '{0}' has a duplicate Name '{1}' in the BA container. When extracting the container at runtime, the file will get overwritten.", payloadId, payloadName));
 }