Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

SilentLaunch a simple Windows Shell replacement for HTPC (Updated 11.06.2011)

It has been a while since I’ve created anything small and useful for the community. This time the XBMC for Windows is the new “it” for me. The time of HD-movies is here and the HTPC boxes are growing beneath the TV-sets and here is a simple solution for getting the XBMC as a “shell”.

First of all I would like to say thank you to ritchiethebrit at GameEx for his InstantSheller. If the site is down, then download it from me here

The InstantSheller will set your HKEY_CURRENT_USER \Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell from blank (meaning use the default explorer.exe) to something else + it will make you able to customize your boot-loading screen, removing cursors etc. Simple, plain and easy! 🙂

The only problem with replacement of the shell is that parameters cannot be included. Meaning that you need some kind of launcher and that is where the SilentLaunch comes in. It will start a list of programs based its config %homedrive%\SilentLaunch.cfg and here you can include your params and launch order.

Downloade SilentLaunchv2 (exe)
Download SilentLaunchv2 Source code (created with Visual Studio 2010 c++ win32)
Download SilentLaunch
Download SilentLaunch Sourcecode (created with Visual Studio 6.0 c++ win32)

Usage
1. Create a blank text-file on you C:\ drive called “SilentLaunch.cfg”
2. Add your applications you want. (Remember to put ” around paths that contains spaces!) add params after that.
3. Test your application by running it with a “-v” argument that will verbose the steps.

Example of SilentLaunch.cfg (one line = one action)

%systemroot%\system32\calc.exe
%systemroot%\notepad.exe %systemroot%\win.ini
c:\doesnotexists.exe
"c:\program files\someapplication.exe"
"c:\program files\xbmc.exe" -fs -p

This configuration will try to launch 5 applications when SilentLaunch is triggered.

Please note that %systemroot% usally doesn’t have spaces in it variable, but %programfiles% does (eg c:\program files)
If you try to launch anything from that you need quotes (“) around it, eg: “%programfiles%\XBMC\xbmc.exe” -fs -p

Take each variable you have in the config-file and test it in the commandprompt (Start -> Run -> cmd.exe) and check if it starts as it should, the returncodes from the system is equal SilentLaunch

The enviroment variables only work with v2 of SilentLaunch

Setup with InstantSheller
Note: Please test you config before you set it as shell in instantsheller!

Just place the SilentLaunch.exe where ever you like, for instance c:\SilentLaunch.exe. Then run the InstantSheller and make the C:\SilentLaunch.exe as your “Application to shell”.

Help nothing is showing up
You did test the config didn’t you? 🙂

Press CTRL+LSHIFT+ESC to get the taskmanager up, then press File -> Run enter “Explorer.exe” and you’ll get a explorer window to browse.

If you encounter other problems, please use Instantsheller to undo back to default shell (using method above), fix the problem and try again.

Returncodes in verbose mode
00 = “The operating system is out of memory or resources.”.
02 = “The specified file was not found”.
03 = “The specified path was not found.”.
05 = “The operating system denied access to the specified file”.
08 = “There was not enough memory to complete the operation.”.
10 = “Wrong Windows version”.
11 = “The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).”.
12 = “Application was designed for a different operating system”.
13 = “Application was designed for MS-DOS 4.0”.
15 = “Attempt to load a real-mode program”.
16 = “Attempt to load a second instance of an application with non-readonly data segments”.
19 = “Attempt to load a compressed application file”.
20 = “Dynamic-link library (DLL) file failure”.
26 = “A sharing violation occurred.”.
27 = “The filename association is incomplete or invalid.”.
28 = “The DDE transaction could not be completed because the request timed out.”.
29 = “The DDE transaction failed”
30 = “The DDE transaction could not be completed because other DDE transactions were being processed.”.
31 = “There is no application associated with the given filename extension.”.
32 = “The specified dynamic-link library was not found.”.
OTHERWISE = “undocumented”.

Really off topic for programmers only
I encountered an error while compiling this program in release mode. The errors where:

Linking...
libcp.lib(locale.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcp.lib(wlocale.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcp.lib(xlocale.obj) : error LNK2001: unresolved external symbol ___security_cookie
libcp.lib(locale.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcp.lib(wlocale.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libcp.lib(xlocale.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4

Microsoft had the solution and it can be found here: http://support.microsoft.com/?id=894573

Basically you need to add the “bufferoverflowU.lib” library to the release mode to include the “security cookie” variables. This could be useful to others, please let me know 😉

Note: The bufferoverflowU.lib function isn’t needed in Visual Studio 2010! 🙂