LicenPro
Documentation.NET SDKAuto updater & logging

Auto updater & logging

Publish a new build and your customers install it with one click: "Update & restart" downloads it, verifies it, installs it and reopens the app. No uninstall, no reinstall.

What your customers see

When a newer build is available for their license, your app shows its version, size and release notes. Update & restart installs it now, Later asks again the next time the app starts, and Skip this version stops prompts for that version. A mandatory update offers only Update & restart.

Click image to open full-resolution preview.

The window is yours (the WinForms sample has one to copy); the SDK supplies the data and does the work.

How it works

  1. Publish a release in the dashboard with a zip of your app folder as its file. Publishing hashes the zip (SHA-256) and signs it with the product's RSA key. The release's Update package card shows "Ready for one-click update". New licenses receive every new release by default (the license's Receives new releases option); the release page shows how many licenses it is offered to.
  2. SdkUpdateManager.CheckForUpdateAsync asks /api/updates/check which build this license may install. The answer depends on the license type, release pins and channel; with no channel, only Stable builds are offered. UpdateAvailable fires once per version.
  3. DownloadUpdateAsync(update, progress) downloads from /api/updates/download/{releaseId} with your API key and the license key, then checks the size, SHA-256 and product-key signature before extracting anything. It refuses zip entries that would land outside the staging folder.
  4. ApplyUpdateAndRestart() starts the new version as the installer and exits your app. The installer backs up the install folder, copies the new files, keeps licenpro.cache and licenpro.settings.json, and starts your app again. If anything fails it restores the backup. For an app in Program Files, Windows shows one UAC prompt.

Integrate

// Program.Main — first line: installs a staged update, applies mandatory ones, reports restarts
SdkBootstrap.OnApplicationStartup(onRestarted: info => { /* info.Succeeded, info.FromVersion, info.Error */ });

// After the license validated
// Reports the running build (SdkUpdateManager.RunningVersion); pass currentAppVersion only to override it
client.EnableAutoUpdates(onUpdateAvailable: e => ShowPrompt(e.Update!));

// In your prompt's "Update & restart" button
if (await SdkUpdateManager.DownloadUpdateAsync(update, progress) != null)
    SdkUpdateManager.ApplyUpdateAndRestart(() => Application.Exit());

Who receives an update

  • The release is published with a verified update package, and Offer product updates to clients is on (Product → Settings → Client updates).
  • The license is active and has Receives new releases on (the default for new licenses), or the release is assigned to the license, or its owner has Grant to all versions in the product's Manage Access.
  • The release level matches the app's channel. Apps get Stable releases; an app that passes releaseChannel: "Beta" gets Beta releases instead.

The release page shows the result: "Offered as an update to N active license(s)". See Releases for the update package settings.

Mandatory updates

  • Tick Mandatory update on the release, or set a Minimum supported version: clients older than it must install this update.
  • The SDK starts the download in the background as soon as it finds the update and installs it at the next start, even if the user closed the app.
  • Your prompt offers only "Update & restart". The WinForms sample closes the app when the user refuses.
Click image to open full-resolution preview.

Safety

  • Before anything is extracted, the package's size, SHA-256 and product-key signature are checked, and zip entries that would land outside the staging folder are refused.
  • Ship the product public key with your app (LicensingSecrets.PublicKey in licenpro.settings.json; it is not secret). Without it UpdateInfo.CanInstall is false and nothing is downloaded.
  • The installer backs up the install folder and restores it if anything fails. RollbackAndRestart() returns to the previous version (one backup is kept).
  • licenpro.cache and licenpro.settings.json are kept, so the app stays activated after the update.

More options

  • SkipVersion(version) stops prompts for a version.
  • StageUpdateFromFile(zip, version) stages a package delivered offline, for example on a USB stick to an air-gapped machine. It is not checked against the server.
  • Update state lives in %LocalAppData%\LicenPro\{app}\updates.

Troubleshooting

  • No update is offered: the release is still a draft, the license does not receive it (check "Offered as an update to…" on the release page), or the release level is not the app's channel.
  • "Update & restart" is unavailable: the app has no product public key, or the release file is not a verified zip package (release page → Update package → Verify package).
  • The app shows the old version after updating: set the version in your project file before you build the zip, and let the SDK report the running build instead of passing a fixed currentAppVersion.

Logging

Implement ILicenseLogger for structured logs (file, HTTP to /api/SdkLogs/..., or composite sinks), depending on your compliance needs.

SDK host APIs · Telemetry topic · WinForms sample