protected ManageForwardSyncService() { base.Account = ServiceAccount.LocalSystem; base.StartMode = ServiceStartMode.Automatic; base.DisplayName = Strings.ForwardSyncServiceDisplayName; base.Description = Strings.ForwardSyncServiceDescription; InstallContext installContext = new InstallContext(); installContext.Parameters["logtoconsole"] = "false"; installContext.Parameters["assemblypath"] = Path.Combine(ConfigurationContext.Setup.BinPath, "Microsoft.Exchange.Management.ForwardSync.exe"); base.FirstFailureActionType = ServiceActionType.Restart; base.FirstFailureActionDelay = 5000U; base.SecondFailureActionType = ServiceActionType.Restart; base.SecondFailureActionDelay = 5000U; base.AllOtherFailuresActionType = ServiceActionType.Restart; base.AllOtherFailuresActionDelay = 5000U; base.ServiceInstallContext = installContext; base.ServicesDependedOn = new string[] { ManagedServiceName.ActiveDirectoryTopologyService }; foreach (object obj in base.ServiceInstaller.Installers) { EventLogInstaller eventLogInstaller = obj as EventLogInstaller; if (eventLogInstaller != null) { eventLogInstaller.Source = "MSExchangeForwardSync"; eventLogInstaller.Log = "ForwardSync"; } } }
public SoftwareUpdaterEventSourceInstaller() { EventLogInstaller eventLogInstaller = new EventLogInstaller(); eventLogInstaller.Source = EventSource; Installers.Add(eventLogInstaller); }
public ProjectInstaller() { InitializeComponent(); var appSettings = System.Configuration.ConfigurationManager.AppSettings; //setting serviceName this.serviceInstaller1.ServiceName = appSettings["ServiceName"]; this.serviceInstaller1.DisplayName = appSettings["ServiceDisplayName"]; this.serviceInstaller1.Description = appSettings["ServiceDesc"]; string eventSourceName = appSettings["EventSourceName"]; string logName = appSettings["EventLogName"]; EventLogInstaller EventLogInstall = null; foreach (Installer I in this.serviceInstaller1.Installers) { EventLogInstall = I as EventLogInstaller; if (EventLogInstall != null) { EventLogInstall.Log = logName; EventLogInstall.Source = eventSourceName; //EventLogInstall.UninstallAction = UninstallAction.NoAction; EventLogInstall.UninstallAction = UninstallAction.Remove; break; } } }
public SampleEventLogInstaller() { // Create an instance of an EventLogInstaller. myEventLogInstaller = new EventLogInstaller(); // Set the source name of the event log. myEventLogInstaller.Source = "ApplicationEventSource"; // Set the event log into which the source writes entries. //myEventLogInstaller.Log = "MyCustomLog"; myEventLogInstaller.Log = "myNewLog"; // Set the resource file for the event log. // The message strings are defined in EventLogMsgs.mc; the message // identifiers used in the application must match those defined in the // corresponding message resource file. The messages must be built // into a Win32 resource library and copied to the target path on the // system. myEventLogInstaller.CategoryResourceFile = Environment.SystemDirectory + "\\eventlogmsgs.dll"; myEventLogInstaller.CategoryCount = 3; myEventLogInstaller.MessageResourceFile = Environment.SystemDirectory + "\\eventlogmsgs.dll"; myEventLogInstaller.ParameterResourceFile = Environment.SystemDirectory + "\\eventlogmsgs.dll"; // Add myEventLogInstaller to the installer collection. Installers.Add(myEventLogInstaller); }
public SocketServiceInstaller() { var processInstaller = new ServiceProcessInstaller(); var serviceInstaller = new ServiceInstaller(); ////Create Instance of EventLogInstaller var myEventLogInstaller = new EventLogInstaller { Source = "Blazing Sockets Messaging Server", Log = "Application" }; //// Set the Source of Event Log, to be created. //// Set the Log that source is created in //set the process privileges processInstaller.Account = ServiceAccount.User; serviceInstaller.DisplayName = "Blazing Sockets Messaging Server"; serviceInstaller.StartType = ServiceStartMode.Manual; //must be the same as what was set in Program's constructor serviceInstaller.ServiceName = "Blazing Sockets Messaging Server"; Installers.Add(processInstaller); Installers.Add(serviceInstaller); Installers.Add(myEventLogInstaller); }
static void Main() { // <Snippet1> EventLogInstaller myEventLogInstaller = new EventLogInstaller(); // Create a source for the specified event log, on local computer. EventLog.CreateEventSource("MyEventSource", "MyEventLog", "."); // Create an event log instance and associate it with the log . EventLog myEventLog = new EventLog("MyEventLog", ".", "MyEventSource"); // Copy the properties that are required at install time from // the event log component to the installer. myEventLogInstaller.CopyFromComponent(myEventLog); // </Snippet1> Console.WriteLine("The properties of the event log component : "); Console.WriteLine(myEventLogInstaller.Log); Console.WriteLine(myEventLogInstaller.Source); // <Snippet2> ServiceInstaller myServiceInstaller = new ServiceInstaller(); // Check whether 'ServiceInstaller' object can handle the same // kind of installation as 'EventLogInstaller' object. if (myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller)) { Console.WriteLine("'ServiceInstaller' can handle the same kind" + " of installation as EventLogInstaller"); } else { Console.WriteLine("'ServiceInstaller' can't handle the same" + " kind of installation as 'EventLogInstaller'"); } // </Snippet2> EventLog.Delete("MyEventLog", "."); }
/// <summary> /// Initializes a new instance of the <see cref="TaskManagerInstaller"/> class. /// </summary> public TaskManagerInstaller() { this.InitializeComponent(); this._serviceInstaller = new ServiceInstaller(); this._serviceProcessInstaller = new ServiceProcessInstaller(); this._eventLogInstaller = new EventLogInstaller(); this._serviceInstaller.ServiceName = SERVICE_NAME; this._serviceInstaller.StartType = ServiceStartMode.Automatic; this._serviceInstaller.Description = SERVICE_DESCRIPTION; this._serviceProcessInstaller.Account = ServiceAccount.NetworkService; this._eventLogInstaller.Log = TaskManagerService.LogName; this._eventLogInstaller.Source = TaskManagerService.LogSource; this.Installers.Add(this._serviceInstaller); this.Installers.Add(this._serviceProcessInstaller); this.Installers.Add(this._eventLogInstaller); this._perfCounterInstaller = new PerformanceCounterInstaller(); this._perfCounterInstaller.CategoryName = PERFORMANCE_COUNTER_CATEGORY; this._perfCounterInstaller.CategoryHelp = PERFORMANCE_COUNTER_DESCRIPTION; this._perfCounterInstaller.CategoryType = PerformanceCounterCategoryType.SingleInstance; this._perfCounterInstaller.Counters.AddRange(COUNTERS); this.Installers.Add(this._perfCounterInstaller); }
/// <summary> /// Creates <see cref="EventLogInstaller"></see> instances for each separate event log source needing installation. /// </summary> /// <param name="instrumentedTypes">Collection of <see cref="Type"></see>s that represent types defining /// event log sources to be installed.</param> /// <returns>Collection of installers containing event log sources to be installed.</returns> protected override ICollection <Installer> CreateInstallers(ICollection <Type> instrumentedTypes) { IList <Installer> installers = new List <Installer>(); foreach (Type instrumentedType in instrumentedTypes) { EventLogDefinitionAttribute attribute = (EventLogDefinitionAttribute)instrumentedType.GetCustomAttributes(typeof(EventLogDefinitionAttribute), false)[0]; EventLogInstaller installer = new EventLogInstaller(); installer.Log = attribute.LogName; installer.Source = attribute.SourceName; installer.CategoryCount = attribute.CategoryCount; if (attribute.CategoryResourceFile != null) { installer.CategoryResourceFile = attribute.CategoryResourceFile; } if (attribute.MessageResourceFile != null) { installer.MessageResourceFile = attribute.MessageResourceFile; } if (attribute.ParameterResourceFile != null) { installer.ParameterResourceFile = attribute.ParameterResourceFile; } installers.Add(installer); } return(installers); }
public ProjectInstaller() { InitializeComponent(); this.Committed += new InstallEventHandler(ProjectInstaller_Committed); this.BeforeUninstall += new InstallEventHandler(ProjectInstaller_BeforeUninstall); this.AfterInstall += new InstallEventHandler(ProjectInstaller_AfterInstall); this.BeforeInstall += new InstallEventHandler(ProjectInstaller_BeforeInstall); EventLogInstaller DefaultInstaller = null; foreach (Installer installer in this.intrusionDetectionServiceInstaller.Installers) { if (installer is EventLogInstaller) { DefaultInstaller = (EventLogInstaller)installer; break; } } if (DefaultInstaller != null) { try { DefaultInstaller.Log = Globals.CYBERARMS_WINDOWS_EVENT_LOG_NAME; DefaultInstaller.Source = Globals.CYBERARMS_WINDOWS_EVENT_SOURCE; System.Diagnostics.EventLog.WriteEntry("Cyberarms Intrusion Detection Installer", "Configured Event Log"); } catch { } } }
/// <summary> /// Initializes a new instance of the <see cref="ServiceInstallerBase"/> class. /// </summary> /// <param name="options"> /// The options. /// </param> protected ServiceInstallerBase(WinServiceInstallationOptions options) { ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller(); ServiceInstaller serviceInstaller = new ServiceInstaller(); // # Service Account Information serviceProcessInstaller.Account = options.Account; // # Service Information serviceInstaller.DisplayName = options.DisplayName; serviceInstaller.Description = options.Description; serviceInstaller.StartType = ServiceStartMode.Automatic; serviceInstaller.ServiceName = options.Options.ServiceName; this.Installers.Add(serviceProcessInstaller); this.Installers.Add(serviceInstaller); EventLogInstaller defaultInstaller = null; foreach (Installer installer in serviceInstaller.Installers) { var eventLogInstaller = installer as EventLogInstaller; if (eventLogInstaller != null) { defaultInstaller = eventLogInstaller; break; } } if (defaultInstaller != null) { serviceInstaller.Installers.Remove(defaultInstaller); } }
public InstallEventLog() { var eventLogInstaller = new EventLogInstaller(); eventLogInstaller.Source = EventSource; Installers.Add(eventLogInstaller); }
public ArchiServiceInstaller() { ServiceInstaller serviceInstaller = new ServiceInstaller(); ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller(); serviceInstaller.ServiceName = SharedInfo.ServiceName; serviceInstaller.DisplayName = SharedInfo.ServiceName; serviceInstaller.Description = SharedInfo.ServiceDescription; // Defaulting to only starting when a user starts it, can be easily changed after install serviceInstaller.StartType = ServiceStartMode.Manual; // System account, requires admin privilege to install serviceProcessInstaller.Account = ServiceAccount.LocalSystem; serviceInstaller.Installers.Clear(); EventLogInstaller logInstaller = new EventLogInstaller { Log = SharedInfo.EventLog, Source = SharedInfo.EventLogSource }; Installers.Add(serviceInstaller); Installers.Add(serviceProcessInstaller); Installers.Add(logInstaller); }
public TfsDeployerInstaller() { _processInstaller = new ServiceProcessInstaller(); this._eventLogInstaller = new System.Diagnostics.EventLogInstaller(); this._tfsIntegratorInstaller = new System.ServiceProcess.ServiceInstaller(); // // _eventLogInstaller // this._eventLogInstaller.CategoryCount = 0; this._eventLogInstaller.CategoryResourceFile = null; this._eventLogInstaller.Log = "Application"; this._eventLogInstaller.MessageResourceFile = null; this._eventLogInstaller.ParameterResourceFile = null; this._eventLogInstaller.Source = "Readify.TfsDeployer"; // // _tfsIntegratorInstaller // this._tfsIntegratorInstaller.DisplayName = "TFS Deployer"; this._tfsIntegratorInstaller.ServiceName = "TfsDeployer"; this._tfsIntegratorInstaller.Description = "Performs Deployment for Team Foundation Server"; this._tfsIntegratorInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic; _processInstaller.Account = ServiceAccount.LocalSystem; this.Installers.Add(_eventLogInstaller); this.Installers.Add(_tfsIntegratorInstaller); this.Installers.Add(_processInstaller); }
public ProjectInstaller() { InitializeComponent(); // To create this Installer... // Add a new Class Library project named YourProject.Installer // Add a "new item" then find "Installer" under the "Code" section // Call the installer "ProjectInstaller" // Open the ProjectInstaller.cs file // Add the line "using System.Diagnostics;" above // Insert the follwoing 4 lines, changing the "Source" // to the name that will be the EventSource for // all Event Log entries. // You can add additional eventLogInstallers as needed. EventLogInstaller eventlogInstaller = new EventLogInstaller(); eventlogInstaller.Log = "Application"; eventlogInstaller.Source = Open.SPF.Utility.EventLogUtility.DefaultEventLogSource; Installers.Add(eventlogInstaller); // To use this Installer... // After you compile the YourProject.Installer.dll // Start -> All Programs -> Microsoft Visual Studio 201x -> // Visual Studio .NET Tools -> Visual Studio .NET 201x Command Prompt // This command prompt has the proper path to reference the VS.NET binaries // In the command window change directories to the location of YourProject.Installer.dll // Type the following "installutil YourProject.Installer.dll" // You should see a bunch of messages like "The Install phase completed successfully" and // "The Commit phase completed successfully" ending with // "The transacted install has completed." // You can verify the registry settings at: // HKLM\System\CurrentControlSet\Services\EventLog\Application\"EventSourceName from above" }
public OxigenServiceEventSourceInstallerInstaller() { EventLogInstaller eventLogInstaller = new EventLogInstaller(); eventLogInstaller.Source = EventSource; Installers.Add(eventLogInstaller); }
public static void Main() { // <Snippet1> AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller(); ServiceInstaller myServiceInstaller = new ServiceInstaller(); EventLogInstaller myEventLogInstaller = new EventLogInstaller(); InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers; // Add Installers to the InstallerCollection of 'myAssemblyInstaller'. myInstallerCollection.Add(myServiceInstaller); myInstallerCollection.Add(myEventLogInstaller); Installer[] myInstaller = new Installer[2]; myInstallerCollection.CopyTo(myInstaller, 0); // Show the contents of the InstallerCollection of 'myAssemblyInstaller'. Console.WriteLine("Installers in the InstallerCollection : "); for (int iIndex = 0; iIndex < myInstaller.Length; iIndex++) { Console.WriteLine(myInstaller[iIndex].ToString()); } // </Snippet1> Console.WriteLine(""); // <Snippet2> AssemblyInstaller myAssemblyInstaller1 = new AssemblyInstaller(); InstallerCollection myInstallerCollection1 = myAssemblyInstaller1.Installers; // 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'. myInstallerCollection1.Add(myAssemblyInstaller); Installer myInstaller1 = myAssemblyInstaller.Parent; Console.WriteLine("Parent of myAssembly : {0}", myInstaller1.ToString()); // </Snippet2> }
protected ManageExchangeFileUploadService() { base.Account = ServiceAccount.LocalSystem; base.StartMode = ServiceStartMode.Automatic; base.DisplayName = Strings.FileUploadServiceDisplayName; base.Description = Strings.FileUploadServiceDescription; string path = Path.Combine(ConfigurationContext.Setup.InstallPath, this.RelativeInstallPath); InstallContext installContext = new InstallContext(); installContext.Parameters["logtoconsole"] = "false"; installContext.Parameters["assemblypath"] = Path.Combine(path, "Microsoft.Exchange.Management.DataMining.ExchangeFileUpload.exe"); base.FirstFailureActionType = ServiceActionType.Restart; base.FirstFailureActionDelay = 5000U; base.SecondFailureActionType = ServiceActionType.Restart; base.SecondFailureActionDelay = 5000U; base.AllOtherFailuresActionType = ServiceActionType.Restart; base.AllOtherFailuresActionDelay = 5000U; base.FailureResetPeriod = 0U; base.FailureActionsFlag = true; base.ServiceInstallContext = installContext; base.CategoryCount = 2; base.ServicesDependedOn = null; foreach (object obj in base.ServiceInstaller.Installers) { EventLogInstaller eventLogInstaller = obj as EventLogInstaller; if (eventLogInstaller != null) { eventLogInstaller.Source = "MSExchange DataMining"; eventLogInstaller.Log = "Application"; } } }
public ProjectInstaller() { const string serviceName = "DltWindowsService"; const string serviceDescription = "DltWindowsService"; serviceProcessInstaller1 = new ServiceProcessInstaller(); QuickSpatchWindowsServiceInstaller = new ServiceInstaller(); //Create Instance of EventLogInstaller var myEventLogInstaller = new EventLogInstaller { Source = serviceName, Log = "Application" }; //# Service Account Information serviceProcessInstaller1.Account = ServiceAccount.LocalSystem; serviceProcessInstaller1.Username = null; serviceProcessInstaller1.Password = null; //# Service Information QuickSpatchWindowsServiceInstaller.ServiceName = serviceName; QuickSpatchWindowsServiceInstaller.DisplayName = serviceName; QuickSpatchWindowsServiceInstaller.Description = serviceDescription; QuickSpatchWindowsServiceInstaller.StartType = ServiceStartMode.Automatic; Installers.Add(serviceProcessInstaller1); Installers.Add(QuickSpatchWindowsServiceInstaller); // Add myEventLogInstaller to the Installers Collection. Installers.Add(myEventLogInstaller); }
public ProjectInstaller() { InitializeComponent(); // Remove the default Event Log Installer EventLogInstaller DefaultInstaller = null; foreach (Installer installer in serviceInstaller1.Installers) { if (installer is EventLogInstaller) { DefaultInstaller = (EventLogInstaller)installer; break; } } if (DefaultInstaller != null) { serviceInstaller1.Installers.Remove(DefaultInstaller); } if (System.Diagnostics.EventLog.SourceExists("iRINGAgentService")) { System.Diagnostics.EventLog.DeleteEventSource("iRINGAgentService"); } if (!System.Diagnostics.EventLog.SourceExists("iRINGAgentService")) { System.Diagnostics.EventLog.CreateEventSource("iRINGAgentService", "iRINGAgentServiceLog"); } }
public WebsiteInstaller() { InstallerInfo info = InstallerInfo.GetInstallerInfo(); // Add a default one that we can always fall back to EventLogInstaller myEventLogInstaller = new EventLogInstaller(); myEventLogInstaller.Source = InstallerInfo.DefaultEventLogSource; Installers.Add(myEventLogInstaller); foreach (EventLogInfo source in info.EventLogInfos) { myEventLogInstaller = new EventLogInstaller(); myEventLogInstaller.Source = source.Source; Installers.Add(myEventLogInstaller); } foreach (PerformanceCounterCategoryInfo performanceCounter in info.PerformanceCounterCategoryInfos) { PerformanceCounterInstaller myCounterInstaller = new PerformanceCounterInstaller(); myCounterInstaller.CategoryHelp = performanceCounter.CategoryHelp; myCounterInstaller.CategoryName = performanceCounter.CategoryName; ArrayList counters = new ArrayList(); foreach (CounterCreationDataInfo creationDataInfo in performanceCounter.CounterCreationDataInfos) { counters.Add(new CounterCreationData(creationDataInfo.CounterName, creationDataInfo.CounterHelp, creationDataInfo.CounterType)); } myCounterInstaller.Counters.AddRange( (CounterCreationData[])counters.ToArray(typeof(CounterCreationData))); Installers.Add(myCounterInstaller); } }
public ServiceInstaller() { this.eventLogInstaller = new EventLogInstaller(); this.eventLogInstaller.Log = "Application"; this.eventLogInstaller.Source = ""; this.eventLogInstaller.UninstallAction = UninstallAction.Remove; this.Installers.Add((Installer)this.eventLogInstaller); }
private void InstallEventSource(string sourceName, string logName) { EventLogInstaller defaultLogDestinationSinkNameInstaller = new EventLogInstaller(); defaultLogDestinationSinkNameInstaller.Source = sourceName; defaultLogDestinationSinkNameInstaller.Log = logName; Installers.Add(defaultLogDestinationSinkNameInstaller); }
/// <summary/> /// <exclude/> public ProjectInstaller() { EventLogInstaller eventlogInstaller = new EventLogInstaller(); eventlogInstaller.Log = "Application"; eventlogInstaller.Source = ExceptionHandlingEvent.EventSourceName; Installers.Add(eventlogInstaller); InstallEventSource(SR.EntLibExceptionHandlerSource, "Application"); }
public EventLogSourceInstaller() { InitializeComponent(); customeEventLogInstaller = new EventLogInstaller(); customeEventLogInstaller.Source = "Adep Framework Web Error"; customeEventLogInstaller.Log = "Application"; Installers.Add(customeEventLogInstaller); }
public MyEventLogInstaller() { EventLogInstaller installer = new EventLogInstaller(); installer.Log = "Application"; installer.Source = EventLogSources.SFTPAdapter; Installers.Add(installer); }
public MyEventLogInstaller() { EventLogInstaller installer = new EventLogInstaller { Log = "Application", Source = EventLogSources.SftpAdapter }; Installers.Add(installer); }
public ProjectInstaller() { InitializeComponent(); EventLogInstaller installer = FindInstaller(this.Installers); if (installer != null) { installer.Log = "FileMonitor"; // servie name for event log } }
public ProjectInstaller() { InitializeComponent(); EventLogInstaller installer = FindInstaller(this.Installers); if (installer != null) { installer.Log = "Homework Service"; } }
public ProjectInstaller() { _eventLogInstaller = new EventLogInstaller { Source = "AdmBalanceo", Log = "NotifyAssignation" }; Installers.Add(_eventLogInstaller); InitializeComponent(); }
public TISEventLogInstaller() { //Create Instance of EventLogInstaller TisEventLogInstaller = new EventLogInstaller(); // Set the Log that source is created in TisEventLogInstaller.Log = Log.EVENT_LOG_NAME; // Add myEventLogInstaller to the Installers Collection. Installers.Add(TisEventLogInstaller); }