Exemple #1
0
        private void RegisterPackages(Action action, string fullPath)
        {
            using (RemoteDomain domain = CreateRemoteDomain(fullPath))
            {
                // This needs to be done in a remote AppDomain because it loads the assembly.

                if (domain.CanRegisterPackages(fullPath))
                {
                    if (!IsAssociatedFile())
                    {
                        Artifact.SetMetadata(Constants.Catalogue.Artifact.RegisterPackages, true);
                    }

                    // Only register if required.

                    if (action == Action.Assemble)
                    {
                        string log;
                        if ((log = domain.RegisterPackages(fullPath)) != null)
                        {
                            LogMessage(log);
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void InstallAssembly(Action action, string fullPath)
        {
            using (RemoteDomain domain = CreateRemoteDomain(fullPath))
            {
                if (domain.IsAssembly(fullPath))
                {
                    Artifact.SetMetadata(Constants.Catalogue.Artifact.Assembly, true);

                    // Check whether to do this.

                    if (action == Action.Assemble && ShouldInstallInGac())
                    {
                        // Install it.

                        if (m_gac.InstallAssemblyFile(fullPath))
                        {
                            LogMessage(Messages.InstalledToGac, fullPath);
                        }
                        else
                        {
                            throw new ApplicationException("The assembly '" + fullPath + "' cannot be installed in the gac.");
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void CreateWorker()
        {
            string wixPath = StaticEnvironment.GetFilePath(Constants.Product.Sdk, Constants.Folder.Bin, "wix.dll", "LinkMe.Framework.Sdk");

            // If not found then use this assembly's location.

            if (wixPath == null)
            {
                wixPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            }

            m_domain    = new RemoteDomain(Path.GetDirectoryName(wixPath));
            m_wixWorker = m_domain.CreateWixWorker();

            // Use the obj sub-folder of the project path as the build folder.

            string buildFolder = Path.Combine(Path.GetDirectoryName(m_options.ProjectFullPath), Constants.Folder.Obj);
            string msmFile     = m_options.MergeModuleFile;

            if (Path.GetExtension(msmFile) == ".msm")
            {
                msmFile = msmFile.Substring(0, msmFile.Length - 4) + (m_isWin64 ? ".x64" : ".x86") + ".msm";
            }
            else
            {
                msmFile += (m_isWin64 ? ".x64" : ".x86");
            }

            System.Version version      = m_options.Version == null ? null : (System.Version)m_options.Version.Clone();
            string         manufacturer = m_options.Manufacturer;

            m_wixWorker.Initialise(m_isWin64, buildFolder, msmFile, m_options.Guid, version, manufacturer);
        }
        public static BuildDomain CreateInstance(FrameworkVersions toolsVersion, string[] properties)
        {
            AppDomainSetup setup = new AppDomainSetup();

            setup.ApplicationBase          = AppDomain.CurrentDomain.BaseDirectory;
            setup.ApplicationName          = String.Format("CSBuildEngine.{0}", toolsVersion);
            setup.ConfigurationFile        = GetConfigPath(toolsVersion);
            setup.DisallowBindingRedirects = false;

            Log.Verbose("Constructing AppDomain for build: {0}, version = {1}", setup.ApplicationName, toolsVersion);
            AppDomain    domain   = AppDomain.CreateDomain(setup.ApplicationName, AppDomain.CurrentDomain.Evidence, setup);
            RemoteDomain instance = (RemoteDomain)domain.CreateInstanceAndUnwrap(typeof(RemoteDomain).Assembly.FullName, typeof(RemoteDomain).FullName);

            instance.Framework  = toolsVersion;
            instance.Properties = properties;
            instance.SetLog(Log.TextWriter, Log.ConsoleLevel);

            return(new BuildDomain(domain, instance, toolsVersion));
        }
Exemple #5
0
        private void UnregisterPackages(Action action, string fullPath)
        {
            using (RemoteDomain domain = CreateRemoteDomain(fullPath))
            {
                // This needs to be done in a remote AppDomain because it loads the assembly.

                if (domain.CanRegisterPackages(fullPath))
                {
                    // Only unregister if required.

                    if (action == Action.Assemble)
                    {
                        string log;
                        if ((log = domain.UnregisterPackages(fullPath)) != null)
                        {
                            LogMessage(log);
                        }
                    }
                }
            }
        }
Exemple #6
0
        private bool IsInternal(string routingDomainStringRepr)
        {
            bool flag;
            AcceptedDomainCollection acceptedDomainCollection = this.getAcceptedDomainCollectionDelegate(this.organizationId, out flag);

            Microsoft.Exchange.Data.Transport.AcceptedDomain acceptedDomain = (acceptedDomainCollection != null) ? acceptedDomainCollection.Find(routingDomainStringRepr) : null;
            if (acceptedDomain != null && acceptedDomain.IsInCorporation)
            {
                bool flag2 = true;
                if (!flag)
                {
                    flag2 = (this.organizationId.Equals(OrganizationId.ForestWideOrgId) ? (acceptedDomain.TenantId == Guid.Empty) : (this.organizationId.ConfigurationUnit.ObjectGuid == acceptedDomain.TenantId));
                }
                if (flag2)
                {
                    return(true);
                }
            }
            RemoteDomainCollection remoteDomainCollection = this.getRemoteDomainCollectionDelegate(this.organizationId);
            RemoteDomain           remoteDomain           = (remoteDomainCollection != null) ? remoteDomainCollection.Find(routingDomainStringRepr) : null;

            return(remoteDomain != null && remoteDomain.IsInternal);
        }
 private BuildDomain(AppDomain domain, RemoteDomain instance, FrameworkVersions toolsVersion)
 {
     _domain = domain;
     _instance = instance;
     _framework = toolsVersion;
 }
 private BuildDomain(AppDomain domain, RemoteDomain instance, FrameworkVersions toolsVersion)
 {
     _domain    = domain;
     _instance  = instance;
     _framework = toolsVersion;
 }