windows-embeddedwindows-embedded-8

How do I automatically launch a non-Surface application in Windows Embedded 8?


How do I automatically launch a non-Surface application in Windows Embedded 8?

I want to automatically launch a GUI application on startup in Windows Embedded 8, but I can't figure out how to do it. I've been reading Sean Liming's Professional's Guide to Windows Embedded 8 Standard, and in chapter 8 he describes how to modify the device experience. He names how there is a Windows 8 Application launcher, but for Surface apps only. He also describes a Shell Launcher module, but my app is not a shell. He also mentions a shell he wrote here, but reading through its documentation, it doesn't describe how to automatically launch a program within that shell.

As far as I can tell, he doesn't describe how to automatically launch a non-Surface application anywhere, and Google and Stack Exchange get me no results (it doesn't help that most results come back as merely Windows 8, and not Windows Embedded 8). Or am I mistaken? Is Shell Launcher sufficient to launch a non-shell app? Does the app launched become the "shell", in effect?

Side note: It's probably worth mentioning that the app I want to launch is a Java app. I will be including the module-based Java JRE installer as mentioned in the book, but if there are any other provisos to launching a Java app in WE8S, please comment.

Thanks for your time and feedback!


Solution

  • This works for both Windows Embedded Standard 7 and Windows Embedded 8 Standard:

    I normally install Windows Embedded Standard with the standard shell. In WE8S this would be the Metro UI. Once installation and configuration is complete, and your application runs successfully, I use registry entries to modify the application launched on startup.

    Custom user-specific shell

    As an example, to launch VLC media player as the shell, and play media files in a folder on the d:\ e.g d:\media in a continuous loop, I use the below in a .bat file, running as administrator.

    This must be run while logged into the user that will launch the custom shell

    This modifies the shell for the !Current User! (i.e. the logged on user) to launch VLC.exe on logon. (I use reg.exe because some slimmed down installations might not have regedit.exe included)

    This means that you can still access the full user interface when logging on as the administrator user (via safe mode if Administrator profile is normally disabled), since the shell for all other users is still the explorer shell.

    Launching the explorer shell from within the custom shell

    You can still launch the explorer shell with the metro UI when the user with the custom shell is logged on. To launch the explorer shell from the user running the VLC (custom) shell:

    Java application as a shell

    More to the point, in order to run your java app, change the below entry in the above .bat

    from:

    c:\Windows\system32\reg.exe ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "c:\program files\vlc\vlc.exe -f --loop ""d:\media"""
    

    to

    c:\Windows\system32\reg.exe ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "java [any other JVM options you need to give it] -jar "path\jar-file-name.jar""
    

    If your java app does not include a manifest the above will not work!

    Try this (I have not tested this):

    java -cp jar-file-name.jar full.package.name.ClassName
    

    Revert to the Explorer (default shell) i.e. Undo user-specific shell

    To undo the shell changes for the user i.e. revert back to original settings:

    !This must be run while logged into the user with the custom shell!

    User Auto Logon:

    You can configure Windows to automatically log onto a specific user profile.

    The next time you start up Windows, the user account you selected will automatically be loaded

    Things to consider

    Play around, but use a test environment if possible If you can launch the shell, so can someone else. Use the keyboard filter to filter out known key combinations, and create one only you, and perhaps the service technicians will know. Remove admin rights for the user with the custom shell Use the Unified Write Filter (or Enhanced Wright Filter/File Based Write Filter). Un-protect only when making changes.

    A big THANK YOU to Sean Liming and the work that does - he inspired this.

    Mark Böhmer Windows Embedded Specialist South Africa