I forgot to say: I have to click "Install now" and close the form and outlook manually - otherwise it doesn't work!
Hi!
I have created a VSTO Outlook AddIn (C#, Visual Studio 2010, .NET 3.5).The AddIn works fine. Now I want to implement a full automatic Update.
The steps should be:1. Automatic check if any update is available2. Inform the User, close Outlook and install all the updates
The check works fine, but I am not able to implement that the wyupdate install everything without user-interaction. The UpdateType is set to "Automatic". When Updates are available the AutomaticUpdate component recognize that and tells the user "Update is ready to be installed". If I close the form manually, close Outlook (directly) the update is getting installed.
How can I implement that programmatically? I tried the event "UpdateAvailable" => Automatically Close Outlook => nothing happens!
Is there any parameter for wyUpdate.exe to start installing the available updates (eg: -installNow)?
Thanks for your help!
I forgot to say: I have to click "Install now" and close the form and outlook manually - otherwise it doesn't work!
AutomaticUpdates are installed on the next start of an application. If the updates aren't being installed this means that Outlook isn't calling the OnLoad event the form you're embedding the AutomaticUpdater on.
Is there any parameter for wyUpdate.exe to start installing the available updates (eg: -installNow)?
If you look at the AutomaticUpdater members you can see the InstallNow() method. This forces the installation (instead of waiting for the next start).
Tell me if this helps.
I already tried InstallNow(). Do you fire any event when pressing Install now or call the method InstallNow()?
I tried to to the following:
private void automaticUpdater1_ReadyToBeInstalled(object sender, EventArgs e) { automaticUpdater1.InstallNow(); MessageBox.Show("Updates are available. Outlook will be closed...", "Update available", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); iMSOutlookAddIn.Globals.ThisAddIn.__UpdateAvailable = true; this.Close(); }
And I close Outlook in the ThisAddIn.cs class when __UpdateAvailable == true.
But it doesn't work. I have to click manually on "Install now".
If there is any event after clicking on "Install now" I will debug whats the difference..
I also could start the wyUpdate.exe with parameters to install the updates now. But I don't know how. I can't find any parameter in the source code to directly start the installation....
Thanks for your help!!!
I also could start the wyUpdate.exe with parameters to install the updates now. But I don't know how. I can't find any parameter in the source code to directly start the installation....
wyUpdate doesn't use parameters - it uses named pipes for communication between the automatic updater and itself.
InstallNow() alone should close Outlook. Calling InstallNow() after an update has been downloaded and extracted calls "Application.Exit();".
That is, calling InstallNow() is equivalent to manually clicking InstallNow in the Automatic Updater UI. So trim down your function to simply calling "InstallNow()".
Tell me if this helps.
I tried three ways:
1. I call InstallNow() in the form of my AddIn, then I call this.Close() to close the form and then I call this.Application.Quit() to close Outlook => nothing happens
2. I made automaticUpdater public (in the form iMSCont), then I call this.Close() to close the form, then I call iMSCont.automaticUpdater1.InstallNow(); and I do not quit Outlook with this.Application.Quit() => Outlook is not getting closed by InstallNow.. nothing happens!
3. The same as in way 2 but additionally I called the method this.Application.Quit() after InstallNow() => Nothing happens!
I always call this.Close() in the event "ReadyToBeInstalled".
Now I've gt no idea anymore.. It is so strange, cause if I close everything manually it works!!!
If manually clicking install update closes Outlook, then you can express the same thing in code. Simply call InstallNow().
Remove all other calls to closing functions, etc. Make InstallNow() the last bit of code your application explicitly calls (i.e. don't add extra Close() and Exit() calls. They're meaningless and are probably interfering.)