Пример #1
0
        /// <summary>
        /// Processes the Msp packages to add properties and payloads from the Msp packages.
        /// </summary>
        public void Execute()
        {
            var packagePayload = this.AuthoredPayloads[this.Facade.PackageSymbol.PayloadRef];

            var mspPackage = (WixBundleMspPackageSymbol)this.Facade.SpecificPackageSymbol;

            var sourcePath = packagePayload.SourceFile.Path;

            try
            {
                using (var db = new Database(sourcePath, OpenDatabase.ReadOnly | OpenDatabase.OpenPatchFile))
                {
                    // Read data out of the msp database...
                    using (var sumInfo = new SummaryInformation(db))
                    {
                        var patchCode = sumInfo.GetProperty(SummaryInformation.Patch.PatchCode);
                        mspPackage.PatchCode = patchCode.Substring(0, 38);
                    }

                    using (var view = db.OpenView(PatchMetadataQuery))
                    {
                        if (String.IsNullOrEmpty(this.Facade.PackageSymbol.DisplayName))
                        {
                            this.Facade.PackageSymbol.DisplayName = ProcessMspPackageCommand.GetPatchMetadataProperty(view, "DisplayName");
                        }

                        if (String.IsNullOrEmpty(this.Facade.PackageSymbol.Description))
                        {
                            this.Facade.PackageSymbol.Description = ProcessMspPackageCommand.GetPatchMetadataProperty(view, "Description");
                        }

                        mspPackage.Manufacturer = ProcessMspPackageCommand.GetPatchMetadataProperty(view, "ManufacturerName");
                    }
                }

                this.ProcessPatchXml(packagePayload, mspPackage, sourcePath);
            }
            catch (MsiException e)
            {
                this.Messaging.Write(ErrorMessages.UnableToReadPackageInformation(packagePayload.SourceLineNumbers, sourcePath, e.Message));
                return;
            }

            if (String.IsNullOrEmpty(this.Facade.PackageSymbol.CacheId))
            {
                this.Facade.PackageSymbol.CacheId = mspPackage.PatchCode;
            }
        }
        /// <summary>
        /// Processes the Msp packages to add properties and payloads from the Msp packages.
        /// </summary>
        public void Execute()
        {
            var packagePayload = this.AuthoredPayloads[this.Facade.PackageSymbol.PayloadRef];

            var mspPackage = (WixBundleMspPackageSymbol)this.Facade.SpecificPackageSymbol;

            var sourcePath = packagePayload.SourceFile.Path;

            try
            {
                // Read data out of the msp database...
                using (var sumInfo = new Dtf.SummaryInfo(sourcePath, false))
                {
                    mspPackage.PatchCode = sumInfo.RevisionNumber.Substring(0, 38);
                }

                using (var db = new Dtf.Database(sourcePath))
                {
                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.DisplayName))
                    {
                        this.Facade.PackageSymbol.DisplayName = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "DisplayName");
                    }

                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.Description))
                    {
                        this.Facade.PackageSymbol.Description = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "Description");
                    }

                    mspPackage.Manufacturer = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "ManufacturerName");
                }

                this.ProcessPatchXml(packagePayload, mspPackage, sourcePath);
            }
            catch (Dtf.InstallerException e)
            {
                this.Messaging.Write(ErrorMessages.UnableToReadPackageInformation(packagePayload.SourceLineNumbers, sourcePath, e.Message));
                return;
            }

            if (String.IsNullOrEmpty(this.Facade.PackageSymbol.CacheId))
            {
                this.Facade.PackageSymbol.CacheId = mspPackage.PatchCode;
            }
        }
Пример #3
0
        /// <summary>
        /// Processes the Msp packages to add properties and payloads from the Msp packages.
        /// </summary>
        public void Execute()
        {
            WixBundlePayloadRow packagePayload = this.AuthoredPayloads.Get(this.Facade.Package.PackagePayload);

            string sourcePath = packagePayload.FullFileName;

            try
            {
                // Read data out of the msp database...
                using (Dtf.SummaryInfo sumInfo = new Dtf.SummaryInfo(sourcePath, false))
                {
                    this.Facade.MspPackage.PatchCode = sumInfo.RevisionNumber.Substring(0, 38);
                }

                using (Dtf.Database db = new Dtf.Database(sourcePath))
                {
                    if (String.IsNullOrEmpty(this.Facade.Package.DisplayName))
                    {
                        this.Facade.Package.DisplayName = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "DisplayName");
                    }

                    if (String.IsNullOrEmpty(this.Facade.Package.Description))
                    {
                        this.Facade.Package.Description = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "Description");
                    }

                    this.Facade.MspPackage.Manufacturer = ProcessMspPackageCommand.GetPatchMetadataProperty(db, "ManufacturerName");
                }

                this.ProcessPatchXml(packagePayload, sourcePath);
            }
            catch (Dtf.InstallerException e)
            {
                Messaging.Instance.OnMessage(WixErrors.UnableToReadPackageInformation(packagePayload.SourceLineNumbers, sourcePath, e.Message));
                return;
            }

            if (String.IsNullOrEmpty(this.Facade.Package.CacheId))
            {
                this.Facade.Package.CacheId = this.Facade.MspPackage.PatchCode;
            }
        }