;	Copyright (c) 1997 Microsoft Corporation  All rights reserved.
;
;	This file is used to INSTALL the Key Management Server.
;

;
;	Talking to the Service Manager
;

StopService:MSExchangeKMS

OpenMachineKey:SYSTEM\CurrentControlSet\Services\EventLog\Application
CreateKey:MSExchangeKMS
CloseKey:

;		EventLog(MSExchangeKMS)
OpenMachineKey:SYSTEM\CurrentControlSet\Services\EventLog\Application\MSExchangeKMS
ReplaceExpandString:CategoryMessageFile;%s\res\kmsmsg.dll
ReplaceExpandString:EventMessageFile;%s\res\kmsmsg.dll
CloseKey:


;		ServiceManager(KMS)
CreateServiceManualAlways:MSExchangeKMS;Microsoft Exchange Key Management Server;bin\kmserver.exe;MSExchangeIS$

;		Create needed registry keys.

OpenMachineKey:SOFTWARE\Microsoft\Exchange
CreateKey:KMServer
CloseKey:

OpenMachineKey:SOFTWARE\Microsoft\Exchange\KMServer
DeleteKey:CertLifetime
DeleteKey:CRLSchedule
ReplaceString:MailBoxName;KMSERVER
ReplaceString:KeySetPathname;%s\KMSDATA
ReplaceString:MAPIProfile;KMServer
ReplaceString:ServerName;!Server
CloseKey:

;		Install CSP
OpenMachineKey:SOFTWARE\Microsoft
CreateKey:Cryptography\Defaults\Provider\Microsoft KMServer Cryptography Service Provider
CloseKey:

OpenMachineKey:SOFTWARE\Microsoft\Cryptography\Defaults\Provider\Microsoft KMServer Cryptography Service Provider
ReplaceString:Image Path;%s\bin\excacsp.dll
ReplaceDword:Type;5
SetBinary:Signature;%srcdir%\bin\excacsp.sig
CloseKey:

; Cluster registry checkpoint before starting the service
RegistryCheckpoint:MSExchangeKMS;SYSTEM\CurrentControlSet\Services\MSExchangeKMS$SOFTWARE\Microsoft\Exchange\KMServer$

; Disable auto-start of the service at the end of setup
RemoveServiceFromRestartList:MSExchangeKMS
