Fix readme code example

This commit is contained in:
Caelan Sayler
2021-08-30 12:14:53 +01:00
parent 27a0c9f33c
commit df894eca11

View File

@@ -49,9 +49,9 @@ Windows apps should be as fast and as easy to install and update as apps like Go
```cs
private static void OnInstall(Version obj)
{
using var mgr = new UpdateManager("https://the.place/you-host/updates");
mgr.CreateUninstallerRegistryEntry();
mgr.CreateShortcutForThisExe(ShortcutLocation.StartMenu | ShortcutLocation.Desktop);
using var mgr = new UpdateManager("https://the.place/you-host/updates");
mgr.CreateUninstallerRegistryEntry();
mgr.CreateShortcutForThisExe(ShortcutLocation.StartMenu | ShortcutLocation.Desktop);
}
```
@@ -76,12 +76,15 @@ Windows apps should be as fast and as easy to install and update as apps like Go
7. Update your app periodically with UpdateManager.
```cs
using var mgr = new UpdateManager("https://the.place/you-host/updates");
var newVersion = await mgr.UpdateApp();
// optionally restart the app automatically, or ask the user if/when they want to restart
if (newVersion != null) {
UpdateManager.RestartApp();
private static void UpdateMyApp()
{
using var mgr = new UpdateManager("https://the.place/you-host/updates");
var newVersion = await mgr.UpdateApp();
// optionally restart the app automatically, or ask the user if/when they want to restart
if (newVersion != null) {
UpdateManager.RestartApp();
}
}
```