Exemple #1
0
        private void ResolveBundleInstallScope(IntermediateSection section, WixBundleSymbol bundleSymbol, IEnumerable <PackageFacade> facades)
        {
            var dependencySymbolsById = section.Symbols.OfType <WixDependencyProviderSymbol>().ToDictionary(t => t.Id.Id);

            foreach (var facade in facades)
            {
                if (bundleSymbol.PerMachine && YesNoDefaultType.No == facade.PackageSymbol.PerMachine)
                {
                    this.Messaging.Write(VerboseMessages.SwitchingToPerUserPackage(facade.PackageSymbol.SourceLineNumbers, facade.PackageId));

                    bundleSymbol.Attributes &= ~WixBundleAttributes.PerMachine;
                    break;
                }
            }

            foreach (var facade in facades)
            {
                // Update package scope from bundle scope if default.
                if (YesNoDefaultType.Default == facade.PackageSymbol.PerMachine)
                {
                    facade.PackageSymbol.PerMachine = bundleSymbol.PerMachine ? YesNoDefaultType.Yes : YesNoDefaultType.No;
                }

                // We will only register packages in the same scope as the bundle. Warn if any packages with providers
                // are in a different scope and not permanent (permanents typically don't need a ref-count).
                if (!bundleSymbol.PerMachine &&
                    YesNoDefaultType.Yes == facade.PackageSymbol.PerMachine &&
                    !facade.PackageSymbol.Permanent &&
                    dependencySymbolsById.ContainsKey(facade.PackageId))
                {
                    this.Messaging.Write(WarningMessages.NoPerMachineDependencies(facade.PackageSymbol.SourceLineNumbers, facade.PackageId));
                }
            }
        }