Пример #1
0
 internal void InstallThread()
 {
     try
     {
         Thread.CurrentThread.ApartmentState = ApartmentState.MTA;
         DBG.Info(DBG.Registration, "InstallThread(): recursing install assembly...");
         _helper.InstallAssemblyFromConfig(ref _regConfig);
         DBG.Info(DBG.Registration, "InstallThread(): Finished with install assembly.");
     }
     catch (Exception e)
     {
         DBG.Info(DBG.Registration, "InstallThread(): Caught failure in InstallAssembly.");
         _exception = e;
     }
 }
Пример #2
0
        // Install an assembly given configuration information.
        public void InstallAssemblyFromConfig
            (ref RegistrationConfig regConfig, Object sync)
        {
            RegistrationHelper helper;
            bool complete = false;

            try
            {
                helper = new RegistrationHelper();
                helper.InstallAssemblyFromConfig(ref regConfig);
                ContextUtil.SetComplete();
                complete = true;
            }
            finally
            {
                if (!complete)
                {
                    ContextUtil.SetAbort();
                }
            }
        }
	// Install an assembly given configuration information.
	public void InstallAssemblyFromConfig
				(ref RegistrationConfig regConfig, Object sync)
			{
				RegistrationHelper helper;
				bool complete = false;
				try
				{
					helper = new RegistrationHelper();
					helper.InstallAssemblyFromConfig(ref regConfig);
					ContextUtil.SetComplete();
					complete = true;
				}
				finally
				{
					if(!complete)
					{
						ContextUtil.SetAbort();
					}
				}
			}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="assemblyFile"></param>
        public void RegisterServicedComponents(FileInfo assemblyFile)
        {
            RegistrationConfig config = new RegistrationConfig();
            config.Application = applicationName;
            config.AssemblyFile = assemblyFile.FullName;
            config.InstallationFlags = InstallationFlags.ReportWarningsToConsole | InstallationFlags.FindOrCreateTargetApplication | InstallationFlags.ReconfigureExistingApplication;

            RegistrationHelper regHelper = new RegistrationHelper();
            regHelper.InstallAssemblyFromConfig(ref config);
        }