Skip to content

Commit

Permalink
Add missing framework references for WinUI.
Browse files Browse the repository at this point in the history
 * Added missing framework references
 * Updated license headers on PowerShell files
 * Included a script to install required Windows SDK
  • Loading branch information
Haplois committed Jun 25, 2021
1 parent 3d827a6 commit d754ca9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
40 changes: 12 additions & 28 deletions scripts/Install-WindowsSDK.ps1
@@ -1,34 +1,18 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

function Write-Log ([string] $message, $messageColor = "Green") {
$currentColor = $Host.UI.RawUI.ForegroundColor
$Host.UI.RawUI.ForegroundColor = $messageColor
if ($message) {
Write-Output "... $message"
}
$Host.UI.RawUI.ForegroundColor = $currentColor
}

Push-Location
try {
Write-Log "Downloading the Windows SDK 10.0.14393.795..."
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing
Write-Host "Downloading Windows SDK 10.0.14393.795..." -ForegroundColor "Green"
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing

Write-Log "Installing the Windows SDK, setup might request elevation please approve."
$process = Start-Process -Wait sdksetup.exe -ArgumentList "/quiet", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" -PassThru
Remove-Item sdksetup.exe -Force
Write-Host "Installing Windows SDK, setup might request elevation please approve." -ForegroundColor "Green"
$process = Start-Process -Wait sdksetup.exe -ArgumentList "/quiet", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" -PassThru
Remove-Item sdksetup.exe -Force

if($process.ExitCode -eq 0)
{
Write-Log "Done"
}
else
{
Write-Log "Failed (Exit code: $($process.ExitCode))" -messageColor "Red"
}
if($process.ExitCode -eq 0)
{
Write-Host "Done" -ForegroundColor "Green"
}
finally {
Pop-Location
}

else
{
Write-Error "Failed to install Windows SDK (Exit code: $($process.ExitCode))"
}
5 changes: 5 additions & 0 deletions src/TestFramework/Extension.WinUI/Extension.WinUI.csproj
Expand Up @@ -20,6 +20,11 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\TestFramework\MSTest.Core\MSTest.Core.csproj" />
Expand Down

0 comments on commit d754ca9

Please sign in to comment.