This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- FlexNet Connect
- :
- FlexNet Connect Forum
- :
- Re: a way of closing the application
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 21, 2004
08:52 AM
a way of closing the application
I am looking for a way to close the application once the user initiates the process of updating their application. If the wizard comes up it means we have an update if the user starts using that wizard is there a way to close the parent application??? Any ideas?
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2004
10:28 AM
It depends on what kind of application you have, but exit() works for me in C/C++ land.
The point is, it's up to the developer to figure out what to do if an update's available. If you want to exit your app, call your exit routines. Once the update starts downloading (ie, you call AppUpdate()) the agent takes care of the install. You can quit your app at that point.
The point is, it's up to the developer to figure out what to do if an update's available. If you want to exit your app, call your exit routines. Once the update starts downloading (ie, you call AppUpdate()) the agent takes care of the install. You can quit your app at that point.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 10, 2005
10:33 AM
But how do you know when it's complete? How do you know if it's found a new version? I didn't see any events that I can "hook" into (I'm using VB.NET and COM Interop to access the COM Object) so how can I determine when to actually shut down?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 10, 2005
10:50 AM
emcknight wrote:
But how do you know when it's complete? How do you know if it's found a new version? I didn't see any events that I can "hook" into (I'm using VB.NET and COM Interop to access the COM Object) so how can I determine when to actually shut down?
emcknight --
I'm using C# and COM Interop, so my situation is pretty similar. What I would do in your situation is call EnumUpdates() first to see if there are any updates. Then I use GetProcessByName (under System.Diagnostics.Process) to get all the running instances of my application. Once I have that list of processes, I iterate through the list and close each process with CloseMainWindow().
You probably could attach an event handler to the Agent's OnDownloadBegin event and close the apps there, which would save you the step of using the EnumUpdates. However, that might create a race condition between the closing of the app and the completion of the download. For example, if your app is like ours, it asks the user to save when it's closing and there is unsaved data. If the user doesn't notice this, then the download could very well finish and the update run before you close you app.
Hth,
T.J.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)