如何重新创建 Webstart 应用程序的快捷方式?
我使用应用程序的 jnlp 描述符中的快捷方式标签为我的应用程序创建桌面链接和菜单条目。
如果这些快捷方式在客户端上被删除 - 如何在无需用户操作的情况下自动重新安装它们? jnlp 文件有配置选项吗?
(顺便说一句,我正在使用java6)
I use the shortcut tag in my appliation's jnlp descriptor to create a desktop link and a menu entry for my application.
If these shortcuts get deleted on the client - how can they be reinstalled automatically without user action? Is there a configuration option for the jnlp file?
(btw I'm using java6)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是自动方式的框架(您的类路径中需要
javaws.jar
才能使其工作):Here is a skeleton of an automatic way (you need
javaws.jar
in your classpath for this to work):请参考此链接 - http://mindprod.com/jgloss/javawebstart.html
Please refere this link - http://mindprod.com/jgloss/javawebstart.html
javaws 上 Java6 的 docs 表明您可以使用可执行文件来启动应用程序或执行他们称为控制选项的维护操作。
其中两个选项是:
您可以做的一件事是
因此,如果您可以运行一个脚本,首先卸载您的特定 jnlp 应用程序,然后默默地重新导入它及其快捷方式,那么这将解决您的问题。我不认为 Java 会自动为你做这件事。
请注意,文档说明必须进行静默安装才能使快捷方式选项发挥作用。另外,我自己还没有仔细检查过这是否真的有效。
The docs for Java6 on javaws show that you can either use the executable to launch an app or to perform maintenance operations they call control options.
Two of those options are:
one of the things you can do is
So if you can run a script that first uninstalls your particular jnlp app and then silently re-imports it and its shortcuts then that would solve your problem. I don't think Java will automatically do this for you.
Note that the documentation says that it has to be a silent installation for the shortcut option to work. Also, I haven't double checked that this actually works myself.
我只是想对上述解决方案添加评论,以防它节省任何人的时间。
如果您的应用程序安装在 WebStart 缓存中,但快捷方式已被删除(例如在 java 更新期间,或用户删除),则 javaws -import -silent -shortcut 不会 只需重新创建应用程序的快捷方式即可。至少对于 1.6.0_u35 和 u37 而言。
WebStart 似乎会检查应用程序是否在缓存中,如果在,它就会退出而不创建快捷方式。非常令人失望...
I just wanted to add a comment on the above solution, in case it saves anyone time.
IF your application is installed in the WebStart cache, but the shortcut has been removed (like during a java update, or the user removes) the javaws -import -silent -shortcut will NOT just recreate the shortcut for the application. At least for 1.6.0_u35 and u37.
It seems as though WebStart checks to see if the application is in the cache, if it is, it just exits WITHOUT creating the shortcut. Very disappointing...