none
Launching .NETCF Application at boot up RRS feed

  • Question

  • Hi everyone,

    I am developing a netcf application on windows compact 2013 frame work which needs to start upon bootup of device. For this I kept the application under init sequence with sequence of launch80 (replacing 'minshell.exe' when 'SHELL_MODULES_MINSHELL' is selected as in my case) and with dependency on gwes.dll and services.exe.

    On boot up my application and system hangs. My application requires to check \ Create some directories, Pings some network location and Read\Write registry settings.

    If I do not replace shell.exe i.e., if launch sequence has shell.exe before my app launch then everything works fine. But i do not want shell.exe in my launch sequence.

    Please suggest How to wait \ check if all required dependent framework is ready before executing app code ?

    Thanks in advance.

    Tuesday, April 17, 2018 10:09 AM

Answers

  • At the time when the system processed the Launch keys, the system is not ready to run .NET CF applications yet. You will need to create a native executable that waits for certain APIs to be ready (see WaitForAPIReady, wait for SH_WMGR) before launching your .NET application. You may also want to wait for certain stores to be mounted, or for instance to wait for a valid IP address before launching your application.

    In the GuruCE BSP we have a component called AutoExec that you can configure (through registry settings) to wait for all .NET CF APIs to be ready, but also to wait for a specific store to be mounted or a valid IP address to be available. It can start apps, but also kill apps, and also has a fallback mechanism in case starting an app fails. You can go crazy with this (as we did)... ;-)

    More info in this thread and some code I wrote a long time ago here.


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6


    Tuesday, April 17, 2018 11:42 AM
    Moderator

All replies

  • At the time when the system processed the Launch keys, the system is not ready to run .NET CF applications yet. You will need to create a native executable that waits for certain APIs to be ready (see WaitForAPIReady, wait for SH_WMGR) before launching your .NET application. You may also want to wait for certain stores to be mounted, or for instance to wait for a valid IP address before launching your application.

    In the GuruCE BSP we have a component called AutoExec that you can configure (through registry settings) to wait for all .NET CF APIs to be ready, but also to wait for a specific store to be mounted or a valid IP address to be available. It can start apps, but also kill apps, and also has a fallback mechanism in case starting an app fails. You can go crazy with this (as we did)... ;-)

    More info in this thread and some code I wrote a long time ago here.


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6


    Tuesday, April 17, 2018 11:42 AM
    Moderator
  • Hi Michel,

    Thanks for your reply and I tried launching a native application which checks for all the necessary API's (like SH_WMGR, HT_SOCKET etc.,) were ready or not and then it would launch my .NET application. This method seems to be working fine as I tried many times and no crash had happened in my application.

    Tuesday, April 24, 2018 1:39 PM