locked
What is teh best approach fro an application launcher ? RRS feed

  • Question

  • Dear all,

    I need to launch 2 application from a kind of application launcher.
    The idea is that my user start the launcher which then start internally the desired applications.

    Then when application has been started and up and running 2 scenario could be implemented:

    1: The launcher can exit and launched application should still run
    2: The launcher still run in background and monitor the launched application. Then if for some reason one of thel aunched application crash, it should restart it automatically

    How can I perform suc launcher task with thi 2 sneario choice ?

    Thnaks for help
    Regards
    Serge


    Your experience is build from the one of others
    Tuesday, March 30, 2010 8:33 AM

Answers

  • Hello Serge,

    1. In the launcher application, we can call Process.Start() to start another application. http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

    2. After the target application runs, by default the launched application should be executed in a standalone process. If launcher is terminted, the launched applications are not affected.

    3. In the launcher application, you can monitor the launched application in a Timer. http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx. If we find the launched application is not executing unexpectly, we can restart it by Process.Start()

    Hope this helps.

     

    Best regards
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Ji.Zhou Thursday, April 8, 2010 2:02 AM
    Wednesday, March 31, 2010 10:00 AM

All replies

  • Hello Serge,

    1. In the launcher application, we can call Process.Start() to start another application. http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

    2. After the target application runs, by default the launched application should be executed in a standalone process. If launcher is terminted, the launched applications are not affected.

    3. In the launcher application, you can monitor the launched application in a Timer. http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx. If we find the launched application is not executing unexpectly, we can restart it by Process.Start()

    Hope this helps.

     

    Best regards
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Ji.Zhou Thursday, April 8, 2010 2:02 AM
    Wednesday, March 31, 2010 10:00 AM
  • how to properly identify that a launched application is not executing unexpectly ?

    regards
    serge


    Your knowledge is enhanced by that of others.
    Wednesday, March 31, 2010 12:01 PM
  • As Zhou mentioned, you can watch launched application in a timer. For efficient tracking, you can note down the PID of the new process, and see its presence in current processes. If you need more robust coupling between these two applications, then you may need to implement ‘Remoting’ technique. So that , something goes wrong in launched application( an application exception), you can notify launcher immediately.


    Thanks Mike --------Please mark as answer if it is useful----------
    Thursday, April 1, 2010 6:57 AM
  • Yes thnaks but a PID could be present but the application in a Non responding state ?
    Your knowledge is enhanced by that of others.
    Thursday, April 1, 2010 8:14 AM
  • Non responding state means, application is waiting for something or deadlock situation. At that moment, PID is still valid.
    Thanks Mike --------Please mark as answer if it is useful----------
    Saturday, April 3, 2010 7:38 AM
  • Hello Serge,

    The way to detect whether an application is in a non responding state is calling Win32 API SendMessageTimeout function. If it times out, then the target application is in a non responding state. You can refer to the following KB article to know more about this solution.

    http://support.microsoft.com/kb/231844

    http://support.microsoft.com/kb/304991

    Regards,
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Tuesday, April 6, 2010 1:51 PM
  • Hello Serge,

    How are things going on this topic? Do you have any further questions or concers on this? If yes, just let me know and I will try my best to follow up.

    Regards,
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, April 8, 2010 2:02 AM