From df894eca1150a74c06773159b05701920f9585d3 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Mon, 30 Aug 2021 12:14:53 +0100 Subject: [PATCH] Fix readme code example --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b6467eec..ec621c3f 100644 --- a/README.md +++ b/README.md @@ -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(); + } } ```