FlexitimeTracker/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceComponents.wxs
chris.watts90@outlook.com 230db99d5d fix installer so that it starts the Windows Smart Card Service and sets it to automatic.
also added a service dependency from the Card Reader service to the Smart Card Service
#77
2019-03-29 09:16:56 +00:00

126 lines
6.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<PropertyRef Id="STARTSERVICEONINSTALL"/>
<Component Id="CardReaderServiceStarter" Directory="INSTALLFOLDER"
Guid="{E37EA846-FF70-4D2C-95CF-EFD06850BBF3}" KeyPath="yes">
<ServiceControl Id="CardReaderServiceStarter"
Start="install"
Stop="uninstall"
Remove="uninstall"
Name="FlexitimeCardReaderService"
Wait="yes" />
<Condition><![CDATA[STARTSERVICEONINSTALL <> "false"]]></Condition>
</Component>
<Component Id="CardReaderEventLog" Directory="INSTALLFOLDER"
Guid="{A97DF87D-257C-4321-9ECA-0551FA9301C3}" KeyPath="yes">
<util:EventSource Log="CardReaderService"
EventMessageFile="[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\EventLogMessages.dll"
Name="CardReaderDefaultLogger"/>
</Component>
<ComponentGroup Id="CardReaderServiceComponents" Directory="INSTALLFOLDER">
<ComponentRef Id="CardReaderServiceStarter" />
<ComponentRef Id="CardReaderEventLog" />
<ComponentRef Id="ServiceConfiguration"/>
<!-- Start the Smart Card Service which is a dependency of the PCSC library. -->
<Component Id="SmartCardServiceConfig" Guid="{73D2E31D-F256-457C-AFD5-EC456CDAD7E8}" KeyPath="yes">
<ServiceControl Id="SmartCardServiceStarter"
Start="install"
Stop="install"
Name="SCardSvr"
Wait="yes" />
<ServiceConfig Id="SmartCardServiceSetToAuto"
DelayedAutoStart="0" OnInstall="yes" ServiceName="SCardSvr"/>
</Component>
<Component Id="SCardAutoStart" Permanent="yes" KeyPath="yes" Guid="{75582D3C-C985-4BC9-A0A8-621A52C7E95E}">
<RegistryKey Root="HKLM"
Key="SYSTEM\CurrentControlSet\Services\SCardSvr"
Action="create">
<RegistryValue Type="integer" Name="Start" Value="2"/>
</RegistryKey>
</Component>
<Component Id="CardReaderServiceExe" Guid="{24C9D834-21E2-476D-8302-EF35730D0BA8}">
<File Id="CardReaderService.exe"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)CardReaderService.exe" />
<ServiceInstall Id="CardReaderService"
Start="auto"
ErrorControl="ignore"
Type="ownProcess"
Vital="yes"
Name="FlexitimeCardReaderService"
DisplayName="FlexitimeCardReaderService"
Description="Flexitime Card Reader Service"
Account="LocalSystem">
<util:PermissionEx User="Everyone"
ServicePauseContinue="yes"
ServiceQueryStatus="yes"
ServiceStart="yes"
ServiceStop="yes"
ServiceUserDefinedControl="yes" />
<ServiceConfig Id="CardReaderServiceConfig"
OnInstall="yes"
DelayedAutoStart="0" />
<util:ServiceConfig FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart"
ResetPeriodInDays="1"
RestartServiceDelayInSeconds="10" />
<ServiceDependency Id="SCardSvr" Group="no"/>
</ServiceInstall>
</Component>
<Component Id="CardReaderServiceExeConfig" Guid="{E20D23BC-C8E7-49F8-962C-DE856A84258E}">
<File Id="CardReaderService.exe.config"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)CardReaderService.exe.config" />
</Component>
<Component Id="NewtonsoftJson" Guid="{98006F04-1335-40D5-8D2F-A394C8176A1A}">
<File Id="Newtonsoft.Json.dll"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)Newtonsoft.Json.dll" />
</Component>
<Component Id="Ninject" Guid="{A5C71803-AD3C-45CB-9973-FB5B6C7579D2}">
<File Id="Ninject.dll"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)Ninject.dll" />
</Component>
<Component Id="NinjectExtensionsXmlDll" Guid="{3809511F-9C51-4C05-AFE5-F59160EDCB71}">
<File Id="Ninject.Extensions.Xml.dll"
Source="$(var.CardReaderService.TargetDir)Ninject.Extensions.Xml.dll"
KeyPath="yes"
Checksum="yes"/>
</Component>
<Component Id="NinjectConfig" Guid="{C7106002-A5E5-4223-AC34-75704C71D2F4}">
<File Id="NinjectConfig.xml"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)NinjectConfig.xml" />
</Component>
<Component Id="PCSC" Guid="{9DD367D4-3760-46DA-8A4A-6E801ED754D5}">
<File Id="pcsc_sharp.dll"
Checksum="yes"
KeyPath="yes"
Source="$(var.CardReaderService.TargetDir)pcsc-sharp.dll" />
</Component>
</ComponentGroup>
<Component Id="ServiceConfiguration" Directory="INSTALLFOLDER" Guid="{E49ABD61-0CCA-45A2-A525-DF85A0493FF7}" KeyPath="yes">
<util:XmlFile Id="SetDataCenterEndpoint"
Action="setValue"
ElementPath="//appSettings/add[\[]@key='DataCenterServiceEndpoint'[\]]/@value"
Value="http://[SERVICEIP]:[SERVICEPORT]"
File="[#CardReaderService.exe.config]"
SelectionLanguage="XPath"
Sequence="1" />
</Component>
</Fragment>
</Wix>