none
Starting an application on an SD card at boot time(WEC7). RRS feed

  • Question

  • Hello,

    My WEC7 based device boots from an SD card that also contains the application I need to start at boot time.  I have been unable to start the application from the SD card.  If I copy the application to the Windows folder it runs without any problems.  In this case, the key HKLM\Init launchxx = myapp.exe.  The assumtion is that the application is located in the Windows folder.  When the application is located on the SD card, how do I specify that in the Launchxx key?

    Thanks for any help

    Bill

    Thursday, October 23, 2014 2:14 AM

Answers

  • Hi Bill,

    The reason it doesn't work is because at the time the system processes the launch keys in the registry the storage folders are not mounted yet. So, you would need to create a simple native process, let's call it autoexec.exe, that first waits for your your storage device to be fully mounted, and only then launches your application.


    Good luck,

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

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    • Marked as answer by bnwarren37 Tuesday, November 4, 2014 7:48 PM
    Thursday, October 23, 2014 10:37 PM
    Moderator
  • Yes, this is even true if the boot device is the SD card. The only time when the statement is not true is when the SD card is mounted as root.

    Once your device is booted, do you see a folder like "\Storage Card" or "\SD"? If yes, then the SD card is NOT mounted as root and you will have to wait for it to be mounted when you start your app from the Init key. If the answer is no and files are persisted in the root folder, then you have mounted the SD card as root and you should not have to wait for anything when launching your application from the SD. In that case, you would launch it like "\\MyApplication.exe", or "\\MyApplicationFolder\\MyApplication.exe", or, if your application is included in the kernel image: "\\Windows\\MyApplication.exe".


    Good luck,

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

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Friday, October 24, 2014 12:39 AM
    Moderator
  • Hi Michel,

    Is what you are saying true even when the SD card is the boot device?

    Lately, I have been using the Autolauch component with a 30 second delay to fire off my application.  This also fails to work.

    Thanks for your response

    Bill

    Bill:

    So there are several reasons that your app may not be starting.  First, as Michel correctly points out, the disk may not yet have been mounted.   Second, APIs that your app needs may not yet be available.   Third, your app may be dependent on DLLs that you have not made available.  Forth, you may not have the path correct.

    So, you need to confirm that your app runs from the SD card.   Then, can you run it from the command line, that would help you prove that you have the path correct.

    More for you to review:

    http://geekswithblogs.net/BruceEitman/archive/2008/06/13/windows-ce-monitoring-for-disk-insertion-to-add-support-for.aspx

    http://geekswithblogs.net/BruceEitman/archive/2009/03/22/windows-ce-determining-if-an-api-is-available.aspx


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Friday, October 24, 2014 12:49 PM
    Moderator

All replies

  • you don't need to specify it on Launch key instead you have to add the path in loader register settings. check out the below blog by Bruce.

    http://geekswithblogs.net/BruceEitman/archive/2009/02/07/windows-ce-setting-the-system-path.aspx

    http://geekswithblogs.net/BruceEitman/archive/2009/02/07/windows-ce-more-on-starting-an-application-when-the-device.aspx


    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    Vinoth.R

    http://vinoth-vinothblog.blogspot.com
    http://www.e-consystems.com/windowsce.asp


    Thursday, October 23, 2014 9:31 AM
  • launchxx = "SD_CARD\\myapp.exe"

    change SD_CARD to whatever your storage card is called

    Thursday, October 23, 2014 10:33 AM
  • Hello Jaskan, Thank you for your response I believe this is exactly my problem...I don't know what the storage card is called. When I click on My Device from the desktop I see Storage Card listed. Is this the name the system uses to refer to the SD card? How do I confirm what the device is called? I have accessed files on the SD card through a VB app using "Storage Card\RTMapp.hex" to open and read the file. If it wasn't obvious, this is my first CE/WEC7 build! Thanks again Bill
    Thursday, October 23, 2014 11:34 AM
  • I can only suggest search for

    "Folder" including the quotes in Platform.reg ,

    and your device name should be what  its equal to , example "Folder" = "HARD DISK" in my case

    for SD card its "Storage Card" in my wec7

    there are only few of these entries in platform.reg so not a long list to try.

    best to search platform.reg with text editor.

    Thursday, October 23, 2014 2:04 PM
  • Hello Jaskan,

    I did what you suggest and found "Storage Card".  It makes sense in that several things point to that being the device name.  Can you tell me what the exact syntax of the launchxx statement would be?  Launchxx = "Storage Card\\myapp.exe" doesn't work.  Is there additional punctuation needed around the device name? 

    Thanks again for your assistance

    Bill 

    Thursday, October 23, 2014 8:19 PM
  • Hi Bill,

    The reason it doesn't work is because at the time the system processes the launch keys in the registry the storage folders are not mounted yet. So, you would need to create a simple native process, let's call it autoexec.exe, that first waits for your your storage device to be fully mounted, and only then launches your application.


    Good luck,

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

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    • Marked as answer by bnwarren37 Tuesday, November 4, 2014 7:48 PM
    Thursday, October 23, 2014 10:37 PM
    Moderator
  • Hi Michel,

    Is what you are saying true even when the SD card is the boot device?

    Lately, I have been using the Autolauch component with a 30 second delay to fire off my application.  This also fails to work.

    Thanks for your response

    Bill

    Thursday, October 23, 2014 11:57 PM
  • Yes, this is even true if the boot device is the SD card. The only time when the statement is not true is when the SD card is mounted as root.

    Once your device is booted, do you see a folder like "\Storage Card" or "\SD"? If yes, then the SD card is NOT mounted as root and you will have to wait for it to be mounted when you start your app from the Init key. If the answer is no and files are persisted in the root folder, then you have mounted the SD card as root and you should not have to wait for anything when launching your application from the SD. In that case, you would launch it like "\\MyApplication.exe", or "\\MyApplicationFolder\\MyApplication.exe", or, if your application is included in the kernel image: "\\Windows\\MyApplication.exe".


    Good luck,

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

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Friday, October 24, 2014 12:39 AM
    Moderator
  • Hi Michel,

    Is what you are saying true even when the SD card is the boot device?

    Lately, I have been using the Autolauch component with a 30 second delay to fire off my application.  This also fails to work.

    Thanks for your response

    Bill

    Bill:

    So there are several reasons that your app may not be starting.  First, as Michel correctly points out, the disk may not yet have been mounted.   Second, APIs that your app needs may not yet be available.   Third, your app may be dependent on DLLs that you have not made available.  Forth, you may not have the path correct.

    So, you need to confirm that your app runs from the SD card.   Then, can you run it from the command line, that would help you prove that you have the path correct.

    More for you to review:

    http://geekswithblogs.net/BruceEitman/archive/2008/06/13/windows-ce-monitoring-for-disk-insertion-to-add-support-for.aspx

    http://geekswithblogs.net/BruceEitman/archive/2009/03/22/windows-ce-determining-if-an-api-is-available.aspx


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Friday, October 24, 2014 12:49 PM
    Moderator
  • Hi Bruce,

    For the past few days I have been using the Autolaunch component to try and fire off my application.  I have set the startup delay for my process to be 30 seconds.  If I set the Process1 key to be CMD.exe and reboot my device, it appears to work.  CMD.exe is in the Windows folder, so no additional directory specification is necessary.  Now, if I set the Process1 key to myapp.exe and reboot my device AND copy myapp.exe to the Windows folder from the SD card during the 30 second delay, it also works.  All other attempts to get my application to fire off using the true location of myapp.ex on the SD card have failed!

    I feel that my problem is your #4. my path is incorrect.  I don't know how to properly specify the path to my application that resides at the top level of the SD card.  The SD cards device name is Storage Card (embedded space between Storage and Card).

    Any ideas on the format of the path?

    Thanks for your help

    Bill

    Friday, October 24, 2014 3:37 PM
  • Jaskan, I have reported your post as "abuse" (for reasons listed below).

    This is the worst advice ever! NEVER DO A REBUILD AND CLEAN SYSGEN.

    Remove those demonic commands from your PB menu, see here how.

    It is important to understand how the build system works. There is really no need to do a time consuming sysgen to get registry changes in your final kernel.

    Read and try to understand this post. It's a massive time saver and corrupted tree preventing exercise, so take your time to try and understand.


    Good luck,

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

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Friday, October 24, 2014 9:56 PM
    Moderator
  • Hello,

    Both Michel and Bruce suspect/know that my SD card (device name 'Storage Card') that contains my application that I am trying to start at boot time is likely to be unavailable at time the LAUNCH is performed!  So launching the app directly at this point is not possible.  Running a simple app that is part of the build, may be an option.  The app would spin waiting for the 'Storage Card' to appear and then fire off my application.

    I am still trying to get the Autolaunch component to fire off my application (after a 30 second delay) but I have been unable to create the proper syntax for the file specification in the registry key.  HKLM\Startup\Process1="???????"  "\\Storage Card\\myapp.exe"(note the space in the device name) doesn't seem to work for me.  I have tried many different permutations of this compination with no luck. 

    Is anyone familliar with the syntax that would work here?

    Thanks again

    Bill

    Monday, October 27, 2014 3:52 PM
  • Hi Michel,

    I have done what you have suggested and it seems to work perfectly!

    Thanks Michel, Bruce, Jaskan and Vinoth

    Bill

    Tuesday, November 4, 2014 7:53 PM
  • I have deleted the post as requested.
    Tuesday, February 2, 2016 7:58 PM
    Moderator