[UWP][C#] How to check updates of a side-loaded app in code?

Hong 1,141 Reputation points
2019-11-27T14:26:07.997+00:00

One can set up auto-updates for a side-loaded UWP app . This means the update checking function is already there. How can this update checking function be called in code?

I do not plan to use auto-updates and would like to have a button for users to click to check updates manually.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,466 Reputation points Microsoft Vendor
    2019-11-28T03:22:49.843+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Have you check the Package.GetAppInstallerInfo Method and the Package.CheckUpdateAvailabilityAsync Method?

    The first one could get the URI from the .AppInstaller. If a user who already has the app clicks the URI, the app is updated if needed and then it opens. If a user who doesn't have the app clicks the URI, they are taken through the install process for the app.

    The second one could help you to check if an update is available from the server indicated in the .AppInstaller.

    1 person found this answer helpful.