As part of my current project (for controlling industrial machines) I need to replace the Windows XP shell with my own application. We have opted to run the app directly from a memory card (for a number of reasons) and this worked fine until I tried it on a fresh machine yesterday. XP itself is installed on a Solid State Drive (SSD), but we have already tested this before and had no problems with it.
After some trial and error, and a hint provided by this thread, I found the problem: we’re using a USB memory card reader and USB devices can take some time to get on their feet, so trying to run our app at start-up was a big race condition. The reason we hadn’t spotted this before is pure fluke – I guess the drive I was using yesterday was just that bit faster than the ones I’ve used previously.
So, quick fix is to use an app on the hard drive as the shell that just pauses for a few seconds (10 seems to work) before running the real shell. A more robust solution will be to poll the memory card (probably every second) until it springs into life.
Ah well, if this stuff was easy everybody would be doing it :)