From 85a64abe92b3c541d44d2d9d1b9027ce0377d786 Mon Sep 17 00:00:00 2001 From: Daniel Covington Date: Tue, 27 Oct 2026 14:51:15 -0400 Subject: [PATCH] Allow extra IIS bindings when adopting existing site The installer now requires the expected binding to be present rather than the only binding, so www and localhost bindings are preserved. Co-Authored-By: Claude Sonnet 5.5 --- scripts/install-iis-release.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install-iis-release.ps1 b/scripts/install-iis-release.ps1 index bef4b5a..eb23189 100644 --- a/scripts/install-iis-release.ps1 +++ b/scripts/install-iis-release.ps1 @@ -200,8 +200,10 @@ function Get-TargetState { } $bindings = @($site.Bindings.Collection) $expectedBinding = Get-BindingInformation - if ($bindings.Count -ne 1 -or $bindings[0].protocol -ne 'http' -or $bindings[0].bindingInformation -ne $expectedBinding) { - throw "Existing target binding does not exactly match http/$expectedBinding. Refusing adoption or binding changes." + # Extra bindings (for example www or localhost) are left untouched; the expected binding must be present. + $hasExpectedBinding = @($bindings | Where-Object { $_.protocol -eq 'http' -and $_.bindingInformation -eq $expectedBinding }).Count -gt 0 + if (-not $hasExpectedBinding) { + throw "Existing target does not have the expected binding http/$expectedBinding. Refusing adoption or binding changes." } $physicalPath = Get-NormalizedPath $site.physicalPath $releasesRoot = Join-Path $DeployRoot 'releases'