Skip to content

Commit f220655

Browse files
committed
Update wrapper script
1 parent 2f70836 commit f220655

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin/installer-wrapper.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ $otelSDKInstallVersion = Get-OpenTelemetryInstallVersion
2828

2929
if ($uninstall) {
3030
if ($otelSDKInstallVersion) {
31-
# TODO: Is it necessary to uninstall for IIS specifically?
3231
Write-Host "Uninstalling Splunk Distribution of OpenTelemetry .NET ..."
3332
Uninstall-OpenTelemetryCore
33+
34+
$w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue
35+
$was = Get-Service -name "WAS" -ErrorAction SilentlyContinue
36+
if ($w3svc -And $was) {
37+
Write-Host "Unregistering OpenTelemetry for IIS ..."
38+
Unregister-OpenTelemetryForIIS
39+
}
40+
3441
Write-Host "Splunk Distribution of OpenTelemetry .NET uninstalled successfully"
3542
} else {
3643
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is not installed"
@@ -40,6 +47,10 @@ if ($uninstall) {
4047
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is already installed. OpenTelelemetry .NET SDK version: $otelSDKInstallVersion"
4148
} else {
4249
Write-Host "Installing Splunk Distribution of OpenTelemetry .NET ..."
50+
51+
# Avoid issues with NGEN assemblies by forcing SingleDomain mode.
52+
RUN Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\.NETFramework" -Name "LoaderOptimization" -Value 1 -Type DWord
53+
4354
$zipPath = Join-Path $scriptDir "splunk-opentelemetry-dotnet-windows.zip"
4455
Install-OpenTelemetryCore -LocalPath $zipPath
4556

0 commit comments

Comments
 (0)