diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..77b61139 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*.wxs] + +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.gitignore b/.gitignore index e8af3c55..b225252a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ output/ .vscode .idea *.syso +installer/*.msi +installer/*.wixpdb \ No newline at end of file diff --git a/README.md b/README.md index 54bddd77..879f3057 100644 --- a/README.md +++ b/README.md @@ -121,11 +121,19 @@ Example service collector with a custom query. msiexec /i ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'""" ``` -On some older versions of Windows you may need to surround parameter values with double quotes to get the install command parsing properly: +On some older versions of Windows, +you may need to surround parameter values with double quotes to get the installation command parsing properly: ```powershell msiexec /i C:\Users\Administrator\Downloads\windows_exporter.msi ENABLED_COLLECTORS="ad,iis,logon,memory,process,tcp,textfile,thermalzone" TEXTFILE_DIRS="C:\custom_metrics\" ``` +To install the exporter with creating a firewall exception, use the following command: + +```powershell +msiexec /i ADD_FIREWALL_EXCEPTION=yes +``` + + Powershell versions 7.3 and above require [PSNativeCommandArgumentPassing](https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3) to be set to `Legacy` when using `--% EXTRA_FLAGS`: ```powershell @@ -133,7 +141,6 @@ $PSNativeCommandArgumentPassing = 'Legacy' msiexec /i ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'""" ``` - ## Kubernetes Implementation See detailed steps to install on Windows Kubernetes [here](./kubernetes/kubernetes.md). diff --git a/installer/build.ps1 b/installer/build.ps1 index 1c2bd769..62606a49 100644 --- a/installer/build.ps1 +++ b/installer/build.ps1 @@ -24,7 +24,7 @@ Copy-Item -Force $PathToExecutable Work/windows_exporter.exe Write-Verbose "Creating windows_exporter-${Version}-${Arch}.msi" $wixArch = @{"amd64" = "x64"; "arm64" = "arm64"}[$Arch] -$wixOpts = "-ext WixFirewallExtension -ext WixUtilExtension" + Invoke-Expression "wix build -arch $wixArch -o .\windows_exporter-$($Version)-$($Arch).msi .\windows_exporter.wxs -d Version=$($Version) -ext WixToolset.Firewall.wixext -ext WixToolset.Util.wixext" Write-Verbose "Done!" diff --git a/installer/windows_exporter.wxs b/installer/windows_exporter.wxs index bf52f61f..1db05f66 100644 --- a/installer/windows_exporter.wxs +++ b/installer/windows_exporter.wxs @@ -15,6 +15,9 @@ + + + @@ -49,11 +52,7 @@ - - - - - + @@ -64,15 +63,26 @@ + + + + + + + - + + + + + - +