using System; using System.Collections; using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; namespace RepoCleanup { /// /// Installer. Generated. Updated method: constructor.
/// Install the Windows service with installutil. ///

Copyright (c) 2002 Alexis Grandemange
/// Mail: alexis.grandemange@pagebox.net

///
This program is free software; you can redistribute it and/or
	/// modify it under the terms of the GNU Lesser General Public
	/// License as published by the Free Software Foundation; version
	/// 2.1 of the License.
	/// This library is distributed in the hope that it will be useful,
	/// but WITHOUT ANY WARRANTY; without even the implied warranty of
	/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	/// GNU Lesser General Public License for more details.
	/// A copy of the GNU Lesser General Public License lesser.txt should be
	/// included in the distribution.
///
[RunInstaller(true)] public class ProjectInstaller : System.Configuration.Install.Installer { private System.ServiceProcess.ServiceProcessInstaller CleanupProcessInstaller; private System.ServiceProcess.ServiceInstaller CleanupInstaller; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public ProjectInstaller() { // This call is required by the Designer. InitializeComponent(); // // CleanupProcessInstaller // Console.WriteLine("======= RepoCleanup installation ======="); Console.WriteLine("Enter the Windows service user name (machine\\user):"); this.CleanupProcessInstaller.Username = Console.ReadLine(); Console.WriteLine("Enter the Windows service user password:"); this.CleanupProcessInstaller.Password = Console.ReadLine(); // // CleanupInstaller // this.CleanupInstaller.ServiceName = "Cleanup"; this.CleanupInstaller.StartType = ServiceStartMode.Manual; } /// /// Clean up any resources being used. /// public override void Dispose() { if (components != null) { components.Dispose(); } base.Dispose(); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.CleanupProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller(); this.CleanupInstaller = new System.ServiceProcess.ServiceInstaller(); // // ProjectInstaller // this.Installers.AddRange(new System.Configuration.Install.Installer[] { this.CleanupProcessInstaller, this.CleanupInstaller}); } } }