views:

469

answers:

4

SUMMARY

How can I make my GUI application run on windows startup on a modified Windows box that will not start explorer.exe.

  • Placing a link in Programs -> Startup folder doesn't get executed.
  • My Application is graphical so I cannot just modify application to run as a service.

Background

I have an application that needs to run on a dedicated PC which is used to generate content for Digital Signage. It's the type of software that generates the announcements and various slideshow content which you see displayed on Plasma / LCD Screens in large organizations.

I've had experience with several different vendors of such content management software and they all basically build a windows application and then strip out things from windows to prevent any kind of popup from showing up etc. One one of the vendors I'm dealing with right now, windows has been modified such that explorer.exe doesn't start.

The run on startup functionality of our program makes use of a link in the Startup Folder. What i've found is that since explorer.exe isn't running neither does my application.

When the computer starts up it automatically boots into the run mode for the digital signage application which starts displaying the programmable content. You can press CTRL-ALT-DELETE and kill their program and then start explorer.exe from the taskmanager. After about a second or so... i see my application start.

So, my question is - How can I make my application load on a Windows box that will not start explorer.exe. Anyone know if say using a registry key in the Run folder would work even in the absence of explorer? Is there some other way way to make program runs on startup?


Edit: Accepted Answer Implementation Notes

I implemented the approach in the accepted answer. Thanks for all the suggestions.
Here are some links which i found useful in implementing it. I never did try the registry key approach. If someone confirms that it would execute w/o explorer.exe loading, please leave a comment.

+5  A: 

Convert your application to a service and set it as auto-start. Alternatively, there are tools online for running an arbitrary exe as a service. Writing one yourself is pretty straightforward.

If your application needs to interact with the desktop and create UI, you'll need your service to launch the exe on the appropriate desktop. To do this, you can use WTSEnumerateSessions to find the interactive user session, WTSQueryUserToken to get its token, then CreateProcessAsUser to launch the application on the correct desktop as that user.

Michael
Tweaked my answer to spell out how to launch a GUI app for a particular user from a service.
Michael
A: 

You could try to modify

[HKEY_CLASSES_ROOT\Folder\shell]

set the default value to path/name of your executable

THIS IS DANGEROUS .. if you mess it up, you might have huge problems getting the system working .. best to try/play in a VM

lexu
A: 

Can you add an entry to the registry's

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

key?

I'm not sure if explorer.exe is responsible for starting up programs that are in this area or if the Windows backend is responsible but it's worth a try.

Sanjay Sheth
That's my question... I have to rely on a customer to test my software in his environment. Can't reproduce his setup in house at the moment. So, experimenting is painful.
blak3r
+2  A: 

<HKLM|HKCU>\Software\Microsoft\Windows\CurrentVersion\Run is the usual place to put stuff, but if that is not good enough HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon has a string called "Userinit" and it does support multiple comma separated values.

If you want to go into undocumented land, there are a million places in the registry where things are started, start Autoruns from Sysinternals while monitoring with RegMon/ProcessMonitor

Anders