I created an app using SDK 17134 .appinstaller, certificate, uploaded to server version 1.0.0.0;
User installs the App. (1.0.0.0)
User opens the App (1.0.0.0)
Then I publish a new version (1.0.0.2).
While the App is open, how can I check on the app that a new version is avaliable on the server, prompt the user and start app update to version 1.0.0.2?
Update Windows 10 UWP Apps To change the UWP updates settings, open the Microsoft Store, select the See more “three dots” button next to your profile icon at the top, and click Settings. Under the Settings, in the “App updates” section, turn the toggle button on or off next to “Update apps automatically.”
1] Find UWP app version via Settings You can first navigate to the Settings icon at the bottom of the window and then click on About. You may also want to navigate to the related links section and then find “About” section to know the version like in case of Windows Defender Security Center app.
Check App Installer Settings in Windows To do this, head to Settings > Apps > Apps & features. At the top, you'll see a Choose where to get apps section. If the dropdown is set to The Microsoft Store only (recommended) then you won't be able to install apps from anywhere else.
This element signifies that the deployment service will check for an update to the App Installer file when the app launches.
Windows 1809 introduced a couple of tools to help in this regard. You can use the Package.GetAppInstallerInfo() method to get the URI from the .AppInstaller.
AppInstallerInfo info = Windows.ApplicationModel.Package.Current.GetAppInstallerInfo();
You can also use Package.CheckUpdateAvailabilityAsync() to see if an update is available from the server indicated in the .AppInstaller.
PackageUpdateAvailabilityResult result = await currentPackage.CheckUpdateAvailabilityAsync();
switch (result.Availability)
{
case PackageUpdateAvailability.Available:
GoToUpdateAvailableUIView();
break;
case PackageUpdateAvailability.Required:
GoToUpdateRequiredUIView();
break;
case PackageUpdateAvailability.NoUpdates:
ShowNoUpdateAvailableDialog();
break;
case PackageUpdateAvailability.Unknown:
default:
// Log and ignore or whatever
break;
}
As the .appinstaller
file is just an XML file, you can request its contents from your server and then check for the version inside. You can then compare it with Package.Current.Id.Version
and in case it is newer, you may notify the user to close the app to update it. This however presumes the system has already checked ahead that the update is available, which depends on what you have selected in the dialog while creating the package:
If you are checking for updates everytime the application runs, just display the prompt after a slight delay to make sure the system has had time to find out about the new version. If you have set an interval, it is more tricky, so you could ideally notify the user after two-times longer interval than you have set, so that you can be sure that the system check has gone through before that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With