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" />
<PackageVersion Include="Dwrandaz.AutoUpdateComponent" Version="1.0.0" />
<PackageReference Include="Dwrandaz.AutoUpdateComponent" />
paket add Dwrandaz.AutoUpdateComponent --version 1.0.0
#r "nuget: Dwrandaz.AutoUpdateComponent, 1.0.0"
#:package Dwrandaz.AutoUpdateComponent@1.0.0
#addin nuget:?package=Dwrandaz.AutoUpdateComponent&version=1.0.0
#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.AutoUpdateComponentOpen the package manifest
.appmanifestfile 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.TryToUpdateAsyncif you don't use the default name. - Entry point:
Dwrandaz.AutoUpdateComponent.UpdateTask
- Name: The default values is
Right click on the package manifest
.appmanifestfile and click onView Code.Add this namespace declaration:
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"Add
rescapto theIgnorableNamespaces, for example:IgnorableNamespaces="uap mp rescap"Inside the
Packagetag, 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
Releaseconfiguration - 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 updatescheckbox - Click on
Next - Check the
Automatically Incremenentcheckbox underversion. - Select
AlwaysunderGenerate App bundle - Click on
Next - Write the update location path and Select
Check every 1 Weekor 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