Skip to content

Commit

Permalink
FI develop into notification feature branch (#2733)
Browse files Browse the repository at this point in the history
* update newtonsoft.json (#2688)

* Introduce Register Overload for assets (#2596)

* Introduce Register Overload for assets

* Address comments

* Add contractversion to register APi

* Address comments

* Add more examples of register API usage

* Process doc for develop branch (#2383)

* Add 1.1.2 tag to bug report

* Properly ignore cleanup event if it can't be opened. (#2658)

If we can't open the cleanup event, ignore it.

Fixes ADO#38606299

* WindowsAppRuntimeInstaller.exe fails if newer version present

Discussion #2708: [WindowsAppRuntime installation error: The package could not be installed because a higher version of this package is already installed](#2708)

>Microsoft.WindowsAppRuntime.1.1_1000.516.2156.0_x64__8wekyb3d8bbwe Package deployment result : 0x80073d06 The package could not be installed because a higher version of this package is already installed. One or more install operations failed. Result: 0x80073d06

That's a bug - it should be OK, not an error.

If v1.1.3 is installed and you run the installer for v1.1.2 we call packageManager.AddPackageAsync(...v1.1.2...) which returns 0x80073d06 == `ERROR_INSTALL_PACKAGE_DOWNGRADE` which is technically an error but functionally it's OK. If you build with 1.1.2 we don't require the runtime packages exactly match 1.1.2, but rather that there needs to be a package equal-or-higher than 1.1.2 (i.e. `>=1.1.2` not `==1.1.2`). If 1.1.3 is installed then all is well.

Problem is we should be trapping `ERROR_INSTALL_PACKAGE_DOWNGRADE` and treating it as success. That's a bug on our part. 

https://task.ms/40411617

FYI: servicing-consider-1.1 = https://task.ms/40411679

* XCOPY command should be <COPY> to ensure execution (#2734)

* XCOPY command should be XCOPY.EXE to ensure execution

* Changed xcopy.exe to <Copy>

* Fix typo

* Put AccessControl files into transport package (#2751)

* Add projection DLL

* Put files into nuget package

* Remove noexcept from Bootstrapper API so it can be used from C (#2750)

* Remove noexcept from Bootstrapper API so it can be used from C

* Switch noexcept to macro-style optional support per feedback

* Update bug version to 1.1.3 (#2757)

* <Copy> vs XCOPY.EXE -- Unbreak WindowsAppSDK-Nuget-Native.C.props

Not-Build break 'build\native\WindowsAppSDK-Nuget-Native.C.props(32,13): error MSB4066: The attribute 'SourceFiles' in element is unrecognized.' -- Foundation builds but the aggregator doesn't. I suspect it's because of the command can't go in a , maybe something more complicated with the PostBuildEvent DependsOn a to do the copy...but I can't find any clear docs or net links clearly spelling it out so rather than fiddling while Rome burns I'm switching back to the original xcopy.exe solution to un-break the pipeline.

Will follow up with folks to understand why the PR's build didn't pick this up

* Updating reference to pick up license installation fix. (#2531) (#2764)

Co-authored-by: Ben Kuhn <[email protected]>

Co-authored-by: Hui Chen <[email protected]>
Co-authored-by: reunion-maestro-bot <[email protected]>
Co-authored-by: Sharath Manchala <[email protected]>
Co-authored-by: MikeHillberg <[email protected]>
Co-authored-by: Gabby Bilka <[email protected]>
Co-authored-by: Gabby Bilka <[email protected]>
Co-authored-by: Johan Laanstra <[email protected]>
Co-authored-by: Howard Kapustein <[email protected]>
Co-authored-by: Eric Langlois <[email protected]>
Co-authored-by: Ryan Shepherd <[email protected]>
Co-authored-by: sachintaMSFT <[email protected]>
Co-authored-by: Ben Kuhn <[email protected]>
  • Loading branch information
13 people authored Jul 25, 2022
1 parent 6149efb commit d394165
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body:
label: NuGet package version
description: Specify the version of Windows App SDK (or Project Reunion) you're using.
options:
- "1.1.2"
- "1.1.3"
- "1.1.0-preview3"
- "1.0.4"
- "1.0.0-preview3"
Expand Down
17 changes: 17 additions & 0 deletions WindowsAppRuntime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeploymentAgent", "dev\Depl
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.Security.AccessControl.Projection", "dev\Projections\CS\Microsoft.Windows.Security.AccessControl.Projection\Microsoft.Windows.Security.AccessControl.Projection.csproj", "{E6D59245-696F-4D13-ACF6-7ECE6E653367}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
test\inc\inc.vcxitems*{08bc78e0-63c6-49a7-81b3-6afc3deac4de}*SharedItemsImports = 4
Expand Down Expand Up @@ -1355,6 +1357,20 @@ Global
{4410D374-A90C-4ADF-8B15-AA2AAE2636BF}.Release|x64.Build.0 = Release|x64
{4410D374-A90C-4ADF-8B15-AA2AAE2636BF}.Release|x86.ActiveCfg = Release|x86
{4410D374-A90C-4ADF-8B15-AA2AAE2636BF}.Release|x86.Build.0 = Release|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|Any CPU.ActiveCfg = Debug|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|ARM64.ActiveCfg = Debug|arm64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|ARM64.Build.0 = Debug|arm64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|x64.ActiveCfg = Debug|x64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|x64.Build.0 = Debug|x64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|x86.ActiveCfg = Debug|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Debug|x86.Build.0 = Debug|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|Any CPU.ActiveCfg = Release|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|ARM64.ActiveCfg = Release|arm64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|ARM64.Build.0 = Release|arm64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|x64.ActiveCfg = Release|x64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|x64.Build.0 = Release|x64
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|x86.ActiveCfg = Release|x86
{E6D59245-696F-4D13-ACF6-7ECE6E653367}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1469,6 +1485,7 @@ Global
{D9139E3C-8D21-4BD9-84E3-30A03A54D610} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC}
{4A74BBED-3B20-44A7-B6FF-3373160DE741} = {99C514E4-A6B3-4B09-B870-5511EF9D93AC}
{4410D374-A90C-4ADF-8B15-AA2AAE2636BF} = {E378857C-D22A-4E5E-A6DA-A59C445CF22E}
{E6D59245-696F-4D13-ACF6-7ECE6E653367} = {716C26A0-E6B0-4981-8412-D14A4D410531}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
Expand Down
6 changes: 6 additions & 0 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.Power.winmd $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Security.AccessControl.winmd $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\Security.AccessControl.h $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\RestartAgent\RestartAgent.exe $FullPublishDir\Microsoft.WindowsAppRuntime\
PublishFile $FullBuildOutput\DeploymentAgent\DeploymentAgent.exe $FullPublishDir\Microsoft.WindowsAppRuntime\

Expand Down Expand Up @@ -97,6 +99,8 @@ PublishFile $FullBuildOutput\Microsoft.Windows.System.Projection\Microsoft.Windo
PublishFile $FullBuildOutput\Microsoft.Windows.System.Projection\Microsoft.Windows.System.Projection.pdb $NugetDir\lib\net5.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.System.Power.Projection\Microsoft.Windows.System.Power.Projection.dll $NugetDir\lib\net5.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.System.Power.Projection\Microsoft.Windows.System.Power.Projection.pdb $NugetDir\lib\net5.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.Security.AccessControl.Projection\Microsoft.Windows.Security.AccessControl.Projection.dll $NugetDir\lib\net5.0-windows10.0.17763.0
PublishFile $FullBuildOutput\Microsoft.Windows.Security.AccessControl.Projection\Microsoft.Windows.Security.AccessControl.Projection.pdb $NugetDir\lib\net5.0-windows10.0.17763.0
#
# Dynamic Dependency build overrides
PublishFile $OverrideDir\DynamicDependency-Override.json $NugetDir\runtimes\win10-$Platform\native
Expand All @@ -109,6 +113,7 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrap.h $Nuge
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\MsixDynamicDependency.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 @@ -159,6 +164,7 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.Power.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Security.AccessControl.winmd $NugetDir\lib\uap10.0
#
# Bootstrap Auto-Initializer Files
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cpp $NugetDir\include
Expand Down
2 changes: 1 addition & 1 deletion build/NuSpecs/WindowsAppSDK-Nuget-Native.C.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y "$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.Bootstrap.dll" "$(OutDir)"</Command>
<Command>xcopy.exe /y "$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.Bootstrap.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>

Expand Down
5 changes: 5 additions & 0 deletions build/NuSpecs/WindowsAppSDK-Nuget-Native.WinRt.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<Implementation Condition="'$(WindowsAppSDKFrameworkPackage)' != 'true'">$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="Microsoft.Windows.Security.AccessControl.winmd">
<HintPath>$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.Security.AccessControl.winmd</HintPath>
<Implementation Condition="'$(WindowsAppSDKFrameworkPackage)' != 'true'">$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(_WindowsAppSDKFoundationPlatform)\native\Microsoft.WindowsAppRuntime.dll</Implementation>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<!-- conditionally include experimental metadata -->
<Reference Include="Microsoft.Windows.System.winmd"
Condition="Exists('$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.System.winmd')">
Expand Down
7 changes: 7 additions & 0 deletions build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.Security.AccessControl.winmd">
<Private>false</Private>
<Implementation>Microsoft.WindowsAppRuntime.dll</Implementation>
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)..\..\lib\uap10.0\Microsoft.Windows.ApplicationModel.Resources.winmd">
<Private>false</Private>
Expand Down
3 changes: 1 addition & 2 deletions dev/AppLifecycle/AppInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ namespace winrt::Microsoft::Windows::AppLifecycle::implementation

std::wstring eventName = name + c_activatedEventNameSuffix;
wil::unique_event cleanupEvent;
cleanupEvent.open(eventName.c_str());
if (cleanupEvent)
if (cleanupEvent.try_open(eventName.c_str()))
{
// If the event is missing, it means the waiter gave up. Ignore the error.
cleanupEvent.SetEvent();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows10.0.17763.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<Platforms>x64;x86;arm64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Common" Version="1.1.0-beta-21055-01">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="$(MicrosoftWindowsCsWinRTPackageVersion)" />
</ItemGroup>

<PropertyGroup>
<CSWinRTIncludes>Microsoft.Windows.Security.AccessControl</CSWinRTIncludes>
<CSWinRTWindowsMetadata>10.0.17763.0</CSWinRTWindowsMetadata>
<WindowsSdkPackageVersion>10.0.17763.$(CsWinRTDependencyWindowsSdkVersionSuffixPackageVersion)</WindowsSdkPackageVersion>
</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>
<Reference Include="Microsoft.Windows.Security.AccessControl">
<HintPath>$(OutDir)..\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.Security.AccessControl.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>

</Project>
12 changes: 9 additions & 3 deletions dev/WindowsAppRuntime_BootstrapDLL/MddBootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

#include <appmodel.h>

#if defined(__cplusplus)
#define MDDBOOTSTRAP_NOEXCEPT noexcept
#else
#define MDDBOOTSTRAP_NOEXCEPT
#endif // defined(__cplusplus)

/// Options for Bootstrap initialization
typedef enum MddBootstrapInitializeOptions
{
Expand Down Expand Up @@ -48,7 +54,7 @@ DEFINE_ENUM_FLAG_OPERATORS(MddBootstrapInitializeOptions)
STDAPI MddBootstrapInitialize(
UINT32 majorMinorVersion,
PCWSTR versionTag,
PACKAGE_VERSION minVersion) noexcept;
PACKAGE_VERSION minVersion) MDDBOOTSTRAP_NOEXCEPT;

/// Initialize the calling process to use Windows App Runtime framework package.
///
Expand All @@ -68,13 +74,13 @@ STDAPI MddBootstrapInitialize2(
UINT32 majorMinorVersion,
PCWSTR versionTag,
PACKAGE_VERSION minVersion,
MddBootstrapInitializeOptions options) noexcept;
MddBootstrapInitializeOptions options) MDDBOOTSTRAP_NOEXCEPT;

/// Undo the changes made by MddBoostrapInitialize().
///
/// @warning Packages made available via MddBootstrapInitialize2() and
/// the Dynamic Dependencies API should not be used after this call.
STDAPI_(void) MddBootstrapShutdown() noexcept;
STDAPI_(void) MddBootstrapShutdown() MDDBOOTSTRAP_NOEXCEPT;

// C++ friendly APIs
#if defined(__cplusplus)
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.WindowsAppSDK.AppLicensingInternal.TransportPackage" Version="1.0.0-preview1.20211111.12">
<Dependency Name="Microsoft.WindowsAppSDK.AppLicensingInternal.TransportPackage" Version="1.1.0-stable.20220518.4">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionClosed</Uri>
<Sha>a3b6cd2d041c342d4a5ac2ed0c90c30e9ed08f15</Sha>
<Sha>0f4add1a10caa92e635919b81a678d2f1bcf229b</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
5 changes: 5 additions & 0 deletions installer/dev/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ namespace WindowsAppRuntimeInstaller
RETURN_IF_FAILED(RegisterPackage(packageProperties->fullName.get()));
return S_OK;
}
else if (hrAddPackage == ERROR_INSTALL_PACKAGE_DOWNGRADE)
{
// Higher version of the package already exists so we're good! Nothing to do!
return S_OK;
}
else
{
const auto deploymentResult{ deploymentOperation.GetResults() };
Expand Down

0 comments on commit d394165

Please sign in to comment.