none
Organize application architecture RRS feed

  • Question

  • Hi,

    I want my application to be automaticly launched as Windows CE start. I success using the Regedit entry :
    HKEY_LOCAL_MACHINE\Init

    Here is what I've done :

    1 - Put my executable in the release folder of my PB project (MyApplication.exe)

    2 - Add the file to the Project.bib file :

    FILES
    ; Name      Path                      Memory Type
    ; -------------- --------------------------------------------- -----------
    Myapplication.exe $(_FLATRELEASEDIR)\MyApplication.exe   NK S
    ...

    3 - Add my application in the Project.dat so that it could be map into a folder inside the Program File folder

    root:-Directory("Program Files")
    Directory("\Program Files"):-Directory("MySoftwareCompany")
    Directory("\Program Files\MySoftwareCompany"):-File("MyApplication.exe","\windows\MyApplication.exe")

    4 - Add the launching entry to the Project.reg file where (32, 00) is the explorer.exe executable id after which my application must be started.

    [HKEY_LOCAL_MACHINE\init]
    "Launch99"="\\Program Files\\MySoftwareCompany\\MyApplication.exe"
    "Depend99"=hex:32,00

    Therefore, I thought it would be nicer to have a file/folder structure for my application. Something like

    \\Program Files\\MySoftwareCompany
    \\Program Files\\MySoftwareCompany\MyApplication.exe
    \\Program Files\\MySoftwareCompany\MyApplication.ini
    \\Program Files\\MySoftwareCompany\ConfigElement\Config1.ini
    \\Program Files\\MySoftwareCompany\ConfigElement\Config2.ini
    \\Program Files\\MySoftwareCompany\ConfigElement\Config3.ini

    But I read on this site http://blogs.msdn.com/b/mikehall/archive/2005/03/23/401348.aspx that it is a wasted of RAM to create this kind of architecture.

    Keep in mind that all ROM files exist in the \Windows\ folder
    already, so copying EXE and DLL files to RAM-based folders in a
    DAT file just wastes space. Instead, you should create a shortcut
    file to reference the EXE in the windows folder
    

    I think this is not practical having to put all the application files inside the Widows folder. I think it sound a little bit disorganized. Is there any way to organize architecture wihout having to waste ram space ?

    Another thing, what is the advantages of putting my application as MODULE instead of FILE ?

    PS : I'm using Microsoft Plateform Builder 5 
          The application is a kind of scada running 24/24 communicating whith automate modbus.

    Thanks for your help
    Best regards

    Monday, June 14, 2010 8:37 PM

All replies

  • You don't HAVE to include your application in the kernel image. If you
    include it in the image it will end up in the windows folder. All
    included files and modules will end up there. If you don't want to
    duplicate the file in memory you should create shortcuts. Of course,
    your shortcut will be duplicated in memory as well, but that's only a
    couple of bytes.
     
    The benefit of adding files to the modules section is that the
    rombuilder can strip the PE headers and place the binary code very
    efficiently, thereby saving RAM.
     
    If you don't add your application to the kernel you can simply copy your
    application (after deploying the kernel) to a persistent storage
    location. If you have mounted some persisted storage as root or you have
    set the shell folder location to a persisted storage you can simply copy
    your application to \\Program Files and it will not take up any RAM space.
     

    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.
    Tuesday, June 15, 2010 12:36 AM
    Moderator
  • Hi Michel,

    The problem is that we absolutely need to include the application in the kernel (OS image). Thus, I was just asking why isn't possible to organize the application file into folders. Like we do while installing a new softare on standard Windows XP, 7, etc... I mean : Some file goes in the "Program Files\NewSoftware" 

    Ex :
      \Program Files\NewSoftware\MyApplication.exe
      \Program Files\NewSoftware\ConfigElement
      \Program Files\NewSoftware\ConfigElement\ConfigElement1.ini
      \Program Files\NewSoftware\ConfigElement\ConfigElement2.ini
      \Program Files\NewSoftware\Images
      \Program Files\NewSoftware\Images\Image1.jpg
      ...

    The fact that we are putting all the files inside the Windows folder sound a little bit disorganized compare to windows standard edition. But if it is the only way on Windows CE then I will do with it ;)


    As I'm new to Plateform Builder I think that I don't really understand where you said :

    If you don't add your application to the kernel you can simply copy your
    application (after deploying the kernel) to a persistent storage
    location. If you have mounted some persisted storage as root or you have
    set the shell folder location to a persisted storage you can simply copy
    your application to \\Program Files and it will not take up any RAM space.

    If I don't put my application into the Kernel mean that I will not include my application in the OS Image. Nor in the File or Module ? Simply put it into a permenant storage like a NORFlash reserved permenant folder ?

    Else if I include the application into as FILE and I use the DAT file to copy it into \Program Files\xxx\ will automaticly waste RAM ?

    Best regards
    Martin

    Tuesday, June 15, 2010 3:38 AM
  • The \Windows folder in Windows CE for ROM files doesn't really exist in the sense that a folder on the hard disk in Windows Embedded Standard does. That is, it's an amalgam of MODULES in the BIB files and FILES, all stored in ROM.  I suppose that MS could have come up with some scheme to attach a folder to each of those things and allow the ROM Filesystem to handle all of that.  It probably didn't seem valuable and it certainly would have slowed down ROM file access.

    The normal way to create non-Windows copies of things is to use a DAT file and copy the file(s) to other locations in the filesystem from their source in \Windows.  This, of course, does commit twice the storage, whether RAM or flash or whatever, to the application and its files as the copy in ROM will never go away and, if you copy it to \program files and that happens to be in RAM, you're taking up RAM, too.

    You haven't said *why* you absolutely need to include the application in the OS image, so we can't really evaluate what the best solution is.  My experience has been that only things that you think will never change during the course of the installed history of the device should be in the OS image.  In the devices that I've built, most of the *applications* have been copied during production to a flash filesystem where they can be easily updated later by the customer without reflashing the entire operating system.

    Paul T.

    Tuesday, June 15, 2010 3:17 PM