Auto Updating WPF App on startup

I am using the autoupdate feature

I need to once the first window has loaded on my WPF app get the system to automatically look for an update and install one if available without using any menus or any prompts. When the update has been installed the software will then restart.

My MainWindow has the control dropped on it

<my2:AutomaticUpdater x:Name="AutoUpdater" Margin="1641,12,23,149" DataContext="{Binding}" GUID="BMI In Room Entertainment Software" HorizontalAlignment="Right"></my2:AutomaticUpdater>Ive created a new version of my application, but nothing happens and also the icon does not appear on my page.

Do you have any code samples for doing this ? I dont want to use menus or buttons to check for an update, i just want it to do it automatically without any prompts to install.

If we can get this working we will be purchasing the software

Cheers Andrew

Hey Andrew,

By default, the AutomaticUpdater checks for updates & automatically downloads and installs them. There's no user interaction needed. You can configure how often the AutomaticUPdater checks by using the "DaysBetweenChecks" property.

Ive created a new version of my application, but nothing happens and also the icon does not appear on my page.

The AutomaticUpdater doesn't show anything when there are no updates. You don't want to bother your users when there's nothing actionable for them to do.

I don't know if you've read it already but the step-by-step walkthrough is a good place to start. In that artcle we walk you through setting up your app and cofirming everything works.

Tell me if this helps.

Thank you for your speedy responce, Ive looked at the helpers and got quite far

So if we want it to update every time do we set the DaysBetweenChecks to Zero ?

That's correct.

Ok great made really good progress, there is just one thing I dont understand.

I have the

wyUpdate.execlient.ywc

from v1.0 of my application in the root with my application.

I have build V1.1

Added the Files to the update location, this all works.

I run wyUpdate.exe manually from the application path, it tells me there are updates available.

I then run my application, nothing updates. However the second time I run my application the system updates.

Can you explian this behaviour ? I need the Software to update first time it runs, am I missing some properties on the control ?

Also will the system only update if the update files are complete ? (we will be uploading the files to location and the files might sometimes be incomplete)

Im very impressed with the software looking just what we need (3000 machine install base, hence the reason why it needs to be seamless 🙂

I have added the following code to my Window_Load function

private void Window_Loaded(object sender, RoutedEventArgs e) { //AutoUpdater being the name of the control AutoUpdater.ForceCheckForUpdate(true); AutoUpdater.InstallNow(); }

Could this be the reason why it doesnt update

Are these arguments valid / or needed or will the control run automatically?

No those lines of code will cause problems. Remove them and tell me if it works.

I am actually encountering the same problems. if I double click wyupdate.exe on the client machine, it says there are updates available. However if I start my app, it doesn't update. I have days between checks set to 0 and wait before check secs set to 1. I want it to update on every single boot. Is there a way to do this?

I want it to update on every single boot.

If you follow the AutomaticUpdater tutorial, add the AutomaticUpdater to your main window, and set the DaysBetweenChecks to "0" at design time, then everything should work as expected.

Are you doing this? If so, what problems are you encountering?

I did try that, but even when wyUpdater itself said there were updates, the application would not update (or sometimes it would only update when restarted). Therefore, I opted to do it via command line, since I knew it was detecting updates correctly. The issue I see now is that it doesn't always launch .exes set to execute once updates are complete. So close!

the application would not update (or sometimes it would only update when restarted).

I see -- in this case you should use the ReadyToBeInstalled event to install the update immediately. Otherwise the AutomaticUpdater will just wait until the next time your app is started.

static void automaticUpdater_ReadyToBeInstalled(object sender, EventArgs e){    // ReadyToBeInstalled event is called when    // either the UpdateStepOn == UpdateDownloaded or UpdateReadyToInstall


    if (automaticUpdater.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall)    {        //TODO: Delay the installation of the update until        //      it's appropriate for your app.


        //TODO: Do any "spin-down" operations. auBackend.InstallNow() will        //      exit this process using Environment.Exit(0), so run        //      cleanup functions now (close threads, close running programs,        //      release locked files, etc.)


        // here we'll just close immediately to install the new version        automaticUpdater.InstallNow();    }}