Transparently download and restart wpf application

Hi,

Sorry for asking this, I've read "How can I completely hide the updater" and the faq but I'm not entirely sure on this topic. I have a WPF application that I want to automatically poll for updates transparently to the user, when one is found it should

1. download the update2. signal the wpf application when everything is downloaded and ready to install 3. quit the application4. Install the updates5. Restart the application (with some commandline parameter if possible to signal that it's started by the updater)

( The WPF application isn't always visible and it's no problem restarting it so I can do the actual update when the user is not using the program or idle)

I'm a little unsure how the process goes with the automaticupdatercontrol. I'm guessing it launches wyupdater.exe, communicates through named pipes or something when it's done downloading so that the application closes itself. does the updating and then restarts the application.

If that's the case that's pretty much what I want to do except just hiding the interface bits, could I use the -skipinfo parameter to achieve this? Are there timing issues with closing down the wpf app and doing the update?

The AutomaticUpdater talks to wyUpdate.exe in the background the "silently" handle most of the updating process. But when it comes to the actual last steps (installing the new files, registry, etc.) then your app has to be closed and wyUpdate must be shown. The reason you should show wyUpdate is that your users will know exactly what is going on.

You can customize all the branding of wyUpdate so they know it's your app being updated.

Does that clarify things?

Yeah i understand, but in this case I don't want to show wyUpdate, is it possible? Using a Windows Service wouldn't be a good fit since the app should be runnable from a memorystick as well

best regards--Mattias

Yeah i understand, but in this case I don't want to show wyUpdate, is it possible?

Other than using a Windows service, no it's not possible. The end-user needs to know an update is happening. You shouldn't hide this from them or they will get frustrated.

Hello,Im having the same problem as Mattias, i have some .net clients for my digital signs where there are no users to interact with the screen. This means i would like to also, update and restart seamlessly. Is this really not possible? I mean, your argument of "the user should really know the software is being updated" is irellevant when i have no users at the computer, since its hanging by a chain 3 meters above the ground.

I also doesnt agree that a windows service is the only solution, my client could look for updates silently, then if anyone is present then spawn a new process that silently uses wyUpdate to update and then when its done, it restarts the main client. The solution then is to have your client build, compile and execute a new seperate .exe file.

Well, besides the custom solution described above, is there not any way that i could tell the wyUpdater to restart the application when finished installing? It sounds like a very common scenario?

Hey Brian,

Is [updating apps without user-interaction] really not possible?

Mattias was talking about hiding the UI. In that case the only option is to use a Windows Service.

However, your case is possible. In fact there are quite a few ways to do it. The Windows Service method is the best "works on all computers" method.

You can do updates that don't require any user interaction in any of the following cases:

  1. Using a Windows Service to do the updates. Right now this requires building your own "dummy" service to launch wyUpdate (see: How to Silently update a Windows Service or AutomaticUpdater tutorial for Windows Services and Console Apps)
  2. Run wyUpdate either standalong or using the AutomaticUpdater -- with a non-elevated user installing to a folder that the user has access to (%appdata%, documents folder, desktop, etc.).
  3. Run wyUpdate either standalong or using the AutomaticUpdater -- with an elevated user.

In all of these cases you can check for updates, install them, then restart your app. See this FAQ answer: How can I completely hide the updater (wyUpdate)? for all the details.

Method 1 the wyUpdate UI is completely invisible. Methods 2 and 3 the UI is visible (during the updating) but it closes and launches your app once the updating is complete.

Tell me if this helps.

[...] since its hanging by a chain 3 meters above the ground.

That sounds interesting. Any chance you could tell me more (just for curiosity sake)?

Hi Sam,Thank your for your reply, i will try that out and see if it solves my problem.

In regards to my screens; im developing a digital signage solution where big LCD screens are mounted so people can see them (typically high). My software running on that screen is typical on an embedded Windows PC or some other kind of PC. My problem is that when they (the customers) have 50 screens spread across town (libraries, shops, music venues etc.) i spend one whole day updating them all and driving across town.

So a solution where the software can update itself will help a great deal.

My problem is that when they (the customers) have 50 screens spread across town (libraries, shops, music venues etc.) i spend one whole day updating them all and driving across town.

In wyBuild 2.7.x or 2.8 we want to include a "drop-in solution" for just this type of problem. Namely, an administrator updating many computers on a separate network all without leaving his/her chair. We want to make it drop-dead simple for admins to update apps remotely (and to do other cool things like rollout the update one intranet at a time).

Do you mind if I pick your brain about your current setup, and how you would imagine the ideal update distribution method?

Thank your for your reply, i will try that out and see if it solves my problem.

If you have any questions I'll be happy to help.

Hello Sam,My setup is like this:

* ASP.NET MVC administration tool (authoring, configuring etc. of digital signs)* ASP.NET asmx Webservice for business logic (screens, slides, presentations etc.)* ASP.NET asmx Webservice for upload/download of images* WPF Client for presenting data (communicates with the web services)

Typically the administration tool is used for only administration of slides/presentations, but im thinking about how i could manage updating all the WPF clients through this web client, so that the user/administrator should have no knowledge of FTP/update etc. and he then just should click a button when his system tells him that a new version is available.

My first step is to include wyUpdate in the WPF client, so there will be no more manual work included in updating the WPF clients. The remaining manual work then, is to FTP updates etc up to where the WPF clients look for updates.

If you need more info or want to keep it out from the support thread, please feel free to mail me at brian (at) greenweb.dk

Thanks for providing this, Brian. We're going to keep situations like your in mind when we finialize the "drop0in" solution in 2.7.x/2.8