Application Auto-Update Question Hi,<br><br>I've written an application which will run constantly and from a remote location.<br><br>What I want to do is to have the application checking weekly for updates and if there's a newer version then update to the new version.<br><br>So what I need to know, what is the best way to go about doing this.<br>Obviously an application cannot update itself because it needs to be closed to update it.<br><br>What I was thinking was, having an application running that starts my application, and it checks weekly for an new update, if it finds it it closes my application, updates it and then restarts it with the update applied.<br><br>The way the update will be applied is to overwrite the application that's already there(while also keeping a backup of the old version just incase).<br><br>So would this be the best way to do something like this - anyone got any other suggestions or point me to some sites that can help me do this.<br><br>Thanks alot,<br><br>Eoin...© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Zd8ee7275-4801-4a34-8254-e8d381ca1a6ahttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#d8ee7275-4801-4a34-8254-e8d381ca1a6ahttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#d8ee7275-4801-4a34-8254-e8d381ca1a6aIrishJokerhttp://social.msdn.microsoft.com/Profile/en-US/?user=IrishJokerApplication Auto-Update Question Hi,<br><br>I've written an application which will run constantly and from a remote location.<br><br>What I want to do is to have the application checking weekly for updates and if there's a newer version then update to the new version.<br><br>So what I need to know, what is the best way to go about doing this.<br>Obviously an application cannot update itself because it needs to be closed to update it.<br><br>What I was thinking was, having an application running that starts my application, and it checks weekly for an new update, if it finds it it closes my application, updates it and then restarts it with the update applied.<br><br>The way the update will be applied is to overwrite the application that's already there(while also keeping a backup of the old version just incase).<br><br>So would this be the best way to do something like this - anyone got any other suggestions or point me to some sites that can help me do this.<br><br>Thanks alot,<br><br>Eoin...Fri, 06 Jun 2008 19:38:30 Z2008-06-06T19:38:30Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#3bae2ca1-ee75-4683-8510-c98dd57c590fhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#3bae2ca1-ee75-4683-8510-c98dd57c590fMatt Galbraith - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Matt%20Galbraith%20-%20MSFTApplication Auto-Update Question Hi Eoin,<br>    <br>    ClickOnce has done about 90% of the work for you there already.  If you can publish your app as a ClickOnce app, you can simply tell it to check for updates every 7 days from an arbitrary URL you specify, then write an app to restart your ClickOnce app when it updates itself.<br><br>Interesting ClickOnce update <a href="http://msdn.microsoft.com/en-us/magazine/cc163973.aspx">article here</a>.<br><br>Simply go to your project properties, &quot;Publish&quot; tab, and click &quot;Updates&quot;.  You'll want to select &quot;The Application should check for updates&quot;, the &quot;After the application starts&quot; option (since the &quot;before&quot; option will require user intervention).   Additionally you can programatically check for updates whenever you like.  When updates are available, you can programatically apply them.  There's a good sample of that here: <a href="http://msdn.microsoft.com/en-us/library/ms404263(VS.80).aspx">http://msdn.microsoft.com/en-us/library/ms404263(VS.80).aspx</a> .<br><br>Once you've updated your app, you will need to restart it.  Here's where the extra 10% of work comes in.  You'll want to write an app (could even include this as a &quot;content&quot; file with your CLickOnce deployment) that runs on this machine, and monitors for when your app's process closes.  When you detect an update, you'd want to start this process via Process.Start(), then simply call <font color="#2b91af" size=2>Application</font><font size=2>.Current.Shutdown();.  When the process exits, the special &quot;restarter&quot; app can just re-invoke it via its shortcut in the start menu (.appref-ms.... clickonce apps are special like that)... and you have your self-sustaining app update scenario.<br><br>Hope this helps,<br>Matt</font><hr size="1" align="left" width="25%">SDET : Deployment/HostingFri, 06 Jun 2008 20:32:37 Z2008-06-06T20:32:37Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#c50fa431-a9c7-4d7e-bdce-8f45b411bfcchttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#c50fa431-a9c7-4d7e-bdce-8f45b411bfccIrishJokerhttp://social.msdn.microsoft.com/Profile/en-US/?user=IrishJokerApplication Auto-Update Question Ah cheers man,<br><br>Had heard anout the ClickOnce thing, but didn't really know what it was about.<br><br>Thanks for your help,<br><br>Eoin...Fri, 06 Jun 2008 20:53:36 Z2008-06-06T20:53:36Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#92c0743a-db26-49e8-af0d-e6cb53440972http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#92c0743a-db26-49e8-af0d-e6cb53440972IrishJokerhttp://social.msdn.microsoft.com/Profile/en-US/?user=IrishJokerApplication Auto-Update Question I was reading the links you sent me.<br>It looks like ClickOnce applications run in a sand-box mode.<br>I actually need a full trust application because I'll be reading and writing files/directories to the file system.<br><br>So unfortunately this doesn't seem to be what I'm looking for.<br><br>Is there a different way to use the ClickOnce model ??<br><br>Thanks<br><br>Eoin...Fri, 06 Jun 2008 21:27:14 Z2008-06-06T21:27:14Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#52d7d0ad-ab19-4d2e-b944-9c54098f6d9chttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#52d7d0ad-ab19-4d2e-b944-9c54098f6d9cPaul Czywczynskihttp://social.msdn.microsoft.com/Profile/en-US/?user=Paul%20CzywczynskiApplication Auto-Update QuestionNot true, our application runs in full trust and is deployed via click-once. There are two different types of WPF click-once applications; normal EXEs and XBAPs. XBAPs are click-once deployed inside the browser and thus run in a sandbox. Fri, 06 Jun 2008 21:44:55 Z2008-06-06T21:44:55Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#72ceebd5-6201-4f05-b099-3ef1a90588cchttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#72ceebd5-6201-4f05-b099-3ef1a90588ccMatt Galbraith - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Matt%20Galbraith%20-%20MSFTApplication Auto-Update Question Paul is correct.  Further, xbaps under special setups can actually run with full trust.    I just want to add that the only kind of WPF ClickOnce app that can actually check for updates is the standalone app, since this is the only &quot;installed&quot; clickOnce app.  Since it doesnt run in the browser and has to create windows, it's not just full-trust by default, it is actually blocked from running in partial trust.  (Since the WPF window has a security demand for permissions outside the Internet / Intranet zones).<br><br>-Matt<hr size="1" align="left" width="25%">SDET : Deployment/HostingFri, 06 Jun 2008 22:29:23 Z2008-06-06T22:29:23Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#2292277a-188a-42f5-bfab-e8a693379d6ahttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d8ee7275-4801-4a34-8254-e8d381ca1a6a#2292277a-188a-42f5-bfab-e8a693379d6aIrishJokerhttp://social.msdn.microsoft.com/Profile/en-US/?user=IrishJokerApplication Auto-Update Question Well my application will be an installed application so it should be ok then.<br><br>I'll read up more on ClickOnce.<br><br>Your help was much appreciated.<br><br>Thanks again lads,<br><br>Eoin...Fri, 06 Jun 2008 22:31:36 Z2008-06-06T22:31:36Z