如何重新创建 Webstart 应用程序的快捷方式?

发布于 2024-08-03 03:33:40 字数 161 浏览 6 评论 0原文

我使用应用程序的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

鹤舞 2024-08-10 03:33:40

这是自动方式的框架(您的类路径中需要 javaws.jar 才能使其工作):

IntegrationService is = null;
try
{
    is = (IntegrationService) ServiceManager.lookup("javax.jnlp.IntegrationService");
}
catch (UnavailableServiceException use)
{
    // integration service unavailable
}

if (!is.hasDesktopShortcut())
{
    if (!is.requestShortcut(true, true, "Companyapp"))
    {
        // failed to install shortcuts
    }
}
else
{
    // shortcuts already exist
}

Here is a skeleton of an automatic way (you need javaws.jar in your classpath for this to work):

IntegrationService is = null;
try
{
    is = (IntegrationService) ServiceManager.lookup("javax.jnlp.IntegrationService");
}
catch (UnavailableServiceException use)
{
    // integration service unavailable
}

if (!is.hasDesktopShortcut())
{
    if (!is.requestShortcut(true, true, "Companyapp"))
    {
        // failed to install shortcuts
    }
}
else
{
    // shortcuts already exist
}
巴黎盛开的樱花 2024-08-10 03:33:40

请参考此链接 - http://mindprod.com/jgloss/javawebstart.html

摘要:如果您希望 JWS 重新创建
菜单和/或桌面快捷方式,删除
菜单项和桌面
图标,然后运行 ​​javaws -viewer
命令行,然后单击按钮
创建快捷方式。如果其中任何一个
存在,javaws.exe不会创建
其他。它也可能不会创造它们
你期待的地方,所以看看
周围。

Please refere this link - http://mindprod.com/jgloss/javawebstart.html

SUMMARY:If you want JWS to recreate
menu and/or desktop shortcuts, delete
both the menu item and the desktop
icon, then run javaws -viewer on the
command line then click the button to
create the shortcuts. If either one
exists, javaws.exe won’t create the
other. It also might not create them
where you were expecting, so look
around.

空心空情空意 2024-08-10 03:33:40

javaws 上 Java6 的 docs 表明您可以使用可执行文件来启动应用程序或执行他们称为控制选项的维护操作。

其中两个选项是:

javaws -uninstall <jnlp>
javaws -import [import-options] <jnlp>

您可以做的一件事是

javaws -import -silent -shortcut <jnlp>

因此,如果您可以运行一个脚本,首先卸载您的特定 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:

javaws -uninstall <jnlp>
javaws -import [import-options] <jnlp>

one of the things you can do is

javaws -import -silent -shortcut <jnlp>

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.

猫瑾少女 2024-08-10 03:33:40

我只是想对上述解决方案添加评论,以防它节省任何人的时间。

如果您的应用程序安装在 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文