UWP UpdatePackageAsync needs several retries to succeed

Dick M 1 Reputation point
2021-12-12T13:42:25.697+00:00

Having a side-loaded UWP app on Raspberry PI 3b (RPI) that updates from my own server by downloading binaries (zip file containing msixbundle and dependencies), extracting it locally on the RPI and calling UpdatePackageAsync:

            PackageManager packagemanager = new PackageManager();
            await packagemanager.UpdatePackageAsync(
                new Uri(path_to_msixbundle),
                dependencies, // list of URI to local appx dependencies (in unzip folder, same as msixbundle)
                DeploymentOptions.ForceApplicationShutdown
            );

The app checks periodically and once it finds an update it will install it. At startup it checks for updates as well.

We have noticed that UpdatePackageAsync can fail several times before succeeding. Sometimes it updates the app immediately, sometimes it fails but on the next restart of the app (which is done by the failing UpdatePackageAsync) it will update anyway. And sometimes it need several restarts of the app before updating. All with the same binaries since those are only downloaded once and stored for updating.

What could cause the failing UpdatePackageAsync calls? There are no exceptions thrown since those whould be logged by the application...

Best, Dick

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
380 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,330 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,436 Reputation points
    2021-12-15T09:57:10.5+00:00

    Hi @Dick M ,

    Yes. There are differences between Windows 10 Desktop and Windows 10 IoT Core, please see:
    https://learn.microsoft.com/en-us/windows/iot-core/windows-iot-core#differences-between-windows-10-desktop-and-windows-10-iot-core
    For details, see this part:
    157901-1.png

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Dick M 1 Reputation point
    2021-12-15T22:47:06.487+00:00

    Hi @Seeya Xi-MSFT

    Please help me what the drives have to do with updating a sideloaded app?
    Well aware of differences between desktop and iot version but updating a package should not differ in the sense of installing the new version of the app with the correct assemblies, right?

    Best, Dick

    0 comments No comments

  3. Seeya Xi-MSFT 16,436 Reputation points
    2021-12-16T03:10:51.64+00:00

    Hi @Dick M ,

    I am not very familiar with UWP, so I found a related link for you to refer to. You can see how to get a more detailed error message when the update fails and there is some discussion in the last part of this link.
    https://matthijs.hoekstraonline.net/2016/09/27/auto-updater-for-my-side-loaded-uwp-apps/
    Hope this link could be helpful.

    Best regards,
    Seeya

    0 comments No comments

  4. Dick M 1 Reputation point
    2021-12-18T19:35:33.187+00:00

    Hi @Seeya Xi-MSFT ,

    Have tested a lot and found the following message in the AppX logs...

    AppX Deployment operation failed for package XXX_1.0.1.0_neutral_~_XXX with error 0x80073CF3. The specific error text for this failure is: Windows cannot update package XXX_1.0.1.0_neutral_~_XXX because the previous version is not installed. Install package XXX_1.0.1.0_neutral_~_XXX instead of updating it.

    But there is a previous version installed with the same three package folders in C:\Data\Programs\WindowsApps: arm, neutral_~ and neutral_split.language-en. The latter probably because of the localization that was added.
    The same folder structure exists on the Win 10 desktop used for testing purposes.

    Nevertheless, after a few retries it ussually works but I can't figure out what is going wrong and results in the above message. Not sure if there is a specific setting to be adjusted or what.

    Any advice would be helpful!

    Thanks, Dick