none
Custom Shell not running RRS feed

  • Question

  • Hi all,

     

    I build my image using Windows Shell and not Command Prompt Shell with Custom Shell Support.

     

    Can I still use this method?

     

     

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "Shell"="eShell.exe"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Embedded\EEF\Shell Launcher]
    "Shell"="myownprogram.exe"


    Otherwise, I think I am confused that I could do that. Not very sure if I can use the custom shell as I needed to install stuffs for my program before running it.

    The behaviour when I did the above is that myownprogram.exe did not run, but I could manually run it if I pull a task manager up. Can I dump myownprogram.exe into:

    HKLM\Software\Microsoft\Windows\CurrentVersion\Run

    And run it off there?

     

    Thanks!

     

    Edit: Realized that the Run method also can't work. If I try to run eShell.exe, I will get presented with a black screen, but alt-ctrl-del for the task manager, I am able to run my application from there. Just not from boot. Anyone has suggestions?

    Also, where does eShell reside? Maybe I didn't have it...


    Friday, July 29, 2011 9:19 AM

Answers

  • I entered the following:

    wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

    as

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher]

    "Shell"=wscript.exe invisible.vbs app.bat

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\CustomReturnCodeAction]

    "Action"=3 (DWORD)

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\AllOtherReturnCodeAction]

    "Action"=3 (DWORD)

     

    And it works. No cmd popup. Nothing, goes into my application as intended!

    Reference: http://technet.microsoft.com/en-us/library/hh300749%28WinEmbedded.21%29.aspx

     

    Thank you KNARZ! It's a tedious journey! :)

     

    One more question: How effective is specifying the startup directory in a batch file for my case? Because in my app.bat, I'm actually doing:

    @echo off

    CD C:\application\

    app.exe

     

    Cheers!

     


    • Marked as answer by lyk13 Monday, August 8, 2011 6:56 AM
    Monday, August 8, 2011 6:56 AM

All replies

  • I am guessing that you need these installations installed before your shell runs.

    There are a couple of options:

    Automated:

    1. Change  Windows Shell and not Command Prompt Shell with Custom Shell Support to support your application.
    2. Setup the items to be installed during the installation of the OS. Hoefully, the application runs.

    Manual approach:

    1. Don't change Windows Shell and not Command Prompt Shell with Custom Shell Support and let the system boot to cmd.exe.
    2. Manually install your applications.
    3. Change the registry to point to your application to start as the shell: HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher

     

    -Sean

     

     


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step
    Friday, July 29, 2011 4:32 PM
    Moderator
  • Thanks Sean. I am exploring the 2nd option as I try installing the one with Custom Shell support and I will see how it goes. Will revert again. Thanks!
    Monday, August 1, 2011 2:13 AM
  • Hi Sean(and anyone else),

    I am able to boot into my application directly from HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher, but the thing is my application behaves abnormally. I won't go into that as it's a little of a commercial product secret.

    But if I boot into cmd.exe and run the application from the application directory structure itself (In C:\application\; app.exe), it works relatively as per normal.

    If I run it from C:\Windows\System32\, (I created a batch file to run C:\application\app.exe), the application behaves abnormally as booting straight into the program. Same thing goes for "C:\application\app.exe" from C:\Windows\System32.

     

    Any idea why this is the case? Help greatly appreciated!!!

     

    Thanks!

    Thursday, August 4, 2011 1:31 AM
  • Sounds like timing between application and support resources. If the application requires OS resources to be inplace, the application might be loading faster than the resources can be launched. You would have to do a wait on service / resource to be sure.

     

    -Sean

     


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step
    Thursday, August 4, 2011 5:32 AM
    Moderator
  • Thanks Sean. That sounds possible.

     

    How do I do the wait on service/resource?

     

    I also noticed that when my application is able to run properly, there is an instance in the application that will delay for abit of time before progressing as per normal. This is a flash player in a browser window. The page will hang there for maybe 10sec or longer and then it will load as per normal.

     

    Really getting on my nerves and would like to understand why this is the case. More insight into such a scenario would be greatly appreciated. Thank you!

    Thursday, August 4, 2011 11:19 AM
  • More information on your product would be needed to understand what is going on. I know you don't want to talk about this in an open forum.

    To wait on service, you might want to check with the Visual Studio programming forums.

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - ProGuide to WES 7, XP Embedded Advanced, WEPOS / POS for .NET Step-by-Step
    Thursday, August 4, 2011 7:02 PM
    Moderator
  • or the easy way. do a batch with a sleep / wait programm. (i think there is one in the resource kit for windows 2003 or something)
    "Mark/Propose As Answer" if you got one.
    Thursday, August 4, 2011 7:42 PM
  • Thanks Sean and KNARZ,

     

    besides that, any idea why running from different directories result in different behaviour? It just doesn't seem to make much sense. :/

    Friday, August 5, 2011 1:51 AM
  • this has to do with the working directory. (like for shortcuts)
    if you would change the directory in the cmd/bat (cd C:\application) your app will run normaly from system32, because the working directory is changed.
    "Mark/Propose As Answer" if you got one.
    Friday, August 5, 2011 3:00 AM
  • KNARZ, thanksthen could you advise how to run it 'properly' from:

     

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher]

    "Shell"=C:\application\app.exe

     

    I tried putting the above but it doesn't seem to work. I guess it's a case of the working directory from what you mention. But even C:\application\app.exe absolute path won't work?

     

    Update: I used this batch file and pumped it to the "Shell" above:

    @echo off

    CD C:\application\

    app.exe

     

    It works! Is there a better way? Because I now have a cmd.exe open which is rather annoying.


    Friday, August 5, 2011 3:31 AM
  • btw. i hate this kind of forum (the programming...) ece is IE only and now opera isn't working anymore within this forum...

    anyway...

     

    there are several ways to hide cmd/batch windows (vbs, bat2exe). the easiest for you would be to create a shortcut *.lnk which is linked to the batch. under properties of the lnk you can configer the appearence to minimized. you only get a small bar in the left buttom corner.


    "Mark/Propose As Answer" if you got one.
    Friday, August 5, 2011 2:40 PM
  • btw. i hate this kind of forum (the programming...) ece is IE only and now opera isn't working anymore within this forum...

    anyway...

     

    there are several ways to hide cmd/batch windows (vbs, bat2exe). the easiest for you would be to create a shortcut *.lnk which is linked to the batch. under properties of the lnk you can configer the appearence to minimized. you only get a small bar in the left buttom corner.


    "Mark/Propose As Answer" if you got one.

    (Sorry, was the weekend, late reply)

     

    LOL yes I agree. I'm more used to the more common forum boards than this. ~_~

     

    I tried the vbs method but the idea here is that if I set it as a batch file to launch directly under Shell, once closed, it will run again and end up I'm calling 100s of the same instances haha. That method worked well but unless I find a way to not let it restart if closed. I remember there are 2 keys to set to depict the action, but can't seem to get it to work. Tried DWORD and SZ to no avail.

     

    Would love to have it totally not appear, ugh.

     

    Edit: Ok realize the options to not let it restart is actually already in the registry, I set it to a value of 3. Kinda works as it only starts up 1 instance. But the batch window will still momentarily show up. Hmmmmm



    Monday, August 8, 2011 1:32 AM
  • I entered the following:

    wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

    as

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher]

    "Shell"=wscript.exe invisible.vbs app.bat

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\CustomReturnCodeAction]

    "Action"=3 (DWORD)

    [HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\AllOtherReturnCodeAction]

    "Action"=3 (DWORD)

     

    And it works. No cmd popup. Nothing, goes into my application as intended!

    Reference: http://technet.microsoft.com/en-us/library/hh300749%28WinEmbedded.21%29.aspx

     

    Thank you KNARZ! It's a tedious journey! :)

     

    One more question: How effective is specifying the startup directory in a batch file for my case? Because in my app.bat, I'm actually doing:

    @echo off

    CD C:\application\

    app.exe

     

    Cheers!

     


    • Marked as answer by lyk13 Monday, August 8, 2011 6:56 AM
    Monday, August 8, 2011 6:56 AM