diff --git a/src/Setup/PowerShell/install.ps1 b/src/Setup/PowerShell/install.ps1 index 8178834faf780f16b4cd24052de2a471c08ebe89..9e3fbbf48f5043e2da94fd1a6f889d96c4e9bba6 100644 --- a/src/Setup/PowerShell/install.ps1 +++ b/src/Setup/PowerShell/install.ps1 @@ -1,13 +1,22 @@ param($installPath, $toolsPath, $package, $project) -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve +if($project.Object.SupportsPackageDependencyResolution) +{ + if($project.Object.SupportsPackageDependencyResolution()) + { + # Do not install analyzers via install.ps1, instead let the project system handle it. + return + } +} + +$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve foreach($analyzersPath in $analyzersPaths) { - # Install the language agnostic analyzers. if (Test-Path $analyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) + # Install the language agnostic analyzers. + foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { @@ -38,7 +47,7 @@ foreach($analyzersPath in $analyzersPaths) $languageAnalyzersPath = join-path $analyzersPath $languageFolder if (Test-Path $languageAnalyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { diff --git a/src/Setup/PowerShell/uninstall.ps1 b/src/Setup/PowerShell/uninstall.ps1 index 9130bcb5080657c30e1f1544566b9886653fc320..7d9c8cc1dc54c650d0232a45501b594820622945 100644 --- a/src/Setup/PowerShell/uninstall.ps1 +++ b/src/Setup/PowerShell/uninstall.ps1 @@ -1,13 +1,22 @@ param($installPath, $toolsPath, $package, $project) -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve +if($project.Object.SupportsPackageDependencyResolution) +{ + if($project.Object.SupportsPackageDependencyResolution()) + { + # Do not uninstall analyzers via uninstall.ps1, instead let the project system handle it. + return + } +} + +$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve foreach($analyzersPath in $analyzersPaths) { # Uninstall the language agnostic analyzers. if (Test-Path $analyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { @@ -38,7 +47,7 @@ foreach($analyzersPath in $analyzersPaths) $languageAnalyzersPath = join-path $analyzersPath $languageFolder if (Test-Path $languageAnalyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) {