PackageDeploymentManager with DeferRegistrationWhenPackagesAreInUse and DependencyPackages does not update on next app start #4827
Labels
area-Deployment
Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)
Describe the bug
When trying to (self-)update a MSIX package
PackageDeploymentManager.AddPackageByUriAsync()
method andAddPackageOptions DeferRegistrationWhenPackagesAreInUse = true
AND with someDependencyPackageUris
added, the MSIX package will not be updated on the next app start. Instead, the old version is re-registered and the newly staged package is being deleted again.If you don't add any
DependencyPackageUris
to the options, then the update works as expected. This is the crazy part and took me lots of hours to debug. TheDependencyPackageUris
can be any kind of URI, the package doesn't even need to depend on it.According to the AppxLog,
Started deployment RegisterByPackageFamilyName operation on a package with main parameter PackageManagerRegisterTest_ad8pwfkyh69vj
is called. But this operation seems to choose the old version instead of the new one. The AppxLog is also attached below.Linked is a GitHub repository to reproduce the issue. The repo contains source code, and also two self-signed MSIX packages together with the self-signed certificate for testing the update scenario. https://github.com/whiskhub/PackageManagerRegisterTest
Steps to reproduce the bug
Have a MSIX packaged app (e.g. WinUI 3) that can auto-update itself. The update code should look the following:
Execute the self-update within the app. Close the app. Start the app again. See the opened app and verify the version number is still old.
Confirm with PowerShell
Get-AppxLog
that the deferred registration took place, but with with the old version instead of the new one:Expand for AppxLog
Expected behavior
After executing an app update with
DeferRegistrationWhenPackagesAreInUse = true
AND with someDependencyPackageUris
added, closing the app and reopening the app, the app opened is updated to the newest version.Screenshots
No response
NuGet package version
Windows App SDK 1.6.1: 1.6.240923002
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: