2006-01-19 00:34:21 +01:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
2006-02-01 18:48:29 +01:00
|
|
|
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* This library 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
|
2006-01-31 23:01:47 +01:00
|
|
|
* Library Lesser General Public License for more details.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2006-01-31 23:01:47 +01:00
|
|
|
* License along with this library; if not, Novell, Inc.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* To contact Novell about this file by physical or electronic mail,
|
|
|
|
* you may find current contact information at www.novell.com.
|
|
|
|
*
|
|
|
|
***********************************************************************/
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.ComponentModel;
|
|
|
|
using System.Configuration.Install;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace sscs.init
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Summary description for ProjectInstaller.
|
|
|
|
/// </summary>
|
|
|
|
[RunInstaller(true)]
|
|
|
|
public class ProjectInstaller : System.Configuration.Install.Installer
|
|
|
|
{
|
|
|
|
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
|
|
|
|
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
|
|
|
|
/// <summary>
|
|
|
|
/// Required designer variable.
|
|
|
|
/// </summary>
|
|
|
|
private System.ComponentModel.Container components = null;
|
2006-01-22 05:19:37 +01:00
|
|
|
private static string SERVICE_DESCRIPTION = "Novell Identity Store is used by CASA (Common Authentication Service Adapter) "
|
|
|
|
+ "to encypt and store credentials entered by users. These credentials can be used to authenticate to additional network services";
|
2005-10-11 21:51:00 +02:00
|
|
|
|
|
|
|
public ProjectInstaller()
|
|
|
|
{
|
|
|
|
// This call is required by the Designer.
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
// TODO: Add any initialization after the InitializeComponent call
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Clean up any resources being used.
|
|
|
|
/// </summary>
|
|
|
|
protected override void Dispose( bool disposing )
|
|
|
|
{
|
|
|
|
if( disposing )
|
|
|
|
{
|
|
|
|
if(components != null)
|
|
|
|
{
|
|
|
|
components.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
base.Dispose( disposing );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region Component Designer generated code
|
|
|
|
/// <summary>
|
|
|
|
/// Required method for Designer support - do not modify
|
|
|
|
/// the contents of this method with the code editor.
|
|
|
|
/// </summary>
|
|
|
|
private void InitializeComponent()
|
|
|
|
{
|
|
|
|
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
|
|
|
|
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
|
|
|
|
//
|
|
|
|
// serviceProcessInstaller1
|
|
|
|
//
|
|
|
|
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
|
|
|
|
this.serviceProcessInstaller1.Password = null;
|
|
|
|
this.serviceProcessInstaller1.Username = null;
|
|
|
|
this.serviceProcessInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_AfterInstall);
|
|
|
|
//
|
|
|
|
// serviceInstaller1
|
|
|
|
//
|
|
|
|
this.serviceInstaller1.DisplayName = WinSecretStoreClientService.sServiceName;
|
|
|
|
this.serviceInstaller1.ServiceName = WinSecretStoreClientService.sServiceName;
|
|
|
|
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
|
|
|
|
this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
|
|
|
|
//
|
|
|
|
// ProjectInstaller
|
|
|
|
//
|
|
|
|
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
|
|
|
|
this.serviceProcessInstaller1,
|
|
|
|
this.serviceInstaller1});
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
private void serviceInstaller1_AfterInstall(object sender, System.Configuration.Install.InstallEventArgs e)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void serviceProcessInstaller1_AfterInstall(object sender, System.Configuration.Install.InstallEventArgs e)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2006-01-22 05:19:37 +01:00
|
|
|
|
|
|
|
public override void Install(IDictionary stateServer)
|
|
|
|
{
|
|
|
|
Microsoft.Win32.RegistryKey system,
|
|
|
|
currentControlSet,
|
|
|
|
services,
|
|
|
|
service,
|
|
|
|
config;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
|
|
|
|
//Let the project installer do its job
|
|
|
|
base.Install(stateServer);
|
|
|
|
|
|
|
|
//Open the HKEY_LOCAL_MACHINE\SYSTEM key
|
|
|
|
system = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System");
|
|
|
|
//Open CurrentControlSet
|
|
|
|
currentControlSet = system.OpenSubKey("CurrentControlSet");
|
|
|
|
//Go to the services key
|
|
|
|
services = currentControlSet.OpenSubKey("Services");
|
|
|
|
//Open the key for your service, and allow writing
|
|
|
|
service = services.OpenSubKey(this.serviceInstaller1.ServiceName, true);
|
|
|
|
//Add service's description as a REG_SZ value named "Description"
|
|
|
|
service.SetValue("Description", SERVICE_DESCRIPTION);
|
|
|
|
}
|
|
|
|
catch(Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine("An exception was thrown during service installation:\n" + e.ToString());
|
|
|
|
}
|
|
|
|
}
|
2005-10-11 21:51:00 +02:00
|
|
|
}
|
2006-01-22 05:19:37 +01:00
|
|
|
}
|