Silent update using C# code for Windows Service

I've walked through the example of using the C# code to configure, and trapped events for a Console, and Windows Service.

The code I have for the Console app seems to work if I follow the guidelines.

I did the same for the Windows Service, however, when it calls the InstallNow method on your AutomaticUpdater it seems it just goes off and never returns. The service stops, but the install never occurs.

However, if I run the wyUpdate.exe manually it will update fine.

Any help would be appreciated. I love the product, and want to demo the process for our team.

I wanted to add would it have anything to do with some of the methods in the sample are static, but then others being used in the service are not?

I wanted to add would it have anything to do with some of the methods in the sample are static, but then others being used in the service are not?

No, that shouldn't have an effect.

Does your ReadyToBeInstalled event handler look something like this:

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


    if (auBackend.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        auBackend.InstallNow();    }}

That is, do you check if "auBackend.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall" before calling InstallNow()?

Also, open your task manager -- when your service calls InstallNow(), does wyUpdate start? Does it close right away or does it stay open?

Lastly, if you give me your email (or if you send an email to support@wyday.com) I can send you the new version of the AutomaticUpdater we'll be releasing in a day or 2. This fixes some bugs that might be effecting you.

Thanks. Great response time by the way. Much appreciated.

I'll send to your support address now, and include answers to your questions.

Thanks so much.

I've sent you the newest AutomaticUpdater -- tell me if that solves your problems.

Any word on whether that fixed the problem? I had the exact same problem a few weeks ago and gave up after a few days of head banging.

Pete, I've sent you the latest version of the AutomaticUpdater.