@@ -281,7 +281,9 @@ namespace WindowsAppRuntimeInstaller
281
281
// Check if a higher version of the package is already installed.
282
282
PackageManager packageManager;
283
283
winrt::hstring currentUserSID;
284
- const auto installedPackages = packageManager.FindPackagesForUser (currentUserSID, packageProperties->familyName .get ());
284
+ auto installedPackages{ packageManager.FindPackagesForUserWithPackageTypes (currentUserSID, packageProperties->familyName .get (),
285
+ ::Windows::Management::Deployment::PackageTypes::Framework |
286
+ ::Windows::Management::Deployment::PackageTypes::Main) };
285
287
bool isPackageInstalledAndIsPackageStatusOK{};
286
288
287
289
// installedPackages can contain only one version of the packagefamily across all servicing revisions of a WindowsAppSDK version.
@@ -291,11 +293,7 @@ namespace WindowsAppRuntimeInstaller
291
293
// For the already installed package of same WindowsAppSDK Major.Minor version with matching architecture, compare version
292
294
if (installedPackage.Id ().Architecture () == packageProperties->architecture )
293
295
{
294
- UINT64 installedPackageVersion = ((static_cast <UINT64>(installedPackage.Id ().Version ().Major ) << 48 ) +
295
- (static_cast <UINT64>(installedPackage.Id ().Version ().Minor ) << 32 ) +
296
- (static_cast <UINT64>(installedPackage.Id ().Version ().Build ) << 16 ) +
297
- static_cast <UINT64>(installedPackage.Id ().Version ().Revision ));
298
-
296
+ const auto installedPackageVersion{ AppModel::Package::ToPackageVersion (installedPackage.Id ().Version ()).Version };
299
297
if (installedPackageVersion > packageProperties->version )
300
298
{
301
299
installActivityContext.SetExistingPackageIfHigherVersion (installedPackage.Id ().FullName ());
0 commit comments