/// <summary>
        /// Processes the MSI packages to add properties and payloads from the MSI packages.
        /// </summary>
        public void Execute()
        {
            var packagePayload = this.PackagePayloads[this.Facade.PackageSymbol.PayloadRef];

            var msiPackage = (WixBundleMsiPackageSymbol)this.Facade.SpecificPackageSymbol;

            var sourcePath       = packagePayload.SourceFile.Path;
            var longNamesInImage = false;
            var compressed       = false;

            try
            {
                using (var db = new Database(sourcePath, OpenDatabase.ReadOnly))
                {
                    // Read data out of the msi database...
                    using (var sumInfo = new SummaryInformation(db))
                    {
                        var fileAndElevateFlags   = sumInfo.GetNumericProperty(SummaryInformation.Package.FileAndElevatedFlags);
                        var platformsAndLanguages = sumInfo.GetProperty(SummaryInformation.Package.PlatformsAndLanguages);

                        // 1 is the Word Count summary information stream bit that means
                        // the MSI uses short file names when set. We care about long file
                        // names so check when the bit is not set.

                        longNamesInImage = 0 == (fileAndElevateFlags & 1);

                        // 2 is the Word Count summary information stream bit that means
                        // files are compressed in the MSI by default when the bit is set.
                        compressed = 2 == (fileAndElevateFlags & 2);

                        // 8 is the Word Count summary information stream bit that means
                        // "Elevated privileges are not required to install this package."
                        // in MSI 4.5 and below, if this bit is 0, elevation is required.
                        var perMachine = (0 == (fileAndElevateFlags & 8));
                        var x64        = platformsAndLanguages.Contains("x64");

                        this.Facade.PackageSymbol.PerMachine = perMachine ? YesNoDefaultType.Yes : YesNoDefaultType.No;
                        this.Facade.PackageSymbol.Win64      = x64;
                    }

                    string packageName        = null;
                    string packageDescription = null;
                    string allusers           = null;
                    string fastInstall        = null;
                    string systemComponent    = null;

                    using (var view = db.OpenView(PropertySqlQuery))
                    {
                        packageName        = ProcessMsiPackageCommand.GetProperty(view, "ProductName");
                        packageDescription = ProcessMsiPackageCommand.GetProperty(view, "ARPCOMMENTS");
                        allusers           = ProcessMsiPackageCommand.GetProperty(view, "ALLUSERS");
                        fastInstall        = ProcessMsiPackageCommand.GetProperty(view, "MSIFASTINSTALL");
                        systemComponent    = ProcessMsiPackageCommand.GetProperty(view, "ARPSYSTEMCOMPONENT");

                        msiPackage.ProductCode     = ProcessMsiPackageCommand.GetProperty(view, "ProductCode");
                        msiPackage.UpgradeCode     = ProcessMsiPackageCommand.GetProperty(view, "UpgradeCode");
                        msiPackage.Manufacturer    = ProcessMsiPackageCommand.GetProperty(view, "Manufacturer");
                        msiPackage.ProductLanguage = Convert.ToInt32(ProcessMsiPackageCommand.GetProperty(view, "ProductLanguage"), CultureInfo.InvariantCulture);
                        msiPackage.ProductVersion  = ProcessMsiPackageCommand.GetProperty(view, "ProductVersion");
                    }

                    if (!this.BackendHelper.IsValidFourPartVersion(msiPackage.ProductVersion))
                    {
                        // not a proper .NET version (e.g., five fields); can we get a valid four-part version number?
                        string version      = null;
                        var    versionParts = msiPackage.ProductVersion.Split('.');
                        var    count        = versionParts.Length;
                        if (0 < count)
                        {
                            version = versionParts[0];
                            for (var i = 1; i < 4 && i < count; ++i)
                            {
                                version = String.Concat(version, ".", versionParts[i]);
                            }
                        }

                        if (!String.IsNullOrEmpty(version) && this.BackendHelper.IsValidFourPartVersion(version))
                        {
                            this.Messaging.Write(WarningMessages.VersionTruncated(this.Facade.PackageSymbol.SourceLineNumbers, msiPackage.ProductVersion, sourcePath, version));
                            msiPackage.ProductVersion = version;
                        }
                        else
                        {
                            this.Messaging.Write(ErrorMessages.InvalidProductVersion(this.Facade.PackageSymbol.SourceLineNumbers, msiPackage.ProductVersion, sourcePath));
                        }
                    }

                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.CacheId))
                    {
                        this.Facade.PackageSymbol.CacheId = String.Format("{0}v{1}", msiPackage.ProductCode, msiPackage.ProductVersion);
                    }

                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.DisplayName))
                    {
                        this.Facade.PackageSymbol.DisplayName = packageName;
                    }

                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.Description))
                    {
                        this.Facade.PackageSymbol.Description = packageDescription;
                    }

                    if (String.IsNullOrEmpty(this.Facade.PackageSymbol.Version))
                    {
                        this.Facade.PackageSymbol.Version = msiPackage.ProductVersion;
                    }

                    var payloadNames = this.GetPayloadTargetNames();

                    var msiPropertyNames = this.GetMsiPropertyNames(packagePayload.Id.Id);

                    this.SetPerMachineAppropriately(allusers, msiPackage, sourcePath);

                    // Ensure the MSI package is appropriately marked visible or not.
                    this.SetPackageVisibility(systemComponent, msiPackage, msiPropertyNames);

                    // Unless the MSI or setup code overrides the default, set MSIFASTINSTALL for best performance.
                    if (!String.IsNullOrEmpty(fastInstall))
                    {
                        this.AddMsiProperty(msiPackage, "MSIFASTINSTALL", "7");
                    }

                    this.CreateRelatedPackages(db);

                    // If feature selection is enabled, represent the Feature table in the manifest.
                    if ((msiPackage.Attributes & WixBundleMsiPackageAttributes.EnableFeatureSelection) == WixBundleMsiPackageAttributes.EnableFeatureSelection)
                    {
                        this.CreateMsiFeatures(db);
                    }

                    // Add all external cabinets as package payloads.
                    this.ImportExternalCabinetAsPayloads(db, packagePayload, payloadNames);

                    // Add all external files as package payloads and calculate the total install size as the rollup of
                    // File table's sizes.
                    this.Facade.PackageSymbol.InstallSize = this.ImportExternalFileAsPayloadsAndReturnInstallSize(db, packagePayload, longNamesInImage, compressed, payloadNames);

                    // Add all dependency providers from the MSI.
                    this.ImportDependencyProviders(db, msiPackage);
                }
            }
            catch (MsiException e)
            {
                this.Messaging.Write(ErrorMessages.UnableToReadPackageInformation(this.Facade.PackageSymbol.SourceLineNumbers, sourcePath, e.Message));
            }
        }