AutomaticUpdater inside Console App

Hello,I'm trying to use wyBuild product to update automatically my console application. I'm having problems in the integration of Automatic Updater control into my application. I added the source code of the example in my own app but application is doing nothing, seems that is not checking nothing.

Can somene explain me more deply how to include AutomaticUpdater into my console app???

Thanks in advance,

I know that the question was so generic, as a first aprox. can you reply a few questions:

1. Where i have to find the GUID value, into client or inside console app.???2. The example, checks update each 10 days, it's possible to check more frequently??

Thanks!

1. Where i have to find the GUID value, into client or inside console app.???

Well, you can see in the AutomaticUpdater tutorial for Windows Services and Console Apps article (which also covers console apps) that you set the version GUID to something that uniquely identifies your app.

For example: "yourcompany-yourappname". In other words it's something you make up. You can generate a GUID if you want. Or you can just use you made up.

You just need to remember that the GUID has to remaning constant over the life of your app. That is, don't create a new GUID every new version. Just create one GUID once, and leave it like that.

2. The example, checks update each 10 days, it's possible to check more frequently??

Yep, see: AutomaticUpdater Members. Specifically the "DaysBetweenChecks" property.

I added the source code of the example in my own app but application is doing nothing, seems that is not checking nothing.

If there are no updates then it doesn't do anything. Also, you can use the events to see what's happening.

Thanks for your reply.

I have followed the example of Console application, and when I run the process with TestApp is running fine, and the app is updating correctly. But when I'm modifing my own console app the method ForceCheckForUpdate always returns false. Which information is using this method in order to return false? What is the diference??

Thanks!

hello again!

I think that the problem is related with eventReset.WaitOne() call. I have added it to the source code and now it's working, but this mehtod is stopping the process. I mean my application is a continuous loop (while(true)). But in some case I want to ForceCheckForUpdate(), but if i put this eventReset.WaitOne() the process is waiting and event and not running.

Can you explain me better the functionallity of this eventReset???How can I use it without blocking the process??

thankss!

ForceCheckForUpdate always returns false.

ForceCheckForUpdate() only return true if it starts to check (and false if it doesn't start). It doesn't tell you the result of the checking. For that you need to use the event. See: AutomaticUpdater Members.

Can you explain me better the functionallity of this eventReset???How can I use it without blocking the process??

If there any reason you're using the AutomaticUpdater in a console app? Console apps are typically synchronous (i.e. one action happening after the next).

If you're just making a test app to test the AutomaticUpdater then you'd be better off making a simple Windows Forms test app. If you're making a console app and you want to check for updates on every start then you'd probably have an easier time using wyUpdate in standalone mode. See: How to Silently Check for Updates.

Thanks a lot for your reply!

Now I understand the behaviour of ForceCHeckForUpdate() 😀

Perhaps I haven't explained correctly with the other question. My Console app is like this:

void main(args[] args){

while (true){ if(DateTime.Today == getRegisterDate){ //Do something 1 } else{ auBackend.ForceCheckFOrUpdate(); eventReset.WaitOne(); //Do something 2 } }}

And continually the app is doing "somthing1" and 1 time in a day is doing "something2"

My question was, If I force to check for update and then uses event reset, which is the behaviour? the app will be waiting update event? or there is another event that can't be caught ant the the process do "something2"?

Thanks a lot for your answers!!! I'm trying to decide if this software is usefull for our target, if yes we will buy it in our company.

Threading is a huge topic. The AutomaticUpdater is written for things like Windows Forms apps, and Windows Services, and even multi-threaded console apps. However, it sounds like you're make a single-threaded app. In which case it might be easier to use wyUpdate in standalone mode.

If you still want to pursue using the AutomaticUpdaterBackend in your conole app, then you can take a look at the AutomaticUpdater source code. In the zip archive we have a project called "TestConsoleApp" that shows how to use ManualResetEvent so you can "get" the event response from the AutomaticUpdaterBackend.