synhershko / NAppUpdate

A simple framework for providing auto-update support to .NET applications
http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/
Apache License 2.0
525 stars 163 forks source link

Issue replacing exe #97

Open equalitybots opened 7 years ago

equalitybots commented 7 years ago

I have an issue updating my application as the file is always locked an the following error occurs Maybe there is something i'm not doing right?

Update task execution failed, failed to update the file is locked.

Using the latest nuget package

`<?xml version="1.0" encoding="utf-8" ?>

Fixes several bugs with the display ` `public LoginForm() { InitializeComponent(); UManager = UpdateManager.Instance; UManager.UpdateSource = new SimpleWebSource("https://localhost.test/xml/update.xml"); UManager.Config.TempFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Equalitybots\Update"); CheckForUpdates(); } private static void CheckForUpdates() { if(UManager.State != UpdateManager.UpdateProcessState.NotChecked) return; try { UManager.CheckForUpdates(); } catch (Exception e) { if (e is NAppUpdateException) { MessageBox.Show(e.ToString()); return; } else { MessageBox.Show(e.ToString()); return; } } if(UManager.UpdatesAvailable == 0) return; UManager.BeginPrepareUpdates(OnPrepareUpdatesCompleted, null); } private static void OnPrepareUpdatesCompleted(IAsyncResult asyncResult) { try { ((UpdateProcessAsyncResult)asyncResult).EndInvoke(); } catch (Exception e) { MessageBox.Show(e.ToString()); return; } try { UManager.ApplyUpdates(true); UManager.CleanUp(); } catch (Exception e) { MessageBox.Show(e.ToString()); return; } }`
equalitybots commented 7 years ago

Issue seems to be that i'm forced to keep a version of NApp.Update.Framework.dll in the executable directory although packed with fody, is there a workaround for this?