after setting up a simple test application in a following fashion I cannot seem to get it to perform actual update.
Application is a simple exe that has dependency on single dll. DLL only contains class with 1 method to display version number (just as to check if the update was successful).
When running a test application finds the updates, applies 'em and then restarts. However upon restart still the same version number is displayed.
public partial class Form1 : Form
{
#region Constructor
public Form1()
{
InitializeComponent();
SetupUpdateManager();
}
#endregion
private void SetupUpdateManager()
{
UpdateManager.Instance.UpdateSource = new NAppUpdate.Framework.Sources.SimpleWebSource("
http://localhost/feed.xml"); // provided is the URL for the updates feed
//UpdateManager.Instance.ReinstateIfRestarted(); // required to be able to restore state after app restart
// Clear temp folder
const string updateDirectory = @"C:\Test\Updates";
UpdateManager.Instance.Config.TempFolder = updateDirectory;
if (Directory.Exists(updateDirectory))
{
try
{
Directory.Delete(updateDirectory, true);
}
catch { }
}
Directory.CreateDirectory(updateDirectory);
}
private void Form1_Load(object sender, EventArgs e)
{
lblVersion.Text = VersionHelper.Version;
}
private void OnPrepareUpdatesCompleted(bool tru)
{
UpdateManager.Instance.ApplyUpdates(true);
}
private void button1_Click(object sender, EventArgs e)
{
if (UpdateManager.Instance.CheckForUpdates())
{
UpdateManager.Instance.PrepareUpdatesAsync(OnPrepareUpdatesCompleted);
}
else
{
MessageBox.Show("Your software is up to date");
}
}
}