I'm currently trying to make an application written in .Net CF 2.0 start automatically during the startup of a Windows CE 5.0 device.
Based on this article: http://blogs.msdn.com/b/cenet/archive/2004/12/03/274661.aspx I tried putting a shortcut to my application in the Startup folder of windows directory or adding a registry value to the HKLM\init like "Launch77"="app.exe" which both didn't work because the storage and registry of the device are volatile and get reset when the device is turned off.
Then I tried using registry hive and made a system.hv to make the registry changes persistent but in HKLM\init\BootVars the SystemHive is set to a folder residing on the volatile storage.
Is there any other way to start the application? Can I force the device use the memory card to backup/restore the registry?
The answer really depends on the configuration of the device. If nothing is persisted on the device, including the registry, it will be very difficult to get this to work unless the OEM provides some proprietary "startup" sequence (many do, but it's OEM-specific).
Generally, if you have a persistent file system, you would put a shortcut to the app in the \Windows\Startup folder. If the file system isn't persistent, this will not work.
If you have a persistent registry (you may have to call RegFlushKey after making the change to get it to persist), then using the HKLM\Init
key should work (assuming you wait until all of the proper APIs are ready to launch the CLR).
If neither of these are available, then check with the OEM. Almost all of the devices I've used had some mechanism for launching an app off of storage (internal flash, USB, SD, etc), but again it is very device-specific so I can't point you in any specific direction.