开发者

How to create web app shortcut on user's desktop programmatically?

开发者 https://www.devze.com 2023-02-07 06:52 出处:网络
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 simil开发者_运维问答ar to Google Gears, but

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 simil开发者_运维问答ar 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#.


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


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.

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.

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

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

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


Try looking at SaveAs

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.`


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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消