Skip to content

Commit

Permalink
Update wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanotti committed Mar 7, 2025
1 parent 2f70836 commit f220655
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ $otelSDKInstallVersion = Get-OpenTelemetryInstallVersion

if ($uninstall) {
if ($otelSDKInstallVersion) {
# TODO: Is it necessary to uninstall for IIS specifically?
Write-Host "Uninstalling Splunk Distribution of OpenTelemetry .NET ..."
Uninstall-OpenTelemetryCore

$w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue
$was = Get-Service -name "WAS" -ErrorAction SilentlyContinue
if ($w3svc -And $was) {
Write-Host "Unregistering OpenTelemetry for IIS ..."
Unregister-OpenTelemetryForIIS
}

Write-Host "Splunk Distribution of OpenTelemetry .NET uninstalled successfully"
} else {
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is not installed"
Expand All @@ -40,6 +47,10 @@ if ($uninstall) {
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is already installed. OpenTelelemetry .NET SDK version: $otelSDKInstallVersion"
} else {
Write-Host "Installing Splunk Distribution of OpenTelemetry .NET ..."

# Avoid issues with NGEN assemblies by forcing SingleDomain mode.
RUN Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\.NETFramework" -Name "LoaderOptimization" -Value 1 -Type DWord

$zipPath = Join-Path $scriptDir "splunk-opentelemetry-dotnet-windows.zip"
Install-OpenTelemetryCore -LocalPath $zipPath

Expand Down

0 comments on commit f220655

Please sign in to comment.