Skip to content
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
3 changes: 2 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="Packages" />
Expand All @@ -9,6 +9,7 @@
<add key="WinAppSDK" value="https://pkgs.dev.azure.com/microsoft/_packaging/WinAppSDK/nuget/v3/index.json" />
<add key="WindowsAppSDK Local" value="tools/nuget" />
<add key="localpackages" value="localpackages" />
<add key="Microsoft nuget.org proxy" value="https://packagefeedproxy.microsoft.io/nuget/v3/index.json" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops this is a no-no - violates the enforced single-feed policy (a separate concern from CFS proxying)

</packageSources>
<disabledPackageSources>
<clear />
Expand Down
707 changes: 541 additions & 166 deletions WindowsAppRuntime.sln

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_UniversalBGTaskDLL\Microsoft.Wind
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.Background.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.DynamicDependency.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppLifecycle.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.Builder.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
Expand All @@ -91,8 +92,9 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\decimal.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\decimalcppwinrt.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\MsixDynamicDependency.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\wil_msixdynamicdependency.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\package_runtime.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Security.AccessControl.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\wil_msixdynamicdependency.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\RestartAgent\RestartAgent.exe $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\RestartAgent\RestartAgent.pdb $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\DeploymentAgent\DeploymentAgent.exe $FullPublishDir\Microsoft.WindowsAppRuntime\
Expand Down Expand Up @@ -143,6 +145,8 @@ PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.Background.Proje
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.Background.Projection\Microsoft.Windows.ApplicationModel.Background.Projection.pdb $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.pdb $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection\Microsoft.Windows.ApplicationModel.Projection.dll $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection\Microsoft.Windows.ApplicationModel.Projection.pdb $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.pdb $NugetDir\lib\net6.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.AppLifecycle.Projection\Microsoft.Windows.AppLifecycle.Projection.dll $NugetDir\lib\net6.0-windows10.0.17763.0
Expand Down Expand Up @@ -186,9 +190,10 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrap.h $Nuge
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\decimal.h $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\decimalcppwinrt.h $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\MsixDynamicDependency.h $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\package_runtime.h $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Security.AccessControl.h $NugetDir\include\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\wil_msixdynamicdependency.h $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\WindowsAppRuntimeInsights.h $NugetDir\include\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\Security.AccessControl.h $NugetDir\include\
#
# Libraries (*.lib)
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\Microsoft.WindowsAppRuntime.Bootstrap.lib $NugetDir\lib\win10-$Platform
Expand Down Expand Up @@ -232,9 +237,10 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_UniversalBGTaskDLL\Microsoft.Wind
PublishFile $FullBuildOutput\WindowsAppRuntime_UniversalBGTaskDLL\Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.pdb $NugetDir\runtimes\win-$Platform\native
#
# WinMD for UWP apps
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.Background.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.DynamicDependency.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.Background.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppLifecycle.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.Builder.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.AppNotifications.winmd $NugetDir\lib\uap10.0
Expand Down
6 changes: 3 additions & 3 deletions dev/Package/M.W.A.Package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

namespace winrt::Microsoft::Windows::ApplicationModel::implementation
{
static_assert(static_cast<std::int32_t>(PackageFeature::PackagePath_Mutable) == static_cast<std::int32_t>(::PackageFeature_PackagePath_Mutable), "PackageFeature::PackagePath_Mutable != PackageFeature_PackagePath_Mutable");
static_assert(static_cast<std::int32_t>(PackageFeature::PackagePath_ExternalLocation) == static_cast<std::int32_t>(::PackageFeature_PackagePath_ExternalLocation), "PackageFeature::PackagePath_ExternalLocation != PackageFeature_PackagePath_ExternalLocation");
static_assert(static_cast<std::int32_t>(PackageFeature::PackagePath_Mutable) == static_cast<std::int32_t>(::PackageRuntimeFeature_PackagePath_Mutable), "PackageFeature::PackagePath_Mutable != PackageRuntimeFeature_PackagePath_Mutable");
static_assert(static_cast<std::int32_t>(PackageFeature::PackagePath_ExternalLocation) == static_cast<std::int32_t>(::PackageRuntimeFeature_PackagePath_ExternalLocation), "PackageFeature::PackagePath_ExternalLocation != PackageRuntimeFeature_PackagePath_ExternalLocation");

static_assert(static_cast<std::int32_t>(GetFilePathOptions::None) == static_cast<std::int32_t>(::GetPackageFilePathOptions_None), "GetFilePathOptions::None != FindPackageFileOptions_None");
static_assert(static_cast<std::int32_t>(GetFilePathOptions::SearchInstallPath) == static_cast<std::int32_t>(::GetPackageFilePathOptions_SearchInstallPath), "GetFilePathOptions::SearchInstallPath != GetPackageFilePathOptions_SearchInstallPath");
Expand All @@ -29,7 +29,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::implementation

bool Package::IsFeatureSupported(winrt::Microsoft::Windows::ApplicationModel::PackageFeature const& feature)
{
return ::IsPackageFeatureSupported(static_cast<::PackageFeature>(feature));
return ::IsPackageRuntimeFeatureSupported(static_cast<::PackageRuntimeFeature>(feature));
}
hstring Package::GetFilePath(hstring const& filename)
{
Expand Down
2 changes: 1 addition & 1 deletion dev/Package/Package.idl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.Windows.ApplicationModel
apicontract PackageRuntimeContract{};

/// Features can be queried if currently available/enabled.
/// @see Package.IsPackageFeatureSupported()
/// @see Package.IsPackageRuntimeFeatureSupported()
[contract(PackageRuntimeContract, 1)]
enum PackageFeature
{
Expand Down
14 changes: 7 additions & 7 deletions dev/Package/package_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace appmodel
static bool IsPathSupported_Mutable()
{
// Cache the answer on first query
static bool s_isSupported{ !!::IsPackageFeatureSupported(PackageFeature_PackagePath_Mutable) };
static bool s_isSupported{ !!::IsPackageRuntimeFeatureSupported(PackageRuntimeFeature_PackagePath_Mutable) };
return s_isSupported;
}

static bool IsPathSupported_ExternalLocation()
{
// Cache the answer on first query
static bool s_isSupported{ !!::IsPackageFeatureSupported(PackageFeature_PackagePath_ExternalLocation) };
static bool s_isSupported{ !!::IsPackageRuntimeFeatureSupported(PackageRuntimeFeature_PackagePath_ExternalLocation) };
return s_isSupported;
}

Expand Down Expand Up @@ -322,24 +322,24 @@ inline GetPackageFilePathOptions ToEffectiveOptions(
}
}

STDAPI_(BOOL) IsPackageFeatureSupported(
PackageFeature feature) noexcept
STDAPI_(BOOL) IsPackageRuntimeFeatureSupported(
PackageRuntimeFeature feature) noexcept
{
switch (feature)
{
case PackageFeature_PackagePath_Mutable:
case PackageRuntimeFeature_PackagePath_Mutable:
{
// Supported on Windows >= 19H1
return ::WindowsVersion::IsWindows10_19H1OrGreater() ? TRUE : FALSE;
}
case PackageFeature_PackagePath_ExternalLocation:
case PackageRuntimeFeature_PackagePath_ExternalLocation:
{
// Supported on Windows >= VB (20H1)
return ::WindowsVersion::IsWindows10_20H1OrGreater() ? TRUE : FALSE;
}
}

std::ignore = LOG_HR_MSG(E_INVALIDARG, "PackageFeature:%d", static_cast<int>(feature));
std::ignore = LOG_HR_MSG(E_INVALIDARG, "PackageRuntimeFeature:%d", static_cast<int>(feature));
return FALSE;
}

Expand Down
14 changes: 7 additions & 7 deletions dev/Package/package_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
#define PACKAGE_RUNTIME_H

/// Features can be queried if currently available/enabled.
/// @see IsPackageFeatureSupported()
typedef enum PackageFeature
/// @see IsPackageRuntimeFeatureSupported()
typedef enum PackageRuntimeFeature
{
/// Package Mutable path.
/// @see PackagePathType_Mutable
PackageFeature_PackagePath_Mutable = 1,
PackageRuntimeFeature_PackagePath_Mutable = 1,

/// Package External Location path (MachineExternal + UserExternal)
/// @see PackagePathType_MachineExternal
/// @see PackagePathType_UserExternal
PackageFeature_PackagePath_ExternalLocation = 2,
} PackageFeature;
PackageRuntimeFeature_PackagePath_ExternalLocation = 2,
} PackageRuntimeFeature;

/// Return TRUE if feature is supported on the current system.
STDAPI_(BOOL) IsPackageFeatureSupported(
PackageFeature feature) noexcept;
STDAPI_(BOOL) IsPackageRuntimeFeatureSupported(
PackageRuntimeFeature feature) noexcept;

/// Options for GetPackageFilePath*() functions
typedef enum GetPackageFilePathOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.17763.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<Platforms>x64;x86;arm64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<!-- Suppress CS8305: Feature is for evaluation purposes only and is subject to change or removal in future updates. -->
<PropertyGroup>
<NoWarn>8305</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Common">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.CsWinRT" />
</ItemGroup>

<PropertyGroup>
<CSWinRTIncludes>Microsoft.Windows.ApplicationModel</CSWinRTIncludes>
<CSWinRTWindowsMetadata>10.0.17763.0</CSWinRTWindowsMetadata>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>

<!-- Configure the release build binary to be as required by internal API scanning tools. -->
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<CsWinRTInputs Include="$(OutDir)/**/*.winmd" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\build\VersionInfo\AssemblyInfo.cs" Link="AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.Windows.ApplicationModel">
<HintPath>$(WindowsAppSDKNativeWinMDPath)\Microsoft.Windows.ApplicationModel.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ EXPORTS

GetPackageFilePath
GetPackageFilePathInPackageGraph
IsPackageFeatureSupported
IsPackageRuntimeFeatureSupported
Comment thread
DrusTheAxe marked this conversation as resolved.
Resolved
20 changes: 19 additions & 1 deletion specs/package/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ namespace Microsoft.Windows.ApplicationModel
apicontract PackageRuntimeContract{};

/// Features can be queried if currently available/enabled.
/// @see Package.IsPackageFeatureSupported()
/// @see Package.IsPackageRuntimeFeatureSupported()
[contract(PackageRuntimeContract, 1)]
enum PackageFeature
{
Expand Down Expand Up @@ -600,6 +600,24 @@ namespace Microsoft.Windows.ApplicationModel
#if !defined(PACKAGE_RUNTIME_H)
#define PACKAGE_RUNTIME_H

/// Features can be queried if currently available/enabled.
/// @see IsPackageRuntimeFeatureSupported()
typedef enum PackageRuntimeFeature
{
/// Package Mutable path.
/// @see PackagePathType_Mutable
PackageRuntimeFeature_PackagePath_Mutable = 1,

/// Package External Location path (MachineExternal + UserExternal)
/// @see PackagePathType_MachineExternal
/// @see PackagePathType_UserExternal
PackageRuntimeFeature_PackagePath_ExternalLocation = 2,
} PackageRuntimeFeature;

/// Return TRUE if feature is supported on the current system.
STDAPI_(BOOL) IsPackageRuntimeFeatureSupported(
PackageRuntimeFeature feature) noexcept;

/// Options for GetPackageFilePath*() functions
typedef enum GetPackageFilePathOptions
{
Expand Down
4 changes: 2 additions & 2 deletions test/Package/API/PackageTests.Packages.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ namespace Test::Package::Tests

inline bool IsMutableLocationSupported()
{
return !!::IsPackageFeatureSupported(PackageFeature_PackagePath_Mutable);
return !!::IsPackageRuntimeFeatureSupported(PackageRuntimeFeature_PackagePath_Mutable);
}

inline bool IsExternalLocationSupported()
{
return !!::IsPackageFeatureSupported(PackageFeature_PackagePath_ExternalLocation);
return !!::IsPackageRuntimeFeatureSupported(PackageRuntimeFeature_PackagePath_ExternalLocation);
}


Expand Down
Loading