From ae4157d08634d65a3d48782848cccbb656dc0685 Mon Sep 17 00:00:00 2001
From: Nate McMaster <natemcmaster@users.noreply.github.com>
Date: Thu, 16 May 2019 08:58:49 -0700
Subject: [PATCH] Enable Windows 7 IIS Express tests (#10168)

* Enable Windows 7 IIS tests
* Detect if localdb is already installed
---
 eng/helix/content/mssql/InstallSqlServerLocalDB.ps1 | 9 ++++++++-
 eng/targets/Helix.Common.props                      | 3 +--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/eng/helix/content/mssql/InstallSqlServerLocalDB.ps1 b/eng/helix/content/mssql/InstallSqlServerLocalDB.ps1
index f4c5995f702..5af8fc5dac0 100644
--- a/eng/helix/content/mssql/InstallSqlServerLocalDB.ps1
+++ b/eng/helix/content/mssql/InstallSqlServerLocalDB.ps1
@@ -7,7 +7,9 @@
     https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2016
     https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2016
 #>
-
+param(
+    [switch]$Force
+)
 $ErrorActionPreference = 'Stop'
 $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
 Set-StrictMode -Version 1
@@ -15,6 +17,11 @@ Set-StrictMode -Version 1
 $intermedateDir = "$PSScriptRoot\obj"
 mkdir $intermedateDir -ErrorAction Ignore | Out-Null
 
+if (-not $Force -and (Test-Path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SqlLocalDB13')) {
+    Write-Host "SQL Server 2016 Express LocalDB is already installed. Exiting without action. Call this script again with -Force to run the installation anyways."
+    exit 0
+}
+
 Write-Host "Installing SQL Server 2016 Express LocalDB" -f Magenta
 
 # Download SqlLocalDB.msi.
diff --git a/eng/targets/Helix.Common.props b/eng/targets/Helix.Common.props
index 6f66e101d16..f4cd02ece05 100644
--- a/eng/targets/Helix.Common.props
+++ b/eng/targets/Helix.Common.props
@@ -33,8 +33,7 @@
 
     <HelixAvailableTargetQueue Include="Windows.10.Amd64.EnterpriseRS3.ASPNET.Open" Platform="Windows" />
     <HelixAvailableTargetQueue Include="Windows.81.Amd64.Open" Platform="Windows" />
-    <!-- Disabled until https://github.com/dotnet/core-eng/issues/5506 is resolved -->
-    <!-- <HelixAvailableTargetQueue Condition="'$(IsWindowsOnlyTest)' == 'true'" Include="Windows.7.Amd64.Open" /> -->
+    <HelixAvailableTargetQueue Include="Windows.7.Amd64.Open" Platform="Windows" />
 
     <HelixContent Include="$(RepoRoot)src\Servers\IIS\tools\update_schema.ps1" />
     <HelixContent Include="$(RepoRoot)src\Servers\IIS\tools\UpdateIISExpressCertificate.ps1" />
-- 
GitLab