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

EnsurePackage*Async() handling options.RegisterNewerIfAvailable(true). RegisterPackageByPackageFull/FamilyNameAsync crash. Test + Warning fixes #4845

Merged
merged 28 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f2ea59e
54835036: [WinAppSDK] EnsurePackage*Async() not handling options.Regi…
DrusTheAxe Nov 3, 2024
83dc6a5
Tweaked tests to properly skip on unsupported platforms
DrusTheAxe Nov 3, 2024
8f46c30
54858998 RegisterPackageByPackageFullNameAsync() and RegisterPackageB…
DrusTheAxe Nov 4, 2024
b5a2e5f
Merge branch 'main' into user/howardk/RegisterNewerIfAvailable
DrusTheAxe Nov 4, 2024
93465de
Fixed bad merge
DrusTheAxe Nov 5, 2024
250c03b
Removed redundant .props import (fixing a VS warning)
DrusTheAxe Nov 5, 2024
dd97b8b
Fixed misleading log message
DrusTheAxe Nov 5, 2024
c3a398f
Removed wrong test cases
DrusTheAxe Nov 5, 2024
1af6356
Added diagnostics to all Setup fixtures to hunt down Setup failures
DrusTheAxe Nov 6, 2024
f18b3fa
Change IsReady tests to RunAs RestrictedUser
DrusTheAxe Nov 6, 2024
51e1350
54884960: [WinAppSDK][Test] 6 ApplicationDataTests_Elevated test case…
DrusTheAxe Nov 6, 2024
8638943
Fixed compiler warnings
DrusTheAxe Nov 6, 2024
2cf96fb
Fixed typo
DrusTheAxe Nov 7, 2024
500a24e
Split ApplicationDataTests_Elevated to separate source file. Added di…
DrusTheAxe Nov 7, 2024
a3686c0
Added whomi /all to build pipeline test output. Changed ApplicationDa…
DrusTheAxe Nov 7, 2024
f62497e
Changed PackageManager tests' default to IsolationLevel=Class (not TA…
DrusTheAxe Nov 7, 2024
06a9007
Added missing file
DrusTheAxe Nov 7, 2024
4691654
Fixed compiler warnings
DrusTheAxe Nov 7, 2024
e6d0e77
Yet more debuggery hackery
DrusTheAxe Nov 7, 2024
47ff174
Yet more test hackery
DrusTheAxe Nov 8, 2024
54f9605
Fixed some test bugs
DrusTheAxe Nov 8, 2024
98d63dc
Factored tests into separate runs to aid troubleshooting failures
DrusTheAxe Nov 8, 2024
ce66f53
Mo test tweakage
DrusTheAxe Nov 8, 2024
5ba378a
Little more test environment ensureity
DrusTheAxe Nov 8, 2024
5511889
Yay tests
DrusTheAxe Nov 8, 2024
e81ef12
Merge branch 'user/howardk/RegisterNewerIfAvailable' of https://githu…
DrusTheAxe Nov 8, 2024
908ecae
Merge branch 'main' into user/howardk/RegisterNewerIfAvailable
DrusTheAxe Nov 8, 2024
18e0bd5
Added suppression of CS8305 (Feature is experimental... duh) as not h…
DrusTheAxe Nov 8, 2024
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
28 changes: 24 additions & 4 deletions dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,17 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation
const double c_progressPercentageStartOfIsReady{ 0.01 };
packageDeploymentProgress.Progress = c_progressPercentageStartOfIsReady;
progress(packageDeploymentProgress);
if (IsPackageSetReady(packageSet))
bool isReady{};
if (options.RegisterNewerIfAvailable())
{
THROW_HR_IF_MSG(E_NOTIMPL, !IsPackageDeploymentFeatureSupported(winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentFeature::IsPackageReadyOrNewerAvailable), "RegisterNewerIfAvailable is not supported on this system");
isReady = (IsPackageSetReadyOrNewerAvailable(packageSet) == winrt::Microsoft::Windows::Management::Deployment::PackageReadyOrNewerAvailableStatus::Ready);
}
else
{
isReady = IsPackageSetReady(packageSet);
}
if (isReady)
{
co_return winrt::make<PackageDeploymentResult>(PackageDeploymentStatus::CompletedSuccess, winrt::guid{});
}
Expand Down Expand Up @@ -1612,7 +1622,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation
}

winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress>
PackageDeploymentManager::RegisterPackageByPackageFamilyNameAsync(winrt::hstring const& packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options)
PackageDeploymentManager::RegisterPackageByPackageFamilyNameAsync(const winrt::hstring packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options)
{
auto logTelemetry{ PackageManagementTelemetry::RegisterPackageByPackageFamilyNameAsync::Start(packageFamilyName) };

Expand Down Expand Up @@ -1660,7 +1670,7 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation
}

winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress>
PackageDeploymentManager::RegisterPackageByPackageFullNameAsync(winrt::hstring const& packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options)
PackageDeploymentManager::RegisterPackageByPackageFullNameAsync(const winrt::hstring packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options)
{
auto logTelemetry{ PackageManagementTelemetry::RegisterPackageByPackageFullNameAsync::Start(packageFullName) };

Expand Down Expand Up @@ -1892,7 +1902,17 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation
errorText.clear();
activityId = winrt::guid{};

if (IsReady(packageSetItem))
bool isReady{};
if (options.RegisterNewerIfAvailable())
{
// Our caller already verified PackageDeploymentFeature::IsPackageReadyOrNewerAvailable is supported so no need to check again
isReady = (IsReadyOrNewerAvailable(packageSetItem) == winrt::Microsoft::Windows::Management::Deployment::PackageReadyOrNewerAvailableStatus::Ready);
}
else
{
isReady = IsReady(packageSetItem);
}
if (isReady)
{
return S_OK;
}
Expand Down
4 changes: 2 additions & 2 deletions dev/PackageManager/API/M.W.M.D.PackageDeploymentManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ namespace winrt::Microsoft::Windows::Management::Deployment::implementation

private:
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress> AddPackageByAppInstallerFileAsync(winrt::Windows::Foundation::Uri packageUri, winrt::Microsoft::Windows::Management::Deployment::AddPackageOptions options);
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress> RegisterPackageByPackageFamilyNameAsync(winrt::hstring const& packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options);
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress> RegisterPackageByPackageFullNameAsync(winrt::hstring const& packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options);
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress> RegisterPackageByPackageFamilyNameAsync(const winrt::hstring packageFamilyName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options);
winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentResult, winrt::Microsoft::Windows::Management::Deployment::PackageDeploymentProgress> RegisterPackageByPackageFullNameAsync(const winrt::hstring packageFullName, winrt::Microsoft::Windows::Management::Deployment::RegisterPackageOptions options);

private:
winrt::hstring GetUupProductIdIfMsUup(winrt::Windows::Foundation::Uri const& uri) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>

<Copyright>Copyright (c) Microsoft Corporation. All rights reserved.</Copyright>
<AssemblyTitle>Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage.PackageReference</AssemblyTitle>
<AssemblyTitle>IXP.TransportPackage.PackageReference</AssemblyTitle>
</PropertyGroup>

<PropertyGroup>
Expand Down
Loading
Loading