如何以编程方式在用户桌面上创建Web应用程序快捷方式?

时间:2022-03-01 23:01:34

For enterprise intranet web application, is there any way to create a desktop shortcut of web application on user's desktop? I'm looking for functionality similar to Google Gears, but without installing Google Gears. I'm looking to give user's a link on web application that says "Click here to install desktop shortcut", when they click on it, a desktop shortcut is installed with the custom icon for our application. Is there a way to do it using javascript or any other client side technologies? I don't want to run any exe on user's machines. Even though it's intranet, I have to jump through lot of corporate hoops, compliance approvals, etc to run exe on their machine. We are trying to avoid that, due to time constraints. User machines are windows XP with IE6 installed. They may all upgrade within next year's time to Windows 7 with IE8. Intranet web application in question is developed using asp.net 3.5, c#.

对于企业Intranet Web应用程序,有没有办法在用户桌面上创建Web应用程序的桌面快捷方式?我正在寻找类似于Google Gears的功能,但没有安装Google Gears。我想给用户一个关于Web应用程序的链接,上面写着“单击此处安装桌面快捷方式”,当他们点击它时,会安装一个桌面快捷方式,其中包含我们应用程序的自定义图标。有没有办法使用JavaScript或任何其他客户端技术?我不想在用户的机器上运行任何exe。即使它是内联网,我也必须通过大量的企业箍,合规性审批等来在他们的机器上运行exe。由于时间限制,我们试图避免这种情况。用户计算机是安装了IE6的Windows XP。他们可能会在明年的时间内升级到使用IE8的Windows 7。有问题的Intranet Web应用程序是使用asp.net 3.5,c#开发的。

4 个解决方案

#1


3  

If this is really a corporate environment then just go talk to the network operations team.

如果这真的是一个企业环境,那就去跟网络运营团队谈谈吧。

It should be trivial for them to add something to the login script to push this link to the people's desktops.

他们在登录脚本中添加一些内容以将此链接推送到人们的桌面应该是微不足道的。

More Info:
http://www.petri.co.il/forums/showthread.php?t=6154
http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb-82e3-2343b2bf31eb

更多信息:http://www.petri.co.il/forums/showthread.php?t = 6154 http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb- 82e3-2343b2bf31eb

#2


1  

Alright, at first I thought that this was an impossible task, until I realized that it's not.

好吧,起初我认为这是一项不可能的任务,直到我意识到它不是。

A shortcut is just a file, and we all know you can download files from links.

快捷方式只是一个文件,我们都知道您可以从链接下载文件。

I'm not sure how well windows shortcuts can be transferred from computer to computer, but I would assume that a shortcut with a location like http://www.google.com/ is not tied to any specific windows machine.

我不确定Windows快捷方式可以从计算机传输到计算机有多好,但我认为像http://www.google.com/这样的位置的快捷方式不依赖于任何特定的Windows机器。

You could zip the shortcut, and point the link to the location of the zip file. Tell the users to unzip the file and place the shortcut. You may be able to just serve the shortcut, but you'd have to give the right headers, and probably specify application/octet-stream or something like it.

您可以压缩快捷方式,并将链接指向zip文件的位置。告诉用户解压缩文件并放置快捷方式。您可能只能提供快捷方式,但您必须提供正确的标头,并可能指定application / octet-stream或类似的东西。

Alternatively you can tell them to right click, go to new -> shortcut, and copy-pasta the url into the location box.

或者,您可以告诉他们右键单击,转到新建 - >快捷方式,然后将URL复制到位置框中。

Alternatively you could write a batch file for the users to download that opens a url in the default browser.

或者,您可以编写一个批处理文件供用户下载,在默认浏览器中打开一个URL。

I know it's not quite as direct as click-button -> receive bacon but it will work.

我知道它不像点击按钮那么直接 - >接收培根,但它会起作用。

#3


1  

Try looking at SaveAs

试着看看SaveAs

document.execCommand("SaveAs", false, "url to desktop");

document.execCommand(“SaveAs”,false,“url to desktop”);

The user will still have to click save and it only saves a HTML page. You would have to open a hidden IFrame containing a web application and call .execCommand on the iframe's document.`

用户仍然需要单击“保存”,它只保存HTML页面。您必须打开一个包含Web应用程序的隐藏IFrame,并在iframe的文档上调用.execCommand

#4


0  

You can create a shortcut (.lnk) file in a directory in your site and put it as the Url for a hyperlink so the users right click and save as they download the .lnk file. Your server will need the mime-type .lnk application/x-ms-shortcut adding.

您可以在站点的目录中创建快捷方式(.lnk)文件,并将其作为超链接的Url放置,以便用户在下载.lnk文件时右键单击并保存。您的服务器需要添加mime类型的.lnk应用程序/ x-ms-shortcut。

The icon can be done by putting it on a network location and using the "Change icon" function to refer to this network location. This works on Windows. I suppose it could be adapted for each OS required?

图标可以通过将其放在网络位置并使用“更改图标”功能来引用此网络位置来完成。这适用于Windows。我想它可以适用于所需的每个操作系统?

#1


3  

If this is really a corporate environment then just go talk to the network operations team.

如果这真的是一个企业环境,那就去跟网络运营团队谈谈吧。

It should be trivial for them to add something to the login script to push this link to the people's desktops.

他们在登录脚本中添加一些内容以将此链接推送到人们的桌面应该是微不足道的。

More Info:
http://www.petri.co.il/forums/showthread.php?t=6154
http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb-82e3-2343b2bf31eb

更多信息:http://www.petri.co.il/forums/showthread.php?t = 6154 http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb- 82e3-2343b2bf31eb

#2


1  

Alright, at first I thought that this was an impossible task, until I realized that it's not.

好吧,起初我认为这是一项不可能的任务,直到我意识到它不是。

A shortcut is just a file, and we all know you can download files from links.

快捷方式只是一个文件,我们都知道您可以从链接下载文件。

I'm not sure how well windows shortcuts can be transferred from computer to computer, but I would assume that a shortcut with a location like http://www.google.com/ is not tied to any specific windows machine.

我不确定Windows快捷方式可以从计算机传输到计算机有多好,但我认为像http://www.google.com/这样的位置的快捷方式不依赖于任何特定的Windows机器。

You could zip the shortcut, and point the link to the location of the zip file. Tell the users to unzip the file and place the shortcut. You may be able to just serve the shortcut, but you'd have to give the right headers, and probably specify application/octet-stream or something like it.

您可以压缩快捷方式,并将链接指向zip文件的位置。告诉用户解压缩文件并放置快捷方式。您可能只能提供快捷方式,但您必须提供正确的标头,并可能指定application / octet-stream或类似的东西。

Alternatively you can tell them to right click, go to new -> shortcut, and copy-pasta the url into the location box.

或者,您可以告诉他们右键单击,转到新建 - >快捷方式,然后将URL复制到位置框中。

Alternatively you could write a batch file for the users to download that opens a url in the default browser.

或者,您可以编写一个批处理文件供用户下载,在默认浏览器中打开一个URL。

I know it's not quite as direct as click-button -> receive bacon but it will work.

我知道它不像点击按钮那么直接 - >接收培根,但它会起作用。

#3


1  

Try looking at SaveAs

试着看看SaveAs

document.execCommand("SaveAs", false, "url to desktop");

document.execCommand(“SaveAs”,false,“url to desktop”);

The user will still have to click save and it only saves a HTML page. You would have to open a hidden IFrame containing a web application and call .execCommand on the iframe's document.`

用户仍然需要单击“保存”,它只保存HTML页面。您必须打开一个包含Web应用程序的隐藏IFrame,并在iframe的文档上调用.execCommand

#4


0  

You can create a shortcut (.lnk) file in a directory in your site and put it as the Url for a hyperlink so the users right click and save as they download the .lnk file. Your server will need the mime-type .lnk application/x-ms-shortcut adding.

您可以在站点的目录中创建快捷方式(.lnk)文件,并将其作为超链接的Url放置,以便用户在下载.lnk文件时右键单击并保存。您的服务器需要添加mime类型的.lnk应用程序/ x-ms-shortcut。

The icon can be done by putting it on a network location and using the "Change icon" function to refer to this network location. This works on Windows. I suppose it could be adapted for each OS required?

图标可以通过将其放在网络位置并使用“更改图标”功能来引用此网络位置来完成。这适用于Windows。我想它可以适用于所需的每个操作系统?