File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ Set-RestrictedAcl -Path $acDataDir
127127Write-Host " Copying New Relic Agent Control program files..."
128128Copy-Item - Path " .\newrelic-agent-control.exe" - Destination " $acProgramFilesDir "
129129
130+ # Copy uninstall script if it exists
131+ if (Test-Path " .\uninstall.ps1" ) {
132+ Copy-Item - Path " .\uninstall.ps1" - Destination " $acProgramFilesDir \uninstall.ps1"
133+ Write-Host " Uninstall script copied to $acProgramFilesDir "
134+ }
135+
130136# Generate configuration based on inputs
131137$localConfigPath = Join-Path $acLocalConfigDir ' local_config.yaml'
132138
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Adm
1111$serviceName = " newrelic-agent-control"
1212$acDir = [IO.Path ]::Combine($env: ProgramFiles , ' New Relic\newrelic-agent-control' )
1313$acExecPath = [IO.Path ]::Combine($acDir , ' newrelic-agent-control.exe' )
14+ $acKeysDir = [IO.Path ]::Combine($acDir , ' keys' )
1415
1516$markerPath = [IO.Path ]::Combine($acDir , ' .nr-ac-install' )
1617
@@ -33,6 +34,12 @@ if (Test-Path $acExecPath) {
3334 Remove-Item - Path $acExecPath - Force
3435}
3536
37+ # Remove the keys directory if exists
38+ if (Test-Path $acKeysDir ) {
39+ Write-Host " Removing keys directory..."
40+ Remove-Item - Path $acKeysDir - Recurse - Force
41+ }
42+
3643if (Test-Path $markerPath ) {
3744 Write-Host " Removing installation marker file..."
3845 Remove-Item - Path $markerPath - Force
You can’t perform that action at this time.
0 commit comments