本文整理匯總了C#中Squirrel.UpdateManager.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# UpdateManager.Dispose方法的具體用法?C# UpdateManager.Dispose怎麽用?C# UpdateManager.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Squirrel.UpdateManager
的用法示例。
在下文中一共展示了UpdateManager.Dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Update
private static async void Update(Task<string> result)
{
if (result.Result == null || result.Result != "1")
return;
try
{
using (var mgr = new UpdateManager(@"https://releases.noelpush.com/", "NoelPush"))
{
var updates = await mgr.CheckForUpdate();
if (updates.ReleasesToApply.Any())
{
var lastVersion = updates.ReleasesToApply.OrderBy(x => x.Version).Last();
await mgr.DownloadReleases(updates.ReleasesToApply);
await mgr.ApplyReleases(updates);
var latestExe = Path.Combine(mgr.RootAppDirectory, string.Concat("app-", lastVersion.Version), "NoelPush.exe");
mgr.Dispose();
RestartAppEvent();
UpdateManager.RestartApp(latestExe);
}
mgr.Dispose();
}
}
catch (Exception e)
{
LogManager.GetCurrentClassLogger().Error(e.Message);
}
}
示例2: InstallEvent
public static void InstallEvent()
{
var exePath = Assembly.GetEntryAssembly().Location;
var appName = Path.GetFileName(exePath);
using (var mgr = new UpdateManager(@"https://releases.noelpush.com/", "NoelPush"))
{
mgr.CreateShortcutsForExecutable(appName, ShortcutLocation.StartMenu | ShortcutLocation.Startup, false);
mgr.CreateUninstallerRegistryEntry();
mgr.Dispose();
}
}
示例3: UninstallEvent
public static void UninstallEvent()
{
using (var mgr = new UpdateManager(@"https://releases.noelpush.com/", "NoelPush"))
{
mgr.RemoveShortcutsForExecutable("NoelPush.exe", ShortcutLocation.StartMenu);
mgr.RemoveShortcutsForExecutable("NoelPush.exe", ShortcutLocation.Startup);
mgr.RemoveUninstallerRegistryEntry();
mgr.Dispose();
}
}
示例4: UpdateEvent
public static void UpdateEvent()
{
using (var mgr = new UpdateManager(@"https://releases.noelpush.com/", "NoelPush"))
{
mgr.CreateShortcutsForExecutable("NoelPush.exe", ShortcutLocation.StartMenu | ShortcutLocation.Startup, false);
mgr.Dispose();
}
}