A library for enabling automatic updates for sideloaded UWP apps
This is an auto-update mechanism for UWP apps, it uses a background task to update the package.
Dwrandaz.AutoUpdateComponent
1803
.appmanifest
file of the main app and declare an app service:
Dwrandaz.AutoUpdate
. However, you can change it to any name you like but you should note that this name is important and it should be passed to AutoUpdateManager.TryToUpdateAsync
if you don't use the default name.Dwrandaz.AutoUpdateComponent.UpdateTask
.appmanifest
file and click on View Code
.xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
rescap
to the IgnorableNamespaces
, for example: IgnorableNamespaces="uap mp rescap"
Package
tag, make sure these elements exist:<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="packageManagement" />
</Capabilities>
For more information, take a look at the sample apps manifest file.
var path = "http://localhost:5000/install/AwesomeApp.appinstaller";
var info = await AutoUpdateManager.CheckForUpdatesAsync(path);
if (!info.Succeeded)
{
// There was an error in getting the update information from the server
// use info.ErrorMessage to get the error message
return;
}
if (!info.ShouldUpdate)
{
// The app is already up-to-date :)
return;
}
// You can use info.MainBundleVersion to get the update version
var result = await AutoUpdateManager.TryToUpdateAsync(info);
if (!result.Succeeded)
{
// There was an error in updating the app
// use result.ErrorMessage to get the error message
return;
}
// Success! The app was updated, it will restart soon!
See the Sample app for a concrete example.
Release
configurationStore
> Create App Packages...
I want to create packages for sideloading.
And check the Enable automatic updates
checkboxNext
Automatically Incremenent
checkbox under version
.Always
under Generate App bundle
Next
Check every 1 Week
or more so that the native auto-update mechanism doesn't mess with our auto-update mechanismCreate