Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevCheck -CheckDependencies exitcode. Fix dependencies #4866

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@

#include "pch.h"
#include "Task.h"
#if __has_include("Task.g.cpp")
#include "Task.g.cpp"
#endif

using namespace winrt;
using namespace winrt::Windows::ApplicationModel::Background;
using namespace winrt::Windows::Storage;

namespace winrt::Microsoft::Windows::ApplicationModel::Background::UniversalBGTask::implementation
{
inline constexpr CLSID IID_IBackgroundTask = { 2098451764, 64786, 17358, 140, 34, 234, 31, 241, 60, 6, 223 };
inline constexpr CLSID IID_IBackgroundTask{ 2098451764, 64786, 17358, 140, 34, 234, 31, 241, 60, 6, 223 };

void Task::Run(winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance taskInstance)
{
winrt::hstring lookupStr = winrt::to_hstring(taskInstance.Task().TaskId());
ApplicationDataContainer localSettings = ApplicationData::Current().LocalSettings();
auto values = localSettings.Values();
auto lookupobj = values.Lookup(lookupStr);
winrt::guid comClsId = winrt::unbox_value<winrt::guid>(lookupobj);
winrt::hstring lookupKey{ winrt::to_hstring(taskInstance.Task().TaskId()) };
ApplicationDataContainer localSettings{ ApplicationData::Current().LocalSettings() };
auto values{ localSettings.Values() };
auto lookupValue{ values.Lookup(lookupKey) };
winrt::guid comClsId{ winrt::unbox_value<winrt::guid>(lookupValue) };

winrt::Windows::ApplicationModel::Background::IBackgroundTask bgTask = nullptr;
winrt::hresult hr = CoCreateInstance(comClsId, nullptr, CLSCTX_LOCAL_SERVER, IID_IBackgroundTask, reinterpret_cast<void**>(&bgTask));
winrt::Windows::ApplicationModel::Background::IBackgroundTask bgTask;
winrt::hresult hr{ CoCreateInstance(comClsId, nullptr, CLSCTX_LOCAL_SERVER, IID_IBackgroundTask, reinterpret_cast<void**>(&bgTask)) };
bgTask.Run(taskInstance);
}
}
6 changes: 4 additions & 2 deletions dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.idl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.



namespace Microsoft.Windows.ApplicationModel.Background.UniversalBGTask
{
[contractversion(1)]
apicontract UniversalBGTaskContract{};

[contract(UniversalBGTaskContract, 1)]
[default_interface]
runtimeclass Task : Windows.ApplicationModel.Background.IBackgroundTask
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; Copyright (c) Microsoft Corporation. All rights reserved.
; Licensed under the MIT License. See LICENSE in the project root for license information.

EXPORTS
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props')" />
<Import Project="..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props')" />
<Import Project="..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{0c4405e6-029e-4363-8273-a9e1fcf057de}</ProjectGuid>
<RootNamespace>Microsoft.Windows.ApplicationModel.Background.UniversalBGTask</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<AppContainerApplication>false</AppContainerApplication>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<DesktopCompatible>true</DesktopCompatible>
<UseWinUI>true</UseWinUI>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -44,12 +28,22 @@
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{0c4405e6-029e-4363-8273-a9e1fcf057de}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Microsoft.Windows.ApplicationModel.Background.UniversalBGTask</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<CppWinRTModernIDL>true</CppWinRTModernIDL>
<CppWinRTFastAbi>true</CppWinRTFastAbi>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<CppWinRTNamespaceMergeDepth>9</CppWinRTNamespaceMergeDepth>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
<DesktopCompatible>true</DesktopCompatible>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -91,15 +85,9 @@
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<SubSystem>Windows</SubSystem>
<ModuleDefinitionFile>WindowsAppRuntime_UniversalBGTaskDLL.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
Expand All @@ -112,10 +100,6 @@
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand All @@ -140,33 +124,20 @@
<None Include="packages.config" />
<None Include="WindowsAppRuntime_UniversalBGTaskDLL.def" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WindowsAppRuntime_UniversalBGTaskDLL.rc">
<AdditionalIncludeDirectories>$(RepoRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\..\Packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\Packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\..\Packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NugetPackageDirectory)\Microsoft.Windows.CppWinRT.$(MicrosoftWindowsCppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
</Project>
5 changes: 1 addition & 4 deletions dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.230706.1" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.756" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.5.240311000" targetFramework="native" />
</packages>
</packages>
22 changes: 1 addition & 21 deletions dev/WindowsAppRuntime_UniversalBGTaskDLL/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,9 @@
// Licensed under the MIT License.

#pragma once
#include <windows.h>
#include <unknwn.h>
#include <restrictederrorinfo.h>
#include <hstring.h>

// Undefine GetCurrentTime macro to prevent
// conflict with Storyboard::GetCurrentTime
#undef GetCurrentTime
#include <windows.h>

#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Microsoft.UI.Composition.h>
#include <winrt/Microsoft.UI.Xaml.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
#include <winrt/Microsoft.UI.Xaml.Data.h>
#include <winrt/Microsoft.UI.Xaml.Interop.h>
#include <winrt/Microsoft.UI.Xaml.Markup.h>
#include <winrt/Microsoft.UI.Xaml.Media.h>
#include <winrt/Microsoft.UI.Xaml.Navigation.h>
#include <winrt/Microsoft.UI.Xaml.Shapes.h>
#include <winrt/Microsoft.UI.Dispatching.h>
#include <wil/cppwinrt_helpers.h>
27 changes: 0 additions & 27 deletions dev/WindowsAppRuntime_UniversalBGTaskDLL/readme.txt

This file was deleted.

1 change: 1 addition & 0 deletions docs/Coding-Guidelines/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ or via the browser:
* Windows 10 SDK (10.0.20348.0)
* Windows 10 SDK (10.0.22000.0)
* Windows 10 SDK (10.0.22621.0)
* Windows 10 SDK (10.0.26100.0)
* Windows Universal C Runtime
* and more! See [VisualStudio2022.vsconfig](https://github.com/microsoft/WindowsAppSDK/blob/develop/docs/Coding-Guidelines/VisualStudio2022.vsconfig) for the complete list

Expand Down
3 changes: 2 additions & 1 deletion docs/Coding-Guidelines/VisualStudio2022.vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Graphics.Tools",
"Microsoft.VisualStudio.Component.VC.DiagnosticTools",
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
"Microsoft.ComponentGroup.Blend",
"Microsoft.VisualStudio.Component.DotNetModelBuilder",
Expand All @@ -57,7 +56,9 @@
"Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
"Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
"Microsoft.VisualStudio.Component.VC.ASAN",
"Microsoft.VisualStudio.Component.Windows11SDK.26100",
"Microsoft.VisualStudio.Component.Windows11SDK.22000",
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64EC",
"Microsoft.VisualStudio.Workload.NativeDesktop",
Expand Down
25 changes: 17 additions & 8 deletions tools/DevCheck/DevCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

$global:issues = 0
$global:issues_test_certificate_thumbprint_not_found = 0

$global:isadmin = $null

Expand All @@ -171,6 +172,11 @@ $global:vswhere_url = ''

$global:dependency_paths = ('dev', 'test', 'installer', 'tools')

function Get-Issues
{
return $global:issues + $global:issues_test_certificate_thumbprint_not_found
}

function Get-SettingsFile
{
if ([string]::IsNullOrEmpty($SettingsFile))
Expand Down Expand Up @@ -700,7 +706,7 @@ function Test-WindowsSDKInstall
}
elseif ($InstallWindowsSDK -eq $true)
{
Write-Warning "WARNING: Windows SDK $($version) not found. Installing..."
Write-Warning "Windows SDK $($version) not found. Installing..."
$null = Install-WindowsSDK $version $url
}
else
Expand All @@ -723,7 +729,7 @@ function Test-DevTestPfx
if (-not(Test-Path -Path $pfx_thumbprint -PathType Leaf))
{
Write-Host "Test certificate thumbprint $pfx_thumbprint...Not Found"
$global:issues++
$global:issues_test_certificate_thumbprint_not_found = 1
return $false
}

Expand Down Expand Up @@ -841,7 +847,7 @@ function Repair-DevTestPfx
$pfx = Join-Path $user 'winappsdk.certificate.test.pfx'
$export_pfx = Export-PfxCertificate -Cert $cert_personal -FilePath $pfx -Password $password

# Delete the personal certiicate
# Delete the personal certificate
Remove-Item -Path $cert_personal -DeleteKey

$ok = $true
Expand Down Expand Up @@ -997,12 +1003,12 @@ function Test-TAEFServiceVersion

if ($cmp -lt 0)
{
Write-Warning "WARNING: TAEF service older than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)"
Write-Warning "TAEF service older than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)"
return 'OlderVersion'
}
elseif ($cmp -gt 0)
{
Write-Warning "WARNING: TAEF service newer than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)"
Write-Warning "TAEF service newer than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)"
return 'NewerVersion'
}
else
Expand Down Expand Up @@ -1617,7 +1623,7 @@ if (($CheckAll -ne $false) -Or ($CheckVisualStudio -ne $false))
$null = Test-VisualStudioComponents
}
$null = Test-WindowsSDKInstall '10.0.17763.0' [uri]'https://go.microsoft.com/fwlink/p/?LinkID=2033908'
#TODO Uncomment to require new SDK: $null = Test-WindowsSDKInstall '10.0.26100.0' [uri]'https://go.microsoft.com/fwlink/?linkid=2272610'
$null = Test-WindowsSDKInstall '10.0.26100.0' [uri]'https://go.microsoft.com/fwlink/?linkid=2272610'
}

if (($CheckAll -ne $false) -Or ($CheckTestPfx -ne $false))
Expand Down Expand Up @@ -1706,12 +1712,15 @@ if (($RemoveAll -ne $false) -Or ($RemoveTestPfx -ne $false))
$null = Remove-DevTestPfx
}

if ($global:issues -eq 0)
$issues_count = Get-Issues
if ($issues_count -eq 0)
{
Write-Output "Coding time!"
Exit 0
}
else
{
$n = $global:issues
$n = $issues_count
Write-Output "$n issue(s) detected"
Exit 1
}
Loading