Dwrandaz.AutoUpdateComponent
1.0.0
See the version list below for details.
dotnet add package Dwrandaz.AutoUpdateComponent --version 1.0.0
NuGet\Install-Package Dwrandaz.AutoUpdateComponent -Version 1.0.0
<PackageReference Include="Dwrandaz.AutoUpdateComponent" Version="1.0.0" />
paket add Dwrandaz.AutoUpdateComponent --version 1.0.0
#r "nuget: Dwrandaz.AutoUpdateComponent, 1.0.0"
// Install Dwrandaz.AutoUpdateComponent as a Cake Addin #addin nuget:?package=Dwrandaz.AutoUpdateComponent&version=1.0.0 // Install Dwrandaz.AutoUpdateComponent as a Cake Tool #tool nuget:?package=Dwrandaz.AutoUpdateComponent&version=1.0.0
Dwrandaz.AutoUpdateComponent
This is an auto-update mechanism for UWP apps, it uses a background task to update the package.
How to use
Install the nuget package:
Dwrandaz.AutoUpdateComponent
Open the package manifest
.appmanifest
file of the main app and declare an app service:- Name: The default values is
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 toAutoUpdateManager.TryToUpdateAsync
if you don't use the default name. - Entry point:
Dwrandaz.AutoUpdateComponent.UpdateTask
- Name: The default values is
Right click on the package manifest
.appmanifest
file and click onView Code
.Add this namespace declaration:
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
Add
rescap
to theIgnorableNamespaces
, for example:IgnorableNamespaces="uap mp rescap"
Inside the
Package
tag, make sure these elements exist:
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="packageManagement" />
</Capabilities>
- Example usage:
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!
Creating update packages
- Make sure you select the
Release
configuration - Right click on the main app project and click
Store
>Create App Packages...
- Select
I want to create packages for sideloading.
And check theEnable automatic updates
checkbox - Click on
Next
- Check the
Automatically Incremenent
checkbox underversion
. - Select
Always
underGenerate App bundle
- Click on
Next
- Write the update location path and Select
Check every 1 Week
or more so that the native auto-update mechanism doesn't mess with our auto-update mechanism - Click on
Create
Configuring the IIS server
More information
- https://matthijs.hoekstraonline.net/2016/09/27/auto-updater-for-my-side-loaded-uwp-apps/
- http://blog.infernored.com/how-to-push-updates-to-raspberry-pi-uwp-apps-in-prod
- https://channel9.msdn.com/Shows/Inside-Windows-Platform/Exposing-and-Calling-App-Services-from-your-UWP-app
- https://github.com/AutomatedArchitecture/sirenofshame-uwp/blob/develop/SirenOfShame.Uwp.Maintenance/Services/BundleService.cs
Product | Versions Compatible and additional computed target framework versions. |
---|---|
Universal Windows Platform | netcore50 is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
First release