2023-11-17 20:53:54 +00:00
|
|
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fw="http://wixtoolset.org/schemas/v4/wxs/firewall" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
|
2016-09-16 06:36:58 +00:00
|
|
|
<?if $(sys.BUILDARCH)=x64 ?>
|
|
|
|
<?define PlatformProgramFiles = "ProgramFiles64Folder" ?>
|
2023-11-17 20:53:54 +00:00
|
|
|
<?else?>
|
2016-09-16 06:36:58 +00:00
|
|
|
<?define PlatformProgramFiles = "ProgramFilesFolder" ?>
|
2023-11-17 20:53:54 +00:00
|
|
|
<?endif?>
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2023-11-17 20:53:54 +00:00
|
|
|
<Package UpgradeCode="66a6eb5b-1fc2-4b14-a362-5ceec6413308" Name="windows_exporter" Version="$(var.Version)" Manufacturer="prometheus-community" Language="1033" Codepage="1252"><SummaryInformation Manufacturer="prometheus-community" Description="windows_exporter $(var.Version) installer" />
|
|
|
|
<Media Id="1" Cabinet="windows_exporter.cab" EmbedCab="yes" />
|
2020-09-12 14:37:32 +00:00
|
|
|
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2023-11-17 20:53:54 +00:00
|
|
|
<Property Id="ENABLED_COLLECTORS" Secure="yes" />
|
|
|
|
<SetProperty Id="CollectorsFlag" After="InstallFiles" Sequence="execute" Value="--collectors.enabled [ENABLED_COLLECTORS]" Condition="ENABLED_COLLECTORS" />
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2023-11-17 20:53:54 +00:00
|
|
|
<Property Id="EXTRA_FLAGS" Secure="yes" />
|
|
|
|
<SetProperty Id="ExtraFlags" After="InstallFiles" Sequence="execute" Value="[EXTRA_FLAGS]" Condition="EXTRA_FLAGS" />
|
2018-11-29 19:14:37 +00:00
|
|
|
|
2023-11-19 20:11:22 +00:00
|
|
|
<Property Id="LISTEN_ADDR" Secure="yes" Value="0.0.0.0" />
|
|
|
|
<Property Id="LISTEN_PORT" Secure="yes" Value="9182" />
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2023-11-17 20:53:54 +00:00
|
|
|
<Property Id="METRICS_PATH" Secure="yes" />
|
|
|
|
<SetProperty Id="MetricsPathFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.path [METRICS_PATH]" Condition="METRICS_PATH" />
|
2023-04-22 10:17:51 +00:00
|
|
|
|
2020-09-28 13:37:48 +00:00
|
|
|
<Property Id="REMOTE_ADDR" Secure="yes" />
|
2023-11-17 20:53:54 +00:00
|
|
|
<SetProperty Id="RemoteAddressFlag" After="InstallFiles" Sequence="execute" Value="[REMOTE_ADDR]" Condition="REMOTE_ADDR" />
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2023-12-05 07:47:40 +00:00
|
|
|
<!-- https://github.com/prometheus-community/windows_exporter/issues/1318 -->
|
|
|
|
<!-- https://wixtoolset.org/docs/tools/wixext/quietexec/ -->
|
|
|
|
<SetProperty
|
|
|
|
Id="WixQuietExecCmdLine"
|
|
|
|
Value=""[%ComSpec]" /c reg delete HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\windows_exporter /f"
|
2023-12-05 08:06:05 +00:00
|
|
|
Before="RemoveEventSource"
|
2023-12-05 07:47:40 +00:00
|
|
|
Sequence="execute"
|
|
|
|
/>
|
|
|
|
<CustomAction
|
|
|
|
Id="RemoveEventSource"
|
|
|
|
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
|
|
|
|
DllEntry="WixSilentExec"
|
|
|
|
Execute="deferred"
|
|
|
|
Impersonate="no"
|
|
|
|
Return="ignore"
|
|
|
|
/>
|
|
|
|
<InstallExecuteSequence>
|
|
|
|
<Custom Action="RemoveEventSource" After="InstallInitialize" />
|
|
|
|
</InstallExecuteSequence>
|
2016-09-16 06:36:58 +00:00
|
|
|
|
2024-01-12 15:45:56 +00:00
|
|
|
<Property Id="TEXTFILE_DIRS" Secure="yes" />
|
|
|
|
<SetProperty Id="TextfileDirsFlag" After="InstallFiles" Sequence="execute" Value="--collector.textfile.directories [TEXTFILE_DIRS]" Condition="TEXTFILE_DIRS" />
|
2018-04-03 19:37:10 +00:00
|
|
|
|
2018-04-05 06:08:19 +00:00
|
|
|
<ComponentGroup Id="Files">
|
|
|
|
<Component Directory="APPLICATIONROOTDIRECTORY">
|
2020-05-24 18:42:23 +00:00
|
|
|
<File Id="windows_exporter.exe" Name="windows_exporter.exe" Source="Work\windows_exporter.exe" KeyPath="yes">
|
2020-09-28 13:37:48 +00:00
|
|
|
<fw:FirewallException Id="MetricsEndpoint" Name="windows_exporter (HTTP [LISTEN_PORT])" Description="windows_exporter HTTP endpoint" Port="[LISTEN_PORT]" Protocol="tcp" IgnoreFailure="yes">
|
2023-11-17 20:53:54 +00:00
|
|
|
<fw:RemoteAddress Value="[REMOTE_ADDR]" />
|
2023-04-22 10:17:51 +00:00
|
|
|
</fw:FirewallException>
|
2016-09-16 06:36:58 +00:00
|
|
|
</File>
|
2024-01-12 15:53:02 +00:00
|
|
|
<ServiceInstall Id="InstallExporterService" Name="windows_exporter" DisplayName="windows_exporter" Description="Exports Prometheus metrics about the system" ErrorControl="normal" Start="auto" Type="ownProcess" Arguments="--log.file eventlog [CollectorsFlag] --web.listen-address [LISTEN_ADDR]:[LISTEN_PORT] [MetricsPathFlag] [TextfileDirsFlag] [ExtraFlags]">
|
2020-11-01 13:12:59 +00:00
|
|
|
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="60" />
|
|
|
|
<ServiceDependency Id="wmiApSrv" />
|
2018-04-05 06:37:23 +00:00
|
|
|
</ServiceInstall>
|
2020-05-24 18:42:23 +00:00
|
|
|
<ServiceControl Id="ServiceStateControl" Name="windows_exporter" Remove="uninstall" Start="install" Stop="both" />
|
2016-09-16 06:36:58 +00:00
|
|
|
</Component>
|
2018-04-05 06:08:19 +00:00
|
|
|
<Component Id="CreateTextfileDirectory" Directory="textfile_inputs" Guid="d03ef58a-9cbf-4165-ad39-d143e9b27e14">
|
|
|
|
<CreateFolder />
|
|
|
|
</Component>
|
2016-09-16 06:36:58 +00:00
|
|
|
</ComponentGroup>
|
|
|
|
|
|
|
|
<Feature Id="DefaultFeature" Level="1">
|
|
|
|
<ComponentGroupRef Id="Files" />
|
|
|
|
</Feature>
|
2023-12-05 07:47:40 +00:00
|
|
|
|
|
|
|
<Directory Id="$(var.PlatformProgramFiles)">
|
|
|
|
<Directory Id="APPLICATIONROOTDIRECTORY" Name="windows_exporter">
|
|
|
|
<Directory Id="textfile_inputs" Name="textfile_inputs" />
|
2023-11-17 20:53:54 +00:00
|
|
|
</Directory>
|
2023-12-05 07:47:40 +00:00
|
|
|
</Directory>
|
|
|
|
</Package>
|
2018-04-03 19:37:10 +00:00
|
|
|
</Wix>
|