From f7959a9435bab813786382ae58bba099f61ce087 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 1/7] Revert "Improve tests" This reverts commit 0e1eb31b4873f16082b6a3ac060fd02112722e25. --- .github/workflows/scripts/win-test-services.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/win-test-services.ps1 b/.github/workflows/scripts/win-test-services.ps1 index 7e1f1c5e0e..5758ab1e8c 100644 --- a/.github/workflows/scripts/win-test-services.ps1 +++ b/.github/workflows/scripts/win-test-services.ps1 @@ -42,7 +42,6 @@ $expected_svc_env_vars = @{ "SPLUNK_CONFIG" = "${env:PROGRAMDATA}\Splunk\OpenTelemetry Collector\${mode}_config.yaml"; "SPLUNK_ACCESS_TOKEN" = "$access_token"; "SPLUNK_REALM" = "$realm"; - "SPLUNK_API_URL" = "$api_url"; "SPLUNK_INGEST_URL" = "$ingest_url"; "SPLUNK_TRACE_URL" = "${ingest_url}/v2/trace"; "SPLUNK_HEC_URL" = "${ingest_url}/v1/log"; @@ -76,6 +75,8 @@ if ("$with_fluentd" -eq "true") { } } +$api_url = "https://api.${realm}.signalfx.com" + if ($with_msi_uninstall_comments -ne "") { $uninstallProperties = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | ForEach-Object { Get-ItemProperty $_.PSPath } | From 4993f8ff5507eb48f0fe1619d79e176118843169 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 2/7] Revert "Add all required configurations to the MSI installer" This reverts commit c89ee8d0771c9a4c05b5df75b26ec6c05b7925d5. --- .../workflows/scripts/win-test-services.ps1 | 19 ++--- .github/workflows/win-package-test.yml | 75 ++++--------------- Makefile | 6 +- .../msi/SplunkCustomActions/CustomActions.cs | 37 +++++++++ .../SplunkCustomActions.csproj | 13 +--- .../packaging/msi/msi-builder/build.sh | 25 ++++--- .../packaging/msi/splunk-otel-collector.wxs | 17 ++--- 7 files changed, 85 insertions(+), 107 deletions(-) diff --git a/.github/workflows/scripts/win-test-services.ps1 b/.github/workflows/scripts/win-test-services.ps1 index 5758ab1e8c..c7b7ed42b6 100644 --- a/.github/workflows/scripts/win-test-services.ps1 +++ b/.github/workflows/scripts/win-test-services.ps1 @@ -4,9 +4,7 @@ param ( [string]$realm = "test", [string]$memory = "512", [string]$with_fluentd = "true", - [string]$with_msi_uninstall_comments = "", - [string]$api_url = "https://api.${realm}.signalfx.com", - [string]$ingest_url = "https://ingest.${realm}.signalfx.com" + [string]$with_msi_uninstall_comments = "" ) $ErrorActionPreference = 'Stop' @@ -38,23 +36,22 @@ function service_running([string]$name) { return ((Get-CimInstance -ClassName win32_service -Filter "Name = '$name'" | Select Name, State).State -Eq "Running") } -$expected_svc_env_vars = @{ +$api_url = "https://api.${realm}.signalfx.com" +$ingest_url = "https://ingest.${realm}.signalfx.com" + +check_collector_svc_environment @{ "SPLUNK_CONFIG" = "${env:PROGRAMDATA}\Splunk\OpenTelemetry Collector\${mode}_config.yaml"; "SPLUNK_ACCESS_TOKEN" = "$access_token"; "SPLUNK_REALM" = "$realm"; + "SPLUNK_API_URL" = "$api_url"; "SPLUNK_INGEST_URL" = "$ingest_url"; "SPLUNK_TRACE_URL" = "${ingest_url}/v2/trace"; "SPLUNK_HEC_URL" = "${ingest_url}/v1/log"; "SPLUNK_HEC_TOKEN" = "$access_token"; "SPLUNK_BUNDLE_DIR" = "${env:PROGRAMFILES}\Splunk\OpenTelemetry Collector\agent-bundle"; + "SPLUNK_MEMORY_TOTAL_MIB" = "$memory"; } -if (![string]::IsNullOrWhitespace($memory)) { - $expected_svc_env_vars["SPLUNK_MEMORY_TOTAL_MIB"] = "$memory" -} - -check_collector_svc_environment $expected_svc_env_vars - if ((service_running -name "splunk-otel-collector")) { write-host "splunk-otel-collector service is running." } else { @@ -75,8 +72,6 @@ if ("$with_fluentd" -eq "true") { } } -$api_url = "https://api.${realm}.signalfx.com" - if ($with_msi_uninstall_comments -ne "") { $uninstallProperties = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | ForEach-Object { Get-ItemProperty $_.PSPath } | diff --git a/.github/workflows/win-package-test.yml b/.github/workflows/win-package-test.yml index a64227a267..54aac5ef2e 100644 --- a/.github/workflows/win-package-test.yml +++ b/.github/workflows/win-package-test.yml @@ -91,39 +91,10 @@ jobs: name: agent-bundle-windows path: ./dist/agent-bundle_windows_amd64.zip - msi-custom-actions: - runs-on: windows-2022 - steps: - - name: Check out the codebase. - uses: actions/checkout@v4 - - - name: Build Custom Actions - working-directory: internal/buildscripts/packaging/msi/SplunkCustomActions - run: | - dotnet publish ./SplunkCustomActions.csproj -c Release -o ./bin/Release - - - name: Package Custom Actions - run: | - $WixPath = "${Env:ProgramFiles(x86)}\WiX Toolset v3.14" - $sfxcaDll = "${WixPath}\SDK\x64\sfxca.dll" - $Env:PATH = "${WixPath}\SDK;" + $Env:PATH - $customActionDir = "${PWD}\internal\buildscripts\packaging\msi\SplunkCustomActions" - $customActionBinDir = "${customActionDir}\bin\Release" - MakeSfxCA.exe "${PWD}\dist\SplunkCustomActions.CA.dll" ` - "${sfxcaDll}" ` - "${customActionBinDir}\SplunkCustomActions.dll" ` - "${customActionBinDir}\Microsoft.Deployment.WindowsInstaller.dll" ` - "${customActionDir}\CustomAction.config" - - - uses: actions/upload-artifact@v4 - with: - name: msi-custom-actions - path: ./dist/SplunkCustomActions.CA.dll - msi-build: # Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved runs-on: ubuntu-20.04 - needs: [cross-compile, agent-bundle-windows, msi-custom-actions] + needs: [cross-compile, agent-bundle-windows] steps: - name: Check out the codebase. uses: actions/checkout@v4 @@ -142,18 +113,11 @@ jobs: go-version: ${{ env.GO_VERSION }} cache-dependency-path: '**/go.sum' - - name: Downloading agent-bundle-windows - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: agent-bundle-windows path: ./dist - - name: Downloading msi-custom-actions - uses: actions/download-artifact@v4 - with: - name: msi-custom-actions - path: ./internal/buildscripts/packaging/msi/SplunkCustomActions/bin/Release - - name: Build MSI run: | mkdir -p dist @@ -222,24 +186,7 @@ jobs: strategy: matrix: OS: [ "windows-2022" ] - install-properties: - - - install: "SPLUNK_ACCESS_TOKEN=fakeToken" - expected: "-mode agent -access_token fakeToken -realm us0 -memory $null -with_fluentd false" - - - install: "SPLUNK_SETUP_COLLECTOR_MODE=gateway SPLUNK_ACCESS_TOKEN=testing123" - expected: "-mode gateway -access_token testing123 -realm us0 -memory $null -with_fluentd false" - - - install: "SPLUNK_REALM=myrealm SPLUNK_ACCESS_TOKEN=testing" - expected: "-mode agent -access_token testing -realm myrealm -memory $null -with_fluentd false" - - - install: "SPLUNK_INGEST_URL=https://fake.ingest.url SPLUNK_ACCESS_TOKEN=testing" - expected: "-mode agent -realm us0 -access_token testing -ingest_url \"https://fake.ingest.url\" -memory $null -with_fluentd false" - steps: - - name: Check out the codebase. - uses: actions/checkout@v4 - - name: Downloading msi build uses: actions/download-artifact@v4 with: @@ -252,7 +199,7 @@ jobs: $msi_path = Resolve-Path .\dist\splunk-otel-collector*.msi Test-Path $msi_path Write-Host "Installing $msi_path ..." - $process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log ${{ matrix.install-properties.install }}" + $process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log" if ($process.ExitCode -ne 0) { throw "MSI installation failed with exit code $($process.ExitCode)" } @@ -261,15 +208,21 @@ jobs: if: ${{ failure() }} run: Get-Content msi-install.log + - name: Set environment variables required to start the collector service + run: | + $ErrorActionPreference = 'Stop' + [Environment]::SetEnvironmentVariable("SPLUNK_ACCESS_TOKEN", "123456e", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_API_URL", "https://non.existent.for.tests", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_HEC_TOKEN", "098765e", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_HEC_URL", "https://non.existent.for.tests/v1/log", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_INGEST_URL", "https://non.existent.for.tests", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_TRACE_URL", "https://non.existent.for.tests/v2/trace", "Machine") + [Environment]::SetEnvironmentVariable("SPLUNK_BUNDLE_DIR", "%ProgramFiles%\Splunk\OpenTelemetry", "Machine") + - name: Start the collector service run: Start-Service splunk-otel-collector - - name: Check registry expectations - run: | - $ErrorActionPreference = 'Stop' - & ${{ github.workspace }}\.github\workflows\scripts\win-test-services.ps1 ${{ matrix.install-properties.expected }} - - name: Stop the collector service run: Stop-Service splunk-otel-collector diff --git a/Makefile b/Makefile index fb9784e137..4e14b11d69 100644 --- a/Makefile +++ b/Makefile @@ -214,13 +214,17 @@ endif docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) -e JMX_METRIC_GATHERER_RELEASE=$(JMX_METRIC_GATHERER_RELEASE) otelcol-fpm .PHONY: msi -msi: +msi: msi-custom-actions ifneq ($(SKIP_COMPILE), true) $(MAKE) binaries-windows_amd64 endif test -f ./dist/agent-bundle_windows_amd64.zip || (echo "./dist/agent-bundle_windows_amd64.zip not found! Either download a pre-built bundle to ./dist/, or run './internal/signalfx-agent/bundle/scripts/windows/make.ps1 bundle' on a windows host and copy it to ./dist/." && exit 1) ./internal/buildscripts/packaging/msi/build.sh "$(VERSION)" "$(DOCKER_REPO)" "$(JMX_METRIC_GATHERER_RELEASE)" +.PHONY: msi-custom-actions +msi-custom-actions: + dotnet publish ./internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj -c Release -o ./internal/buildscripts/packaging/msi/SplunkCustomActions/bin/Release + .PHONY: update-examples update-examples: cd examples && $(MAKE) update-examples diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs b/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs index 38eb4dc5f8..b9bf5ceda4 100644 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs +++ b/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs @@ -32,6 +32,15 @@ public static ActionResult CheckLaunchConditions(Session session) return ActionResult.Success; } + // If SPLUNK_ACCESS_TOKEN is not set, fail the check. + var splunkToken = session["SPLUNK_ACCESS_TOKEN"]; + session.Log("Info: SPLUNK_ACCESS_TOKEN=" + splunkToken); + if (string.IsNullOrWhiteSpace(splunkToken)) + { + LogAndShowError(session, "SPLUNK_ACCESS_TOKEN must be specified."); + return ActionResult.Failure; + } + // If SPLUNK_SETUP_COLLECTOR_MODE is not one of the expected values, fail the check. var collectorMode = session["SPLUNK_SETUP_COLLECTOR_MODE"] ?? string.Empty; session.Log("Info: SPLUNK_SETUP_COLLECTOR_MODE=" + collectorMode); @@ -44,6 +53,29 @@ public static ActionResult CheckLaunchConditions(Session session) return ActionResult.Success; } + /// + /// Set the values of "automatic" properties, i.e. properties that require some logic to be set. + /// + /// Carries information about the current installation session. + /// An action result that indicates success or failure of the operation. + [CustomAction] + public static ActionResult SetAutomaticProperties(Session session) + { + var listenInterface = session["SPLUNK_SETUP_LISTEN_INTERFACE"]; + if (string.IsNullOrWhiteSpace(listenInterface)) + { + var collectorMode = session["SPLUNK_SETUP_COLLECTOR_MODE"]; + session["SPLUNK_SETUP_LISTEN_INTERFACE"] = collectorMode switch { + "agent" => "127.0.0.1", + "gateway" => "0.0.0.0", + // It is an internal error if it doesn't match any of the expected values. + _ => throw new InvalidOperationException("SPLUNK_SETUP_COLLECTOR_MODE must be either 'agent' or 'gateway'.") + }; + } + + return ActionResult.Success; + } + /// /// Helper to log and show error messages if the installation fails. /// When running in silent mode no dialog is shown. @@ -59,3 +91,8 @@ private static void LogAndShowError(Session session, string message) } } } + +/* +dotnet publish SplunkCustomActions.csproj --use-current-runtime -c Release -o bin\ +MakeSfxCA.exe $PWD\bin\SplunkCustomActions.CA.dll 'C:\Program Files (x86)\WiX Toolset v3.14\SDK\x64\sfxca.dll' $PWD\bin\SplunkCustomActions.dll $PWD\bin\Microsoft.Deployment.WindowsInstaller.dll $PWD\CustomAction.config +*/ diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj b/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj index 4d080eb471..eaf52d2989 100644 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj +++ b/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj @@ -7,22 +7,11 @@ SplunkCustomActions net462 Latest - $(HOME)/.nuget/packages/wix/3.14.0/tools/sdk - $(MSBuildProgramFiles32)\Wix Toolset v3.14\SDK - - - - - - - - - - $(WindowsInstallerAssembliesDll)/Microsoft.Deployment.WindowsInstaller.dll + $(MSBuildProgramFiles32)\WiX Toolset v3.14\SDK\Microsoft.Deployment.WindowsInstaller.dll diff --git a/internal/buildscripts/packaging/msi/msi-builder/build.sh b/internal/buildscripts/packaging/msi/msi-builder/build.sh index ff5318f9f1..162383656c 100755 --- a/internal/buildscripts/packaging/msi/msi-builder/build.sh +++ b/internal/buildscripts/packaging/msi/msi-builder/build.sh @@ -162,30 +162,33 @@ parse_args_and_build() { if [ -z "$skip_build_dir_removal" ]; then unzip -d "$files_dir" "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" rm -f "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" + + download_jmx_metric_gatherer "$jmx_metric_gatherer_release" "$build_dir" else - echo "Skipping unzipping agent bundle" + echo "Skipping unzipping agent bundle and downloading JMX Metric Gatherer" fi jmx_metrics_jar="${build_dir}/opentelemetry-java-contrib-jmx-metrics.jar" - if [ -f "${jmx_metrics_jar}" ]; then - echo "JMX Metric Gatherer already downloaded" - else - download_jmx_metric_gatherer "$jmx_metric_gatherer_release" "$build_dir" - fi cd ${WORK_DIR} - configFilesWsx="${build_dir}/configfiles.wsx" - heat dir "$files_dir" -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out "${configFilesWsx//\//\\}" + heat dir "$files_dir" -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out "${configFilesWsx}" configFilesWixObj="${build_dir}/configfiles.wixobj" - candle -arch x64 -out "${configFilesWixObj//\//\\}" "${configFilesWsx//\//\\}" + candle -arch x64 -out "${configFilesWixObj}" "${configFilesWsx}" collectorWixObj="${build_dir}/splunk-otel-collector.wixobj" - candle -arch x64 -out "${collectorWixObj//\//\\}" -dVersion="$version" -dOtelcol="$otelcol" -dJmxMetricsJar="$jmx_metrics_jar" "${WXS_PATH//\//\\}" + candle -arch x64 -out "${collectorWixObj}" -dVersion="$version" -dOtelcol="$otelcol" -dJmxMetricsJar="$jmx_metrics_jar" "${WXS_PATH}" + + customActionsDll="${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/SplunkCustomActions.CA.dll" + MakeSfxCA "${customActionsDll}" \ + "$WIX\SDK\x64\sfxca.dll" \ + "${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/SplunkCustomActions.dll" \ + "${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/Microsoft.Deployment.WindowsInstaller.dll" \ + "${MSI_SRC_DIR}/SplunkCustomActions/CustomAction.config" msi="${build_dir}/${msi_name}" - light -ext WixUtilExtension.dll -sval -out "${msi//\//\\}" -b "${files_dir//\//\\}" "${collectorWixObj//\//\\}" "${configFilesWixObj//\//\\}" + light -ext WixUtilExtension.dll -sval -out "${msi}" -b "${files_dir}" "${collectorWixObj}" "${configFilesWixObj}" mkdir -p $output cp "${msi}" "${output}/${msi_name}" diff --git a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs index 7046aa95b4..ac724e47ff 100644 --- a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs +++ b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs @@ -12,6 +12,7 @@ + @@ -37,18 +38,18 @@ - + + NOT SPLUNK_HEC_TOKEN NOT SPLUNK_CONFIG NOT SPLUNK_API_URL NOT SPLUNK_INGEST_URL - - NOT SPLUNK_HEC_URL - NOT SPLUNK_TRACE_URL - NOT SPLUNK_BUNDLE_DIR + NOT SPLUNK_HEC_URL + NOT SPLUNK_TRACE_URL + NOT SPLUNK_BUNDLE_DIR @@ -82,15 +83,11 @@ - SPLUNK_ACCESS_TOKEN=[SPLUNK_ACCESS_TOKEN] - SPLUNK_HEC_TOKEN=[SPLUNK_HEC_TOKEN] - SPLUNK_CONFIG=[SPLUNK_CONFIG] + SPLUNK_CONFIG= SPLUNK_API_URL=[SPLUNK_API_URL] SPLUNK_INGEST_URL=[SPLUNK_INGEST_URL] SPLUNK_HEC_URL=[SPLUNK_HEC_URL] SPLUNK_TRACE_URL=[SPLUNK_TRACE_URL] - SPLUNK_BUNDLE_DIR=[SPLUNK_BUNDLE_DIR] - SPLUNK_REALM=[SPLUNK_REALM] From efbc28dbfdf91f7eef6526e8fa3bab70fc03efd7 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 3/7] Revert "Make MSI more capable during setup" This reverts commit ab04b54fb28a2f35b49407ce4d0186f4e48b6bb9. --- .gitignore | 4 +- Makefile | 6 +- .../msi/SplunkCustomActions/.gitignore | 3 - .../SplunkCustomActions/CustomAction.config | 6 -- .../msi/SplunkCustomActions/CustomActions.cs | 98 ------------------- .../SplunkCustomActions.csproj | 18 ---- .../SplunkCustomActions.sln | 24 ----- internal/buildscripts/packaging/msi/make.ps1 | 2 +- .../packaging/msi/msi-builder/build.sh | 59 +++++------ .../packaging/msi/splunk-otel-collector.wxs | 62 +++--------- .../bundle/scripts/windows/make.ps1 | 19 +--- 11 files changed, 44 insertions(+), 257 deletions(-) delete mode 100644 internal/buildscripts/packaging/msi/SplunkCustomActions/.gitignore delete mode 100644 internal/buildscripts/packaging/msi/SplunkCustomActions/CustomAction.config delete mode 100644 internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs delete mode 100644 internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj delete mode 100644 internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.sln diff --git a/.gitignore b/.gitignore index ebcadc8777..ee9afff74a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,13 +24,15 @@ coverage_all.txt coverage_old.txt coverage.html -# Exclude folders used to build MSI locally +# Exclude folders to build MSI locally /build/ /work/ # Wix *.wixobj *.wixpdb +# Exclude source file generated by Wix heat tool +/internal/buildscripts/packaging/msi/configfiles.wxs # Python venv/ diff --git a/Makefile b/Makefile index 4e14b11d69..fb9784e137 100644 --- a/Makefile +++ b/Makefile @@ -214,17 +214,13 @@ endif docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) -e JMX_METRIC_GATHERER_RELEASE=$(JMX_METRIC_GATHERER_RELEASE) otelcol-fpm .PHONY: msi -msi: msi-custom-actions +msi: ifneq ($(SKIP_COMPILE), true) $(MAKE) binaries-windows_amd64 endif test -f ./dist/agent-bundle_windows_amd64.zip || (echo "./dist/agent-bundle_windows_amd64.zip not found! Either download a pre-built bundle to ./dist/, or run './internal/signalfx-agent/bundle/scripts/windows/make.ps1 bundle' on a windows host and copy it to ./dist/." && exit 1) ./internal/buildscripts/packaging/msi/build.sh "$(VERSION)" "$(DOCKER_REPO)" "$(JMX_METRIC_GATHERER_RELEASE)" -.PHONY: msi-custom-actions -msi-custom-actions: - dotnet publish ./internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj -c Release -o ./internal/buildscripts/packaging/msi/SplunkCustomActions/bin/Release - .PHONY: update-examples update-examples: cd examples && $(MAKE) update-examples diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/.gitignore b/internal/buildscripts/packaging/msi/SplunkCustomActions/.gitignore deleted file mode 100644 index d880825bdb..0000000000 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore the .NET build outputs -bin/ -obj/ diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomAction.config b/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomAction.config deleted file mode 100644 index f6a34e4866..0000000000 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomAction.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs b/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs deleted file mode 100644 index b9bf5ceda4..0000000000 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright Splunk, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Microsoft.Deployment.WindowsInstaller; - -public class CustomActions -{ - /// - /// Custom action to check if the launch conditions are met. - /// - /// Carries information about the current installation session. - /// An action result that indicates success or failure of the check. - [CustomAction] - public static ActionResult CheckLaunchConditions(Session session) - { - // Check if it is uninstall, if so, skip any check. - var removeValue = session["REMOVE"]; - session.Log("Info: REMOVE=" + removeValue); - if (removeValue == "ALL") - { - return ActionResult.Success; - } - - // If SPLUNK_ACCESS_TOKEN is not set, fail the check. - var splunkToken = session["SPLUNK_ACCESS_TOKEN"]; - session.Log("Info: SPLUNK_ACCESS_TOKEN=" + splunkToken); - if (string.IsNullOrWhiteSpace(splunkToken)) - { - LogAndShowError(session, "SPLUNK_ACCESS_TOKEN must be specified."); - return ActionResult.Failure; - } - - // If SPLUNK_SETUP_COLLECTOR_MODE is not one of the expected values, fail the check. - var collectorMode = session["SPLUNK_SETUP_COLLECTOR_MODE"] ?? string.Empty; - session.Log("Info: SPLUNK_SETUP_COLLECTOR_MODE=" + collectorMode); - if (collectorMode != "agent" && collectorMode != "gateway") - { - LogAndShowError(session, "SPLUNK_SETUP_COLLECTOR_MODE must be either 'agent' or 'gateway'."); - return ActionResult.Failure; - } - - return ActionResult.Success; - } - - /// - /// Set the values of "automatic" properties, i.e. properties that require some logic to be set. - /// - /// Carries information about the current installation session. - /// An action result that indicates success or failure of the operation. - [CustomAction] - public static ActionResult SetAutomaticProperties(Session session) - { - var listenInterface = session["SPLUNK_SETUP_LISTEN_INTERFACE"]; - if (string.IsNullOrWhiteSpace(listenInterface)) - { - var collectorMode = session["SPLUNK_SETUP_COLLECTOR_MODE"]; - session["SPLUNK_SETUP_LISTEN_INTERFACE"] = collectorMode switch { - "agent" => "127.0.0.1", - "gateway" => "0.0.0.0", - // It is an internal error if it doesn't match any of the expected values. - _ => throw new InvalidOperationException("SPLUNK_SETUP_COLLECTOR_MODE must be either 'agent' or 'gateway'.") - }; - } - - return ActionResult.Success; - } - - /// - /// Helper to log and show error messages if the installation fails. - /// When running in silent mode no dialog is shown. - /// - /// Carries information about the current installation session. - /// The error message to log and show. - private static void LogAndShowError(Session session, string message) - { - session.Log("Error: " + message); - if (session["UILevel"] != InstallUIOptions.Silent.ToString()) // 2 is the value for INSTALLUILEVEL_NONE - { - session.Message(InstallMessage.Error, new Record { FormatString = message }); - } - } -} - -/* -dotnet publish SplunkCustomActions.csproj --use-current-runtime -c Release -o bin\ -MakeSfxCA.exe $PWD\bin\SplunkCustomActions.CA.dll 'C:\Program Files (x86)\WiX Toolset v3.14\SDK\x64\sfxca.dll' $PWD\bin\SplunkCustomActions.dll $PWD\bin\Microsoft.Deployment.WindowsInstaller.dll $PWD\CustomAction.config -*/ diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj b/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj deleted file mode 100644 index eaf52d2989..0000000000 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - enable - enable - Library - SplunkCustomActions - net462 - Latest - - - - - $(MSBuildProgramFiles32)\WiX Toolset v3.14\SDK\Microsoft.Deployment.WindowsInstaller.dll - - - - diff --git a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.sln b/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.sln deleted file mode 100644 index 2d9ee27e08..0000000000 --- a/internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.sln +++ /dev/null @@ -1,24 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SplunkCustomActions", "SplunkCustomActions.csproj", "{CA568D0A-57DC-45B5-ADC7-EBBC06B6F580}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CA568D0A-57DC-45B5-ADC7-EBBC06B6F580}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA568D0A-57DC-45B5-ADC7-EBBC06B6F580}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA568D0A-57DC-45B5-ADC7-EBBC06B6F580}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA568D0A-57DC-45B5-ADC7-EBBC06B6F580}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {EFE0FC55-9724-4F64-ABE7-2EF6A3E186BD} - EndGlobalSection -EndGlobal diff --git a/internal/buildscripts/packaging/msi/make.ps1 b/internal/buildscripts/packaging/msi/make.ps1 index 8ce8216d58..c2d23ccded 100644 --- a/internal/buildscripts/packaging/msi/make.ps1 +++ b/internal/buildscripts/packaging/msi/make.ps1 @@ -35,7 +35,7 @@ function Install-Tools { $ProgressPreference = $OriginalPref choco install wixtoolset -y - setx /m PATH "%PATH%;C:\Program Files (x86)\WiX Toolset v3.14\bin" + setx /m PATH "%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin" refreshenv } diff --git a/internal/buildscripts/packaging/msi/msi-builder/build.sh b/internal/buildscripts/packaging/msi/msi-builder/build.sh index 162383656c..ab3fcbd5b0 100755 --- a/internal/buildscripts/packaging/msi/msi-builder/build.sh +++ b/internal/buildscripts/packaging/msi/msi-builder/build.sh @@ -20,15 +20,14 @@ set -euo pipefail PROJECT_DIR=${PROJECT_DIR:-/project} WORK_DIR=${WORK_DIR:-/work} -MSI_SRC_DIR="${PROJECT_DIR}/internal/buildscripts/packaging/msi" -WXS_PATH="${MSI_SRC_DIR}/splunk-otel-collector.wxs" +WXS_PATH="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs" OTELCOL="${PROJECT_DIR}/bin/otelcol_windows_amd64.exe" AGENT_CONFIG="${PROJECT_DIR}/cmd/otelcol/config/collector/agent_config.yaml" GATEWAY_CONFIG="${PROJECT_DIR}/cmd/otelcol/config/collector/gateway_config.yaml" FLUENTD_CONFIG="${PROJECT_DIR}/internal/buildscripts/packaging/fpm/etc/otel/collector/fluentd/fluent.conf" -FLUENTD_CONFD="${MSI_SRC_DIR}/fluentd/conf.d" -SUPPORT_BUNDLE_SCRIPT="${MSI_SRC_DIR}/splunk-support-bundle.ps1" -SPLUNK_ICON="${MSI_SRC_DIR}/splunk.ico" +FLUENTD_CONFD="${PROJECT_DIR}/internal/buildscripts/packaging/msi/fluentd/conf.d" +SUPPORT_BUNDLE_SCRIPT="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk-support-bundle.ps1" +SPLUNK_ICON="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk.ico" OUTPUT_DIR="${PROJECT_DIR}/dist" JMX_METRIC_GATHERER_RELEASE="1.29.0" @@ -41,25 +40,25 @@ Description: By default, the MSI is saved as '${OUTPUT_DIR}/splunk-otel-collector-VERSION-amd64.msi'. OPTIONS: - --otelcol PATH Absolute path to the otelcol exe. + --otelcol PATH: Absolute path to the otelcol exe. Defaults to '$OTELCOL'. - --agent-config PATH Absolute path to the agent config. + --agent-config PATH: Absolute path to the agent config. Defaults to '$AGENT_CONFIG'. - --gateway-config PATH Absolute path to the gateway config. + --gateway-config PATH: Absolute path to the gateway config. Defaults to '$GATEWAY_CONFIG'. - --fluentd PATH Absolute path to the fluentd config. + --fluentd PATH: Absolute path to the fluentd config. Defaults to '$FLUENTD_CONFIG'. - --fluentd-confd PATH Absolute path to the conf.d. + --fluentd-confd PATH: Absolute path to the conf.d. Defaults to '$FLUENTD_CONFD'. - --support-bundle PATH Absolute path to the support bundle script. + --support-bundle PATH: Absolute path to the support bundle script. Defaults to '$SUPPORT_BUNDLE_SCRIPT'. - --jmx-metric-gatherer VERSION The released version of the JMX Metric Gatherer JAR to include (will be downloaded). + --jmx-metric-gatherer VERSION: The released version of the JMX Metric Gatherer JAR to include (will be downloaded). Defaults to '$JMX_METRIC_GATHERER_RELEASE'. - --splunk-icon PATH Absolute path to the splunk.ico. + --splunk-icon PATH: Absolute path to the splunk.ico. Defaults to '$SPLUNK_ICON'. - --output DIR Directory to save the MSI. + --output DIR: Directory to save the MSI. Defaults to '$OUTPUT_DIR'. - --skip-build-dir-removal Skip removing the build directory before building the MSI. + EOH } @@ -74,7 +73,6 @@ parse_args_and_build() { local splunk_icon="$SPLUNK_ICON" local output="$OUTPUT_DIR" local version= - local skip_build_dir_removal= while [ -n "${1-}" ]; do case $1 in @@ -114,9 +112,6 @@ parse_args_and_build() { output="$2" shift 1 ;; - --skip-build-dir-removal) - skip_build_dir_removal=1 - ;; -*) echo "Unknown option '$1'" echo @@ -146,10 +141,8 @@ parse_args_and_build() { files_dir="${build_dir}/msi" msi_name="splunk-otel-collector-${version}-amd64.msi" - if [ -z "$skip_build_dir_removal" && -d "$build_dir" ]; then + if [ -d "$build_dir" ]; then rm -rf "$build_dir" - else - echo "Skipping build directory removal" fi mkdir -p "${files_dir}/fluentd/conf.d" @@ -159,17 +152,16 @@ parse_args_and_build() { cp "$fluentd_config" "${files_dir}/fluentd/td-agent.conf" cp "${fluentd_confd}"/*.conf "${files_dir}/fluentd/conf.d/" - if [ -z "$skip_build_dir_removal" ]; then - unzip -d "$files_dir" "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" - rm -f "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" - - download_jmx_metric_gatherer "$jmx_metric_gatherer_release" "$build_dir" - else - echo "Skipping unzipping agent bundle and downloading JMX Metric Gatherer" - fi + unzip -d "$files_dir" "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" + rm -f "${OUTPUT_DIR}/agent-bundle_windows_amd64.zip" + download_jmx_metric_gatherer "$jmx_metric_gatherer_release" "$build_dir" jmx_metrics_jar="${build_dir}/opentelemetry-java-contrib-jmx-metrics.jar" + # kludge to satisfy relative path in splunk-otel-collector.wxs + mkdir -p ${WORK_DIR}/internal/buildscripts/packaging/msi + cp "${splunk_icon}" "${WORK_DIR}/internal/buildscripts/packaging/msi/splunk.ico" + cd ${WORK_DIR} configFilesWsx="${build_dir}/configfiles.wsx" heat dir "$files_dir" -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out "${configFilesWsx}" @@ -180,13 +172,6 @@ parse_args_and_build() { collectorWixObj="${build_dir}/splunk-otel-collector.wixobj" candle -arch x64 -out "${collectorWixObj}" -dVersion="$version" -dOtelcol="$otelcol" -dJmxMetricsJar="$jmx_metrics_jar" "${WXS_PATH}" - customActionsDll="${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/SplunkCustomActions.CA.dll" - MakeSfxCA "${customActionsDll}" \ - "$WIX\SDK\x64\sfxca.dll" \ - "${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/SplunkCustomActions.dll" \ - "${MSI_SRC_DIR}/SplunkCustomActions/bin/Release/Microsoft.Deployment.WindowsInstaller.dll" \ - "${MSI_SRC_DIR}/SplunkCustomActions/CustomAction.config" - msi="${build_dir}/${msi_name}" light -ext WixUtilExtension.dll -sval -out "${msi}" -b "${files_dir}" "${collectorWixObj}" "${configFilesWixObj}" diff --git a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs index ac724e47ff..c3d2f5d3bb 100644 --- a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs +++ b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs @@ -1,57 +1,14 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NOT SPLUNK_HEC_TOKEN - NOT SPLUNK_CONFIG - NOT SPLUNK_API_URL - NOT SPLUNK_INGEST_URL - NOT SPLUNK_HEC_URL - NOT SPLUNK_TRACE_URL - NOT SPLUNK_BUNDLE_DIR - - @@ -83,11 +40,8 @@ - SPLUNK_CONFIG= + SPLUNK_CONFIG=[CommonAppDataFolder]Splunk\OpenTelemetry Collector\agent_config.yaml SPLUNK_API_URL=[SPLUNK_API_URL] - SPLUNK_INGEST_URL=[SPLUNK_INGEST_URL] - SPLUNK_HEC_URL=[SPLUNK_HEC_URL] - SPLUNK_TRACE_URL=[SPLUNK_TRACE_URL] @@ -120,10 +74,18 @@ - + NOT CONFIG_FILE_EXISTS AND NOT Installed + + + + + + NOT SPLUNK_API_URL + + diff --git a/internal/signalfx-agent/bundle/scripts/windows/make.ps1 b/internal/signalfx-agent/bundle/scripts/windows/make.ps1 index c438eb10eb..26f7843efa 100644 --- a/internal/signalfx-agent/bundle/scripts/windows/make.ps1 +++ b/internal/signalfx-agent/bundle/scripts/windows/make.ps1 @@ -84,18 +84,9 @@ function bundle ( zip_file -src "$buildDir\$BUNDLE_DIR" -dest "$outputDir\$BUNDLE_NAME" } -try { - $OriginalPref = $ProgressPreference - $ProgressPreference = "SilentlyContinue" - if ($REMAINING.length -gt 0) { - $sb = [scriptblock]::create("$Target $REMAINING") - Invoke-Command -ScriptBlock $sb - } else { - &$Target - } -} -finally { - Set-PSDebug -Trace 0 - $ProgressPreference = $OriginalPref +if ($REMAINING.length -gt 0) { + $sb = [scriptblock]::create("$Target $REMAINING") + Invoke-Command -ScriptBlock $sb +} else { + &$Target } - From 7d56cff8b4aba6c0f7ab0aa61e85359e74be5922 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 4/7] Revert "Git ignore the source generated by Wix heat tool" This reverts commit 48eafef2809a6779b5e716a0dac1a141f002ceb6. --- .gitignore | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ee9afff74a..43090e2042 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ dist/ .local/ +# Exclude folders to build MSI locally +/build/ +/work/ + # GoLand IDEA .idea *.iml @@ -24,15 +28,9 @@ coverage_all.txt coverage_old.txt coverage.html -# Exclude folders to build MSI locally -/build/ -/work/ - # Wix *.wixobj *.wixpdb -# Exclude source file generated by Wix heat tool -/internal/buildscripts/packaging/msi/configfiles.wxs # Python venv/ From 23121c00ef3cd87ffef66252f59f4767c4ad012f Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 5/7] Revert "Validated one property and custom actions" This reverts commit 18d548f5d77cf79ce0af59222461a19fe2dc948d. --- .../packaging/msi/splunk-otel-collector.wxs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs index c3d2f5d3bb..e42b1ebe6b 100644 --- a/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs +++ b/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs @@ -41,7 +41,6 @@ SPLUNK_CONFIG=[CommonAppDataFolder]Splunk\OpenTelemetry Collector\agent_config.yaml - SPLUNK_API_URL=[SPLUNK_API_URL] @@ -78,14 +77,5 @@ NOT CONFIG_FILE_EXISTS AND NOT Installed - - - - - - - NOT SPLUNK_API_URL - - From e952a8105757717d4f0f7616f5e9221daf9b04c6 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 6/7] Revert "MSI build.sh script changes to build MSI locally" This reverts commit 469216ef23edb4a839d96fa5403b0c06b2198801. --- .../packaging/msi/msi-builder/build.sh | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/internal/buildscripts/packaging/msi/msi-builder/build.sh b/internal/buildscripts/packaging/msi/msi-builder/build.sh index ab3fcbd5b0..72b33f902e 100755 --- a/internal/buildscripts/packaging/msi/msi-builder/build.sh +++ b/internal/buildscripts/packaging/msi/msi-builder/build.sh @@ -16,19 +16,15 @@ set -euo pipefail -# This script builds the Splunk OpenTelemetry MSI from the project available at ${PROJECT_DIR}. -PROJECT_DIR=${PROJECT_DIR:-/project} -WORK_DIR=${WORK_DIR:-/work} - -WXS_PATH="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs" -OTELCOL="${PROJECT_DIR}/bin/otelcol_windows_amd64.exe" -AGENT_CONFIG="${PROJECT_DIR}/cmd/otelcol/config/collector/agent_config.yaml" -GATEWAY_CONFIG="${PROJECT_DIR}/cmd/otelcol/config/collector/gateway_config.yaml" -FLUENTD_CONFIG="${PROJECT_DIR}/internal/buildscripts/packaging/fpm/etc/otel/collector/fluentd/fluent.conf" -FLUENTD_CONFD="${PROJECT_DIR}/internal/buildscripts/packaging/msi/fluentd/conf.d" -SUPPORT_BUNDLE_SCRIPT="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk-support-bundle.ps1" -SPLUNK_ICON="${PROJECT_DIR}/internal/buildscripts/packaging/msi/splunk.ico" -OUTPUT_DIR="${PROJECT_DIR}/dist" +WXS_PATH="/project/internal/buildscripts/packaging/msi/splunk-otel-collector.wxs" +OTELCOL="/project/bin/otelcol_windows_amd64.exe" +AGENT_CONFIG="/project/cmd/otelcol/config/collector/agent_config.yaml" +GATEWAY_CONFIG="/project/cmd/otelcol/config/collector/gateway_config.yaml" +FLUENTD_CONFIG="/project/internal/buildscripts/packaging/fpm/etc/otel/collector/fluentd/fluent.conf" +FLUENTD_CONFD="/project/internal/buildscripts/packaging/msi/fluentd/conf.d" +SUPPORT_BUNDLE_SCRIPT="/project/internal/buildscripts/packaging/msi/splunk-support-bundle.ps1" +SPLUNK_ICON="/project/internal/buildscripts/packaging/msi/splunk.ico" +OUTPUT_DIR="/project/dist" JMX_METRIC_GATHERER_RELEASE="1.29.0" usage() { @@ -36,7 +32,7 @@ usage() { usage: ${BASH_SOURCE[0]} [OPTIONS] VERSION Description: - Build the Splunk OpenTelemetry MSI from the project available at ${PROJECT_DIR}. + Build the Splunk OpenTelemetry MSI from the project available at /project. By default, the MSI is saved as '${OUTPUT_DIR}/splunk-otel-collector-VERSION-amd64.msi'. OPTIONS: @@ -137,7 +133,7 @@ parse_args_and_build() { fi set -x - build_dir="${WORK_DIR}/build" + build_dir="/work/build" files_dir="${build_dir}/msi" msi_name="splunk-otel-collector-${version}-amd64.msi" @@ -159,21 +155,21 @@ parse_args_and_build() { jmx_metrics_jar="${build_dir}/opentelemetry-java-contrib-jmx-metrics.jar" # kludge to satisfy relative path in splunk-otel-collector.wxs - mkdir -p ${WORK_DIR}/internal/buildscripts/packaging/msi - cp "${splunk_icon}" "${WORK_DIR}/internal/buildscripts/packaging/msi/splunk.ico" + mkdir -p /work/internal/buildscripts/packaging/msi + cp "${splunk_icon}" "/work/internal/buildscripts/packaging/msi/splunk.ico" - cd ${WORK_DIR} + cd /work configFilesWsx="${build_dir}/configfiles.wsx" - heat dir "$files_dir" -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out "${configFilesWsx}" + heat dir "$files_dir" -srd -sreg -gg -template fragment -cg ConfigFiles -dr INSTALLDIR -out "${configFilesWsx//\//\\}" configFilesWixObj="${build_dir}/configfiles.wixobj" - candle -arch x64 -out "${configFilesWixObj}" "${configFilesWsx}" + candle -arch x64 -out "${configFilesWixObj//\//\\}" "${configFilesWsx//\//\\}" collectorWixObj="${build_dir}/splunk-otel-collector.wixobj" - candle -arch x64 -out "${collectorWixObj}" -dVersion="$version" -dOtelcol="$otelcol" -dJmxMetricsJar="$jmx_metrics_jar" "${WXS_PATH}" + candle -arch x64 -out "${collectorWixObj//\//\\}" -dVersion="$version" -dOtelcol="$otelcol" -dJmxMetricsJar="$jmx_metrics_jar" "${WXS_PATH//\//\\}" msi="${build_dir}/${msi_name}" - light -ext WixUtilExtension.dll -sval -out "${msi}" -b "${files_dir}" "${collectorWixObj}" "${configFilesWixObj}" + light -ext WixUtilExtension.dll -sval -out "${msi//\//\\}" -b "${files_dir//\//\\}" "${collectorWixObj//\//\\}" "${configFilesWixObj//\//\\}" mkdir -p $output cp "${msi}" "${output}/${msi_name}" From 48e456ba72bb75a4cfb52039e296b3b9e805cba9 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Wed, 27 Mar 2024 17:41:30 -0700 Subject: [PATCH 7/7] Revert "Exclude folders to build MSI locally" This reverts commit 541618502872fae309427761313c3ff9dcf38446. --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index 43090e2042..9ebd465be2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,6 @@ dist/ .local/ -# Exclude folders to build MSI locally -/build/ -/work/ - # GoLand IDEA .idea *.iml