Terminate process before update

Hi,

Im using wyBuild 2.6.17.1 and wyUpdate 2.6.16.4. I have a vb.net application using the AutomaticUpdater control on my main form with updatetype set to Automatic. Recently I added a second exe to my program files directory which starts up with Windows and sits in the system tray as a reminder system for my first exe. When updating, wyUpdate asks to terminate the 2nd exe process before finishing the update. Is there a way of specifying the name of the process to terminate (like the Update Action in wyBuild) to avoid the terminate message?

Thanks,Paul

No, but you can use the "ReadyToBeInstalled" event or the ClosingForInstall property of the AutomaticUpdater to close this tray app.

Thanks Wyatt. I did look at ReadyToBeInstalled and thought that was OK if the user wanted to update immediately. But what about if they just wait till the next day when they restart the program? Is the ClosingForInstall event triggered when I restart the program the next day, before the new version is installed?

Yes, you can use the ClosingForInstall property in your form's constructor.

Wyatt, in the constructor I use something similar to the following code:

Public Sub New() InitializeComponent() If Not automaticUpdater.ClosingForInstall Then CloseForm = False Else KillTrayApp CloseForm = True End IfEnd Sub

After an update, I close the program. When I restart, I login (the login form appears before the main form, main form is the startup form) the program closes again but the update doesn't happen. I can see the wyUpdate process sitting in the windows task manager. When I restart again, this time after logging in it kicks off the update.

Funny thing is, if I stick a msgbox after closeform = true, the update happens on the first open. Any ideas?

Why are you using CloseForm at all?

In the example on your site, instead of using something like LoadFilesEtc, I use the form load event and just set the boolean CloseForm in the constructor to use later in the form load.

Public Sub New() InitializeComponent() ' only load files, etc. when NOT closing to install an update If Not automaticUpdater.ClosingForInstall Then ' load important files, etc. ' LoadFilesEtc() End IfEnd Sub

Is the AutomaticUpdater on the first and "main" form of the app? If not, then you'll have problems.

No, its not on the first form (login) which is called from the application events, before the main start up form is loaded like so:

Using frm As New LoginForm Select Case frm.ShowDialog() Case DialogResult.OK 'The user logged in successfully so let the app startup normally. Case DialogResult.Cancel 'The user cancelled the login so exit the app. e.Cancel = True End SelectEnd Using

I'll test putting AutomaticUpdater on the login form.

Having the control on the login form fixed the problem.