Thursday, December 06, 2012 2:52 PM
Hello Everyone !
I have a question for all you WES 7 gurus,
I have set my custom application as the main shell. I have read in the forum that it would be restarted automatically by the shell launcher in the event of crash and it actually does but what would happen if my custom shell doesn't crash but freezes out?
Would the eshell recognize this freezing event and restart my custom shell anyway? I don't think so...
How could I make the eshell restart my custom shell?
How can I make my custom shell recover in the event of freezing?
Thanks so much you guys!
Thursday, December 06, 2012 5:44 PM
I am not sure if it is a good idea to set your application as the main shell. I am not a WES 7 guru but I don't think things changed so much since XPe and the shell launcher of XPe has a strange behaviour sometimes. Trusting in shell launcher might lead in uncontrolled half dead processes of your application - I have seen this before.
We solved it with a very lightweight custom shell that does not have a GUI at all. The custom shell is just a piece of C++ code that does nothing but starting the GUI application and restarts the custom gui application just like the shell launcher would do it. But this small shell could also check if your custom application responds or is freezed - in case it does not respond it could kill the process of your custom application and start it again. But you should never be in an undefined or uncontrolable state.
In other words: the custom shell is just a small watchdog for your gui application that can even restart the PC in case your application does not launch any longer.
But perhaps there exists a better solution for this ...
Thursday, December 06, 2012 9:46 PM
That is what the shell launcher (eshell) is - a small watch dog that launches the shell and relaunches the shell if the shell is closed. Application freezing should force the eshell to relaunch the shell. Explorer.exe does this when it gets stuck, but since there no documentation, they only way to prove this is to somehow freeze the shell.
www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET
Friday, December 07, 2012 9:38 AM
Thanks a lot geo-ring and Sean !
I agree with geo-ring that using my custom application as the main shell would not solve the problem of restarting my application in case it does not respond anymore (i.e. freezed).
Actually my first decision, as also recommended in Sean's 2Ed. book, would have been to use the cmd.exe as the main shell to launch my custom application and which I could also use to restart it in case of failure. The only problem with this solution is that I don't want the user to access the cmd.exe. (you can figure out the reason why...)
Is there any way in which I could make the cmd running as the main shell in the background without being visible/accessible to the user and make it appear (pop up) in some way (for example by the means of a secret keyboard shortcut or a password)?
PS. Thanks Sean for your book which is helping me so much with the development of my WES7 image, keep up the good work!!