通过 Java Applet 安装驱动程序
只是想知道是否有人有通过 Java Applet 安装硬件驱动程序的经验。我目前正在编写一个小程序,它将访问一些硬件并将嵌入到网页中。为了让最终用户更容易,我想让它检测是否安装了驱动程序,如果没有安装它们。
这将是一个签名的小程序,因此它应该能够访问文件和系统信息。据我了解,驱动程序只是放置在正确位置的几个系统文件以及一些注册表设置。
这可行吗?我在网上找不到任何有关执行此操作的信息。
Just wondering if anyone has had any experience with installing hardware drivers via a Java Applet. I'm currently writing an applet that will be accessing some hardware and will be embedded into a web page. In order to make things easier for end users I would like to have it detect if the drivers are installed and if not install them.
This will be a signed applet, so it should be able to access files and system information. From what I understand, drivers are just a few system files being placed in the right spot with a few registry settings as well.
Is this doable? I can't find any info online about doing this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Windows 上,我想您可以使用此处描述的方法访问注册表(运行reg 命令)。
另一种方法是 JNI 注册表接口。
但我不确定这是否是最简单的方法。您可能只是尝试加载相关的驱动程序类,如果失败,请下载普通的 Windows 安装程序 .msi 或 .exe 来执行实际的驱动程序安装。如果绝对有必要对用户隐藏安装程序,您通常可以将安装程序配置为“静默”运行,无需用户交互。但这可能不是重点,因为新的硬件驱动程序可能需要重新启动 Windows。
您可能会遇到的另一个问题是大多数驱动程序需要管理员访问权限才能安装它们。
On windows I guess you could access the registry using the method described here (running the reg command).
Another approach is this JNI registry interface.
I'm not sure either is the easiest approach however. You could probably just try to load the relevant driver classes, and if that fails download a normal windows installer .msi or .exe to do the actual driver installation. You can usually configure the installer to run 'silently' without user interaction, if absolutely necessary to hide it from the user. That may be beside the point however, since it's likely that a new hardware driver will need to reboot Windows.
Another problem you will probably encounter is the most drivers will need administrator access to install them.