简体   繁体   English

如何在Windows Embedded 8中自动启动非Surface应用程序?

[英]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? 如何在Windows Embedded 8中自动启动非Surface应用程序?

I want to automatically launch a GUI application on startup in Windows Embedded 8, but I can't figure out how to do it. 我想在Windows Embedded 8中启动时自动启动GUI应用程序,但是我不知道该怎么做。 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. 我一直在阅读Sean Liming的《 Windows Embedded 8 Standard专业指南》 ,在第8章中,他介绍了如何修改设备体验。 He names how there is a Windows 8 Application launcher, but for Surface apps only. 他列举了一个Windows 8应用程序启动器的名称,但仅适用于Surface应用程序。 He also describes a Shell Launcher module, but my app is not a shell. 他还介绍了Shell Launcher模块,但我的应用程序不是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. 他还提到了他在此处编写的shell,但是通读其文档并没有描述如何在该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). 据我所知,他没有描述如何在任何地方自动启动非Surface应用程序,并且Google和Stack Exchange没有给我带来任何结果(大多数结果仅以Windows 8而不是Windows 8来帮助我) Windows Embedded 8)。 Or am I mistaken? 还是我弄错了? Is Shell Launcher sufficient to launch a non-shell app? Shell Launcher是否足以启动非Shell应用程序? 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. 旁注:可能值得一提的是,我要启动的应用程序是Java应用程序。 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. 我将包括书中提到的基于模块的Java JRE安装程序,但是如果在WE8S中启动Java应用程序还有其他规定,请发表评论。

Thanks for your time and feedback! 感谢您的时间和反馈!

This works for both Windows Embedded Standard 7 and Windows Embedded 8 Standard: 这适用于Windows Embedded Standard 7和Windows Embedded 8 Standard:

I normally install Windows Embedded Standard with the standard shell. 我通常使用标准外壳安装Windows Embedded Standard。 In WE8S this would be the Metro UI. 在WE8S中,这将是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:\\ eg d:\\media in a continuous loop, I use the below in a .bat file, running as administrator . 例如,要启动VLC媒体播放器作为外壳,并连续循环播放d:\\文件夹中的媒体文件,例如d:\\ media,我在.bat文件中以管理员身份运行以下内容。

This must be run while logged into the user that will launch the custom shell 这必须在登录到将启动自定义外壳程序的用户中运行

  • Create a new .bat file: 创建一个新的.bat文件:

    1. in Windows Explorer, Select "File" -> "New" -> "Text Document" 在Windows资源管理器中,选择“文件”->“新建”->“文本文档”
    2. Rename "New Text Document.txt" to custom_shell.bat 将“ New Text Document.txt”重命名为custom_shell.bat
  • Paste the below into the file 将以下内容粘贴到文件中

  • Save the file 保存文件
  • Right click the file -> "Run as Administrator" 右键单击文件->“以管理员身份运行”

     c:\\Windows\\system32\\reg.exe DELETE "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" /v Shell /f c:\\Windows\\system32\\reg.exe ADD "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" /v Shell /t REG_SZ /d explorer.exe 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""" c:\\Windows\\system32\\reg.exe DELETE "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IniFileMapping\\system.ini\\boot" /v Shell /f c:\\Windows\\system32\\reg.exe ADD "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IniFileMapping\\system.ini\\boot" /v Shell /t REG_SZ /d "USR:Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" pause 

This modifies the shell for the !Current User! 这将修改!Current User!的外壳 (ie the logged on user) to launch VLC.exe on logon. (即已登录的用户)以在登录时启动VLC.exe。 (I use reg.exe because some slimmed down installations might not have regedit.exe included) (我使用reg.exe,因为某些精简安装可能不包含regedit.exe)

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. 当具有自定义外壳程序的用户登录时,您仍然可以使用Metro UI启动资源管理器外壳程序。 To launch the explorer shell from the user running the VLC (custom) shell: 要从运行VLC(自定义)外壳的用户启动浏览器外壳,请执行以下操作:

  • Start the task manager (CTRL+SHIFT+ESC) 启动任务管理器(CTRL + SHIFT + ESC)
  • Click on the "Advanced" button at the bottom of the task manager 单击任务管理器底部的“高级”按钮
  • Select "File" -> "New Task (Run...)" from the menu bar 从菜单栏中选择“文件”->“新建任务(运行...)”
  • Enter "Explorer.exe" (This start the explorer service) 输入“ Explorer.exe”(这将启动资源管理器服务)
  • Repeat the above steps again (This will lauch an instance of Windows Explorer) 再次重复上述步骤(这将启动Windows资源管理器的实例)
  • The Metro UI should be usable then 然后,Metro UI应该可用

Java application as a shell Java应用程序作为外壳

More to the point, in order to run your java app, change the below entry in the above .bat 更重要的是,为了运行Java应用程序,请在上方.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! 如果您的Java应用程序不包含清单,则以上操作将无效!

Try this (I have not tested this): 试试这个(我还没有测试过):

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

Revert to the Explorer (default shell) ie Undo user-specific shell 恢复到资源管理器(默认外壳程序),即撤消用户特定的外壳程序

To undo the shell changes for the user ie revert back to original settings: 要撤消用户对外壳的更改,即恢复为原始设置:

!This must be run while logged into the user with the custom shell! !必须在使用自定义外壳程序登录用户时运行!

  • Create a new .bat file: 创建一个新的.bat文件:

    1. in Windows Explorer, Select "File" -> "New" -> "Text Document" 在Windows资源管理器中,选择“文件”->“新建”->“文本文档”
    2. Rename "New Text Document.txt" to default_shell.bat 将“ New Text Document.txt”重命名为default_shell.bat
  • Paste the below into the file 将以下内容粘贴到文件中

  • Save the file 保存文件
  • Right click the file -> "Run as Administrator" 右键单击文件->“以管理员身份运行”

     c:\\Windows\\system32\\reg.exe DELETE "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" /v Shell /f c:\\Windows\\system32\\reg.exe ADD "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" /v Shell /t REG_SZ /d explorer.exe c:\\Windows\\system32\\reg.exe DELETE "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IniFileMapping\\system.ini\\boot" /v Shell /f c:\\Windows\\system32\\reg.exe ADD "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IniFileMapping\\system.ini\\boot" /v Shell /t REG_SZ /d "SYS:Microsoft\\Windows NT\\CurrentVersion\\Winlogon" c:\\Windows\\system32\\reg.exe DELETE "HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" /v Shell /f pause 

User Auto Logon: 用户自动登录:

You can configure Windows to automatically log onto a specific user profile. 您可以将Windows配置为自动登录到特定的用户配置文件。

  • Start > Search > netplwiz 开始>搜索> netplwiz
  • OR [Windows Key + R] > netplwiz 或[Windows键+ R]> netplwiz
  • A 'User Account' window will open. “用户帐户”窗口将打开。 Highlight the account you want to automatically load when Windows starts. 突出显示您要在Windows启动时自动加载的帐户。
  • Uncheck the box above it titled “Users must enter a user name and password to use this computer.” 取消选中标题为“用户必须输入用户名和密码才能使用此计算机”上方的框。
  • Click OK. 单击确定。
  • You will be prompted to confirm the operation by entering your password. 输入密码将提示您确认操作。
  • Enter your password to complete the change. 输入密码以完成更改。

The next time you start up Windows, the user account you selected will automatically be loaded 下次启动Windows时,将自动加载您选择的用户帐户

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). 使用自定义外壳删除用户的管理员权限使用统一写过滤器(或增强型Wright过滤器/基于文件的写过滤器)。 Un-protect only when making changes. 仅在进行更改时取消保护。

A big THANK YOU to Sean Liming and the work that does - he inspired this. 非常感谢 Sean Liming及其所做的工作-他启发了这一点。

Mark Böhmer Windows Embedded Specialist South Africa MarkBöhmerWindows Embedded Specialist南非

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM