Every app deserves a HappyBin!

Pages: Implementation, Updater Workflow


Example of call from WinForms client application:
using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;

namespace WinFormsHappyBinSample
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();

			this.Text = Assembly.GetEntryAssembly().GetName().Version.ToString();
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			Process.Start( "HappyBin.AutoUpdater.exe" );
		}
	}
}

Example of client config file (located with HappyBin.AutoUpdater.exe):
<HappyBin.AutoUpdater.Properties.Settings>
    <setting name="UpdateConfigUri" serializeAs="String">
        <value>http://www.foobar.org/updates/updateconfig.xml</value>
    </setting>
    <setting name="RuntimeExe" serializeAs="String">
        <value>notepad.exe</value>
    </setting>
    <setting name="DownloadFolder" serializeAs="String">
        <value>patches</value>
    </setting>
    <setting name="WaitForExitMillseconds" serializeAs="String">
        <value>30000</value>
    </setting>
    <setting name="StartRuntimeExeAfterInstall" serializeAs="String">
        <value>True</value>
    </setting>
</HappyBin.AutoUpdater.Properties.Settings>

Example of update config file (located on webserver or file path):
<UpdateConfig>
  <CurrentVersion>10.2.3.4</CurrentVersion>
  <IsMandatory>false</IsMandatory>
  <PatchUri>http://www.foobar.org/updates/1031.zip</PatchUri>
</UpdateConfig>

Last edited Nov 3, 2013 at 4:19 PM by steveshortt, version 11