Service fails to restart after update

Hi

I'm now evaluating wyUpdate for Windows services.

I'm struggling with the end of the update.Even if i added the cutome action to restart the Service after the end of the update, the service NEVER restart corretly after the update.Any hint?ThanksJonathan

Hey Jonathan,

You would need to add debugging and/or logging to your Windows service, because that's where the problem is, so long as you're doing these 3 steps:

  1. Adding the service file(s) to wyBuild so that they will be patched & updated correctly.
  2. Stopping the service before the update.
  3. Starting the service after the update

Also, if you get any errors from wyUpdate please tell me the full error. (Copy & paste).

Why does the service not start back up on update failure?Is there any way to make the service start back up on wyUpdate failure?If files are locked in the update folder, is there any way to tell wyUpdate to just go ahead and kill any processes locking the files?

Why does the service not start back up on update failure?Is there any way to make the service start back up on wyUpdate failure?

Did you let wyUpdate stop the service? Or did you shut it down yourself. Let wyUpdate stop the service, and if there's an error wyUpdate will start the service again.

If files are locked in the update folder, is there any way to tell wyUpdate to just go ahead and kill any processes locking the files?

No, if you're starting wyUpdate from a service there's no UI and thus things like the "files in use" dialog won't be present. You'll have to kill any processes or files in-use. Or use the error logs to catch the error and show a message to the user (either via your logs, or if you have a separate UI, through that).

So after playing a bit i have noticed this :

1-the automatic update fails most of the time BUTwhen runing wyUpdate separatly, it seems to work fine ....

2-may be i misunderstood something, but after the update some files were removed.What happende so the files was deleted ?

Can't i put ONLY new files in Files&Foldes ?Thanks

1-the automatic update fails most of the time BUTwhen runing wyUpdate separatly, it seems to work fine ....

It depends on what options you use, properties you set, and functions you call. There's a lot more room for error when using the AutomaticUpdater. With wyUpdate running standalone it limits your choices (and your room for error).

2-may be i misunderstood something, but after the update some files were removed.What happende so the files was deleted ?

Can't i put ONLY new files in Files&Foldes ?

New release workflow. Add all files to every version and let wyBuild generate the smallest possible patch. If you have files in 1 version and remove the files from wyBuild in the next version, then wyBuild will rightly assume you want to delete the files on the customer's machine.

Does that make sense?

1-Since it is a service running on a client machine, which i don't have direct access i need to have completly silent, standalone update.

Right now, i just have a straight copy of the sample code of the web site (in the Service section)

I'm not sure how much options i use...

2-This is true, but i think that part of my problem is that i don't want to *delete* config file.

How can i protect my xxxx.exe.config from beeing deleted ?Thanks

How can i protect my xxxx.exe.config from beeing deleted ?

Don't include it in any of the versions in wyBuild and wyBuild will ignore it altogether. (It won't patch it and won't delete it).

Did you let wyUpdate stop the service? Or did you shut it down yourself. Let wyUpdate stop the service, and if there's an error wyUpdate will start the service again.

Services call wyBuildUpdater_.InstallNow(), but when there have been issues during update, the services are not running afterwards.

You didn't answer the question. Are you letting wyUpdate stop the service or are you just killing the service and assuming wyUpdate will restart it if something goes wrong in the update?