Skip to content

Commit 0e85959

Browse files
authored
installer: do not fail, if service can't be started. (#2163)
1 parent 6253bf8 commit 0e85959

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.idea/dictionaries/project.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

installer/files.wxs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
<DirectoryRef Id="APPLICATIONFOLDER">
2222
<Component Transitive="yes">
2323
<File Id="windows_exporter.exe" Name="windows_exporter.exe" Source="Work\windows_exporter.exe" KeyPath="yes" Vital="yes" Checksum="yes"/>
24+
25+
<!-- The "Name" field must match the argument to eventlog.Open() -->
26+
<util:EventSource Log="Application" Name="windows_exporter"
27+
EventMessageFile="%SystemRoot%\System32\EventCreate.exe"
28+
SupportsErrors="yes"
29+
SupportsInformationals="yes"
30+
SupportsWarnings="yes"/>
31+
2432
<ServiceInstall
2533
Id="InstallExporterService"
2634
Name="windows_exporter"
@@ -45,13 +53,8 @@
4553
/>
4654
<ServiceDependency Id="wmiApSrv" />
4755
</ServiceInstall>
48-
<ServiceControl Id="ServiceStateControl" Name="windows_exporter" Remove="uninstall" Start="install" Stop="both"/>
49-
<!-- The "Name" field must match the argument to eventlog.Open() -->
50-
<util:EventSource Log="Application" Name="windows_exporter"
51-
EventMessageFile="%SystemRoot%\System32\EventCreate.exe"
52-
SupportsErrors="yes"
53-
SupportsInformationals="yes"
54-
SupportsWarnings="yes"/>
56+
<ServiceControl Id="StartService" Name="windows_exporter" Start="install" Wait="no" />
57+
<ServiceControl Id="StopService" Name="windows_exporter" Remove="uninstall" Stop="both" Wait="yes" />
5558
</Component>
5659
<Component Id="CreateTextfileDirectory" Directory="textfile_inputs" Guid="d03ef58a-9cbf-4165-ad39-d143e9b27e14">
5760
<CreateFolder />

0 commit comments

Comments
 (0)